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

Table values lost in background mode

Former Member
0 Likes
936

Hello everyone.

I need some help please.

I have a selection screen with a file upload box (AT SELECTION-SCREEN ON VALUE0R-REQUEST.... CALL FUNCTION 'F4_FILENAME'). When I execute the report in foreground, the file is converted and I can get the values for it, but when I execute in background, the file is lost, which is somehow logic. I tried to convert the file values in the same AT SELECTION-SCREEN that I used to get the file from my computer. Now when I directly hit F4 and select the file, the values from the file are procesed and saved in gt_datatab, while the selection screen is still open. Now again if I start the report with F8, the values from gt_datatab are available, but if I start in background mode, the values are lost.

What can I do? I tried all kind of events combinations...

Thank you.

6 REPLIES 6
Read only

Former Member
0 Likes
865

No - the PC is not available when the program is run in the background.

Rob

Read only

0 Likes
865

Yes, that's why I used the file processing function in the AT SELECTION-SCREEN ON VALUE-REQUEST, and the table is populated in this block of the program before I hit F9 to go in background mode, but after I go in background, also the values of the table are lost. Why?

Read only

Former Member
0 Likes
865

Hello,

Instead of uploading the file data into internal table in AT SELECTION-SCREEN events, try doing it in START-OF-SELECTION event.

Means to say, Run the program in background with just the filepath filled. And in START-OF-SELECTION event, upload the data from file.

Hope this helps,

Regards,

Himanshu

Read only

0 Likes
865

I cannot do that because the path is from my computer, and background mode is starting a job that is independent of the SAP GUI, so it cannot upload the file from the computer.

Read only

0 Likes
865

Hello,

What you can do is that create a variant for the Report in which the file location is specified already.

Now you can schedule the batch job with this variant.

Hope this helps.

Regards,

Himanshu

Read only

0 Likes
865

Again it doesnt work because it cannot memorize the file data and transfer it to the background mode.

I managed to to succed by using in the block "AT SELECTION-SCREEN ON VALUE-REQUEST" to EXPORT the internal table to SHARED MEMORY, then inside the code that is executed in the backgroud job, I will import from the SHARED MEMORY. It works only with SHARED MEMORY, because this is the only memory that is usable global by all the work processes.