Application Development 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: 

Open Dataset to Presentation server batch mode

Former Member
0 Kudos

I'd like to download an internal table to the presentation server. i.e. "C:\TEMP\MYFILE.TXT' in batch mode. Unfortunately, GUI_DOWNLOAD prevents this.

All of my attempts to use OPEN DATASET don't create a file, either in foreground or background mode. I don't get an open file error but nothing gets created.

Is there a way to do this?

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You can not use OPEN DATASET to download or upload files to the presentation. You can only use this to upload/download to the application server. In doing this, it will work in both foreground and background. There is no "easy" way to download to the presentation server from a background process. I'm not saying that it can't be done, but you must jump thru a couple of hoops to do it.

Regards,

Rich Heilman

8 REPLIES 8

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You can not use OPEN DATASET to download or upload files to the presentation. You can only use this to upload/download to the application server. In doing this, it will work in both foreground and background. There is no "easy" way to download to the presentation server from a background process. I'm not saying that it can't be done, but you must jump thru a couple of hoops to do it.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi ,

OPEN DATA Sets -- For Uploading/Down loading fiels from Application server.

Please define a file path in your program and then use "OPEN DATASET L_FILE FOR OUTPUT ".

Then the O/P data will write to that file on application server.

Example:

*---opens application server file

OPEN DATASET L_FILE FOR OUTPUT IN BINARY MODE.

"encoding default.

IF SY-SUBRC = 0.

LOOP AT I_TAB1.

TRANSFER I_TAB1 TO L_FILE.

ENDLOOP.

*--- closes error file

CLOSE DATASET L_FILE.

ELSE.

  • message i000 with 'Unable to download PDF file'.

ENDIF.

Regards,

Lanka

Rich : you are too fast and I am fully agree with Rich.

Message was edited by: Lanka Murthy

0 Kudos

Thanks, folks. I sort of figured that it would be difficult because how would the batch job know who/where the job was started.

I'll contact my basis folks and have them create an output directory for the user.

0 Kudos

Exactly, once you are in the background, the process knows nothing about the frontend client.

Regards,

Rich Heilman

0 Kudos

What we do is run a batch job that creates a file on the application server. Then the user runs a program from R3 that uploads the file from the server and uses something like GUI_DOWNLOAD to write to the PC. You could as well open EXCEL directly in the second job.

Rob

0 Kudos

Thanks, Rob.

This is the scenario I decided to go with.

The users whine a bit, but cest la vie

Former Member
0 Kudos

Hello,

I'm got encountered with the same problem. We have generated file on application server successfully but download to presentation server is not working as i have used gui_download.We have set batchjob but because we used download function module job is getting cancelled as this is foreground activity.

We removed gui_download code and i tried to download file using open dataset and transfer method but it is not writing file on ps.

Please suggest other way to achieve the requirement.

0 Kudos

Hi,

Ask the admins to create "mount"/"share" of AS folder that users can access from their clients..?

cheers,

Janis