cancel
Showing results for 
Search instead for 
Did you mean: 

Open/Use a report in web dynpro app via html ui to download an PDF from optical archive

Former Member
0 Kudos

Hello,

I want to use a report programm in a web dynpro app. I already can use the report and save the file in my local, therefor i open a new html ui window in my web dynpro with the fallowing code:

**********************************************************************************************

concatenate 'https://' sy-sysid '.wdf.sap.corp'    into lv_url.
concatenate lv_url '/sap/bc/gui/sap/its/webgui'    into lv_url.
concatenate lv_url '?~transaction=ZDH_DOWNLOAD_OBJ' into lv_url. *ZDH_DOWNLOAD_OBJ is the report name

   lo_api_component = wd_comp_controller->wd_get_api( ).
   lo_window_manager = lo_api_component->get_window_manager( ).

condense lv_url no-gaps.

lo_window = lo_window_manager->create_external_window(
       url     = lv_url
       modal   = abap_true
   ).

   lo_window->open( ).


************************************************************************************************

But when i test this it looks very unsightly! Do you know a function or something, within the user doesn't see a windows like the html ui working, but just recognize that the download/usage of the report was succesfull. I heard about SUBMIT can i use this for my problem and how can I use this?

Thanks for all answers and advice,

Daniel

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

It will look like that as ITS will open SAP GUI in html. In your report how you are downloading pdf files..?  Try to move the logic to build the pdf xstring to a FM/class method and call it in your Web Dynpro Application.

In your WDA application create an Interactive UI and bind the source to an attribute of type xstring and set the pdf xstring data to that attribute or pass the pdf xstring data to cl_wd_runtime_services=>attach_file_to_response method to download it.

Regards,

Kiran

Former Member
0 Kudos

Thanks for your advice! I can now download the PDF via cl_wd_runtime_services=>attach_file_to_response ! Therefor I can select my download path in a popup, but I want to download the PDF to a path, which I enter in a TextInput-Field in my View before download. So I don't want a pop up with "save cancel open" just "File download completed! "! Maybe I can do it with the   I_INPLACE   export parameter with type boolean false? I know that I have to build a pop up window etc. for my pop up, so I just need the download process.

I hope you understand my problem. : )

Regards,

Daniel

former_member184578
Active Contributor
0 Kudos

Hi,

Due to security reasons it's not possible. If you are netweaver 7.0 ehp1 you can use AcfUpDownload to achieve the silent download without popup dialog.

Check this demo for the same

Hope this helps u,

Regards,

Kiran

Former Member
0 Kudos

Thanks for this! Do you know, how I can do multiple downloads via cl_wd_runtime_services=>attach_file_to_response , because when i want to download more than one file I have to save each file with a pop up dialog. I am using a LOOP (selcted documents in a alv list) in which the method is located. How can I give the method more than one xstring or do I have to put all the xstrings of the documents (selected in the list) in one xstring ?

Regards,

Daniel

former_member184578
Active Contributor
0 Kudos

Hi,

To download multiple files at the same time, you have to use AcfUpDownload. I don't this it is possible with cl_wd_runtme_services=>attach_file_to_response.

Alternately, instead of downloading the selected files in ALV, you can create a extra column with button/ FileDownload UI and in onAction of button you can download the corresponding file.

Regards,

Kiran

Answers (0)