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

GUI_DOWNLOAD and background processing

Former Member
0 Likes
1,556

Hello,

I have created a process which creates a file. this process uses GUI_DOWNLOAD to put the file on the users C drive or other directory on our network. The user wants to run this process in background and the program is returning a 6 (error unknown) from the GUI_DOWNLOAD FM. I was looking on SDN and found out the GUI_DOWNLOAD only works in foreground. You have to use OPEN and CLOSE DATASET statements to process in background. I am thinking about putting a button to denote foreground/background processing and using the appropriate statements to process the file. I will then have to get the file from the app server to a place will the user can get access to it.

<b>first question</b> - is there a FM to do a FTP from the app server to a directory on our network for the user to access?

<b>second question</b> - is this the right approach or is there something else that I should be doing.

thanks in advance for your help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,245

Hi,

Yes, your right, GUI_DOWNLOAD wil not work in background mode, you need to place the file in Application server, here.

See the below link for a FTP program, use the proper commands(i do not know whether downloading the file is possible through the commands)

http://www.sap-img.com/ab003.htm

or else, write a small program which downloads the data from the application server, but it should run in the foreground

Regards

Sudheer

Hi,

Yes, your right, GUI_DOWNLOAD wil not work in background mode, you need to place the file in Application server, here.

See the below link for a FTP program, use the proper commands(i do not know whether downloading the file is possible through the commands)

http://www.sap-img.com/ab003.htm

or else, write a small program which downloads the data from the application server, but it should run in the foreground

Regards

Sudheer

5 REPLIES 5
Read only

Former Member
0 Likes
1,245

This sounds OK. When I've done this, it's a two step process. If the user puts the file onto the ap server, we have another program that runs in the foreground that reads the file and downloads it (no FTP).

Rob

Read only

Former Member
0 Likes
1,246

Hi,

Yes, your right, GUI_DOWNLOAD wil not work in background mode, you need to place the file in Application server, here.

See the below link for a FTP program, use the proper commands(i do not know whether downloading the file is possible through the commands)

http://www.sap-img.com/ab003.htm

or else, write a small program which downloads the data from the application server, but it should run in the foreground

Regards

Sudheer

Read only

Former Member
0 Likes
1,245

Rob,

so your saying the if the user wants to run in background, he submits the first pgm in background to create the file and submit a second pgm in foreground to read the newly created file and create the file on the user's C drive or where ever he wants it. is this correct? the user has to submits 2 programs?

Read only

0 Likes
1,245

Yes, but the user has to wait for the first one to finish (in the background) before submitting the second one (in the foreground).

Rob

Read only

Former Member
0 Likes
1,245

TH...

A tip to detect background processing...

No need for a parameter...

Check SY_BATCH for an 'X'

If sy-batch eq 'X'.

...program is running in background...

else.

...program is running in foreground...

Endif.

Dave...