Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Trigger File Generation to a Server from Web Dynpro Application

alpaca
Product and Topic Expert
Product and Topic Expert
0 Likes
673

Hi Everybody! Hope you had a good new years eve

Is it possible to generate a File on a Server outgoing from Web Dynpro?

I tried to use GUI_DOWNLOAD. But as I couldn't use the GUI_DOWNLOAD from the Web Dynpro, I wrote a Report "ZCMI_EXPORT_FILE" that generates a Text-File. When I start the Report by myself, the file gets generated. All fine.

To be able to generate the File from Web Dynpro, I created a Batch Input Function Module, that I call in the Web Dynpro. The File is not created and it does not show any errors.

Do you have any idea how i can get this working? I'd also be happy with a different approach.

Best Regards and Thanks,

Steffen

REPORT that is called with Batch Input from Web Dynpro:

call function 'ZFM_GENERATE_EXPORT'
  exporting
    it_detail_record     = lt_records
    is_export            = gs_export
  importing
    ev_string            = gs_export-document
    et_dataset           = data_tab
  exceptions
    parameter_is_initial = 1
    others               = 2.
if sy-subrc <> 0.
endif.

concatenate '\\SERVER\EXPORT\' gs_export-filename into lv_filename.

call function 'GUI_DOWNLOAD'
  exporting
    filename                = lv_filename
  tables
    data_tab                = data_tab
  exceptions
    file_write_error        = 1
    no_batch                = 2
    gui_refuse_filetransfer = 3
    invalid_type            = 4
    others                  = 5.

if sy-subrc <> 0.
  exit.
endif.

3 REPLIES 3
Read only

Former Member
0 Likes
635

HI,

GUI_DOWNLOAD does not get's executed in the Backgroud.

there is no way to do it as a background job.. create the folder.. transfer the file to the application server in the backgorund using OPEN DATASET... use the tcode CG3Y to download the file from the app server to your folder..

Read only

Sm1tje
Active Contributor
0 Likes
635

Well GUI_DOWNLOAD and server, do not go well together. When trying do download to server try using

OPEN DATASET.

TRANSFER DATASET

CLOSE DATASET.

Read only

alpaca
Product and Topic Expert
Product and Topic Expert
0 Likes
635

Hi! Thanks for the quick answer!

Does the TRANSFER Statment work when it is called in the background? For example by a scheduled job or from Web Dynpro?

Best Regards,

Steffen