cancel
Showing results for 
Search instead for 
Did you mean: 

Call dynpro from WDP

Former Member
0 Kudos

Dear Experts

Can anyone let me know how to execute WDP Application in SAPGUI from WDP .

I have two options with 1 input

Input  = WDP Application name

Options are 1) Browser 2) SAP GUI.

When user selects SAP GUI , I need to open WDP Application in SAP GUI itself.  I used WDY_EXECUTE_IN_PLACE FM but its not working.

Waiting for your reply.

Thanks

KH

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Santosh,

Write this code on the action of the selection of SAP GUI.

data: lv_guid TYPE string,

        lv_filename TYPE string,

        lv_mimetype TYPE string,

        lv_content TYPE xstring,

        lv_sct TYPE string.

  data: lo_api_component TYPE REF TO CL_WDR_COMPONENT.

  lo_api_component ?= WD_COMP_CONTROLLER->WD_GET_API( ).

  lv_guid = LO_API_COMPONENT->GET_ID( ).

  CALL FUNCTION 'SWN_CREATE_SHORTCUT'

   EXPORTING

*    I_TRANSACTION                 = ''

     I_REPORT                      = 'Z******'

*    I_SYSTEM_COMMAND              = ''

*    I_PARAMETER                   =

*    I_SAPLOGON_ID                 =

     I_SYSID                       = SY-SYSID

*    I_GUIPARM                     ='

     I_CLIENT                      = SY-MANDT

     I_USER                        = SY-UNAME

     I_LANGUAGE                    = SY-LANGU

*    I_WINDOWSIZE                  = 'Normal window'

*    I_TITLE                       =

*    I_CUSTOM                      =

   IMPORTING

*    SHORTCUT_TABLE                =

     SHORTCUT_STRING               = lv_sct

*  EXCEPTIONS

*    INCONSISTENT_PARAMETERS       = 1

*    OTHERS                        = 2

            .

  IF SY-SUBRC <> 0.

* Implement suitable error handling here

  ENDIF.

          cl_http_utility=>if_http_utility~encode_utf8(

           EXPORTING

             unencoded         lv_sct

           RECEIVING

             encoded           = lv_content

           EXCEPTIONS

             conversion_failed = 1

             OTHERS            = ).

         CONCATENATE lv_guid '.sap' INTO lv_filename.

         lv_mimetype = 'application/x-sapshortcut'.

         cl_wd_runtime_services=>attach_file_to_response(

            i_filename      = lv_filename

            i_content       = lv_content

            i_mime_type     = lv_mimetype

*             i_in_new_window = abap_false

*             i_inplace       = ABAP_false

         ).


After this in the report (Z*****) for which u created shortcut call the web dynpro application with the FM wdy_execute_in_place.


Hope it helps.


Regards,

Taiyeb

Former Member
0 Kudos

Hi,

I just need to call the webdynpro application same as STARTMODE = GUI from WEBDYNPRO APPLICATION ONLY.

i.e user executes webdynpro application where he has a option to open the desired wdp application in SAP GUI.

Thanks

KH

0 Kudos

Hi Santosh,

I can understand that with STARTMODE = GUI it will open the webdynpro application in sap gui, but from webdynpro we cannot call transaction directly since it will lead to a dump.

The above method is the alternative for it and if you have a transaction pass the tcode in the i_transaction parameter for the swn_create_shortcut FM.

Hope it helps.

Regards,

Taiyeb