cancel
Showing results for 
Search instead for 
Did you mean: 

Executing .SAP file from MIME on user action

Former Member
0 Kudos

Hi experts,

I have uploaded a SAP Shortcut as a MIME object in webdynpro component.

Now i need to execute/access this file of button click.

How i can achieve this funcationality.

Thanks

Depesh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I used Attach_file_to_response method with mime content to execute this.

Thannk you

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can download the content like any other content using the

cl_wd_runtime_services=>attach_file_to_response API.

If the content is in the MIME repository, you can read it into a XSTRING using the MIME Repository API:

cl_mime_repository_api=>if_mr_api~get_api( )

data lr_mime_rep type ref to if_mr_api.
  constants lc_custom_path type string
                           value 'SAP/PUBLIC/BC/NWDEMO_MODEL/Products_custom.xml'.
  lr_mime_rep = cl_mime_repository_api=>if_mr_api~get_api( ).

  call method lr_mime_rep->get
    exporting
      i_url     = lc_custom_path
    importing
      e_content = mv_products_xml.

However this might not start the SAPGUI, it might only prompt the user to save the shortcut file. If you really want to launch a SAPGUI transaction from WDA, the supported SAP suggested way is to use the NetWeaver Portal or NetWeaver Business Client and trigger Object Based Navigation.