‎2010 Sep 29 5:25 PM
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.
‎2010 Sep 29 6:22 PM
No - the PC is not available when the program is run in the background.
Rob
‎2010 Sep 30 7:19 AM
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?
‎2010 Sep 30 7:48 AM
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
‎2010 Sep 30 8:53 AM
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.
‎2010 Sep 30 9:01 AM
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
‎2010 Sep 30 9:05 AM
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.