Hi Vamshi,
For the first option i think you can try the fm " WDY_EXECUTE_IN_PLACE" and in application parameter pass webdynpro component name. With this it doesnt open an new browser.
ex:
CALL FUNCTION 'WDY_EXECUTE_IN_PLACE'
EXPORTING
* PROTOCOL = " HTTP | HTTPS
* INTERNALMODE = 'X' "SPACE - browser is started
* PARAMETERS =
application = 'Z_Test_appln'
* CONTAINER_NAME =
EXCEPTIONS
invalid_application = 1
browser_not_started = 2
OTHERS = 3.
IF sy-subrc EQ 1.
MESSAGE a400.
ELSEIF sy-subrc = 2.
MESSAGE a401.
ELSEIF sy-subrc = 3.
MESSAGE a667.
ENDIF.
Best Regards,
K.Srikanth Reddy