11-04-2016 12:34 PM
Hi friends,
I could not find a solution for the problem so i wanted to ask about it.
I have a z program that works in the foreground (when executed manually) but not as a background job.
The problem is, one of the data fields im retrieving with submitting another standard program and with EXPORTING LIST TO MEMORY parameter, as below :
SUBMIT htrcedt0 WITH SELECTION-TABLE t_sel EXPORTING LIST TO MEMORY AND RETURN.
Normally, it can retrieve the list from memory with FM LIST_FROM_MEMORY when executed manually. BUT when the same program is set as a background job, FM LIST_FROM_MEMORY returns SY-SUBRC = 1.
I hit a wall with this one, any help will be much appreciated.
Thanks in advance.
11-07-2016 6:00 AM
Does htrcedt0 produce spool when "Z programm" is executed in background?
Because, if 'htrcedt0' is anything like HBRCEDT0, you seem to be out of luck with trying to import its list in background:
You could perhaps get the Spool somehow, but all these get my data via "other application's" list or spool output seem like suspect solutions...
cheers
Jānis
11-04-2016 1:47 PM
Hello,
I cannot reproduce this behavior.
If I submit one program with EXPORTING LIST TO MEMORY in another program that is started in background I can retrieve the list of the submitted program in the submitting program.
Horst
11-04-2016 4:59 PM
I don't understand "one of the data fields im retrieving with submitting another standard program". Do you mean you have:
Do you start your Z program in background, or is it your Z program which runs PROG1 as a job in background?
11-07-2016 4:21 AM
Well, the program sends an email including an alv-like table. Two of the columns get their data from submitting this other standard program.
When i execute the tcode manually, email is correctly filled with data. When it is set as a background job, email is still sent but those two columns are empty. When debugged, the FM LIST_FROM_MEMORY returns sy-subrc 1, thats why the columns are empty.
But still cant figure out why it returns subrc 1 when run in background and why it doesnt when run manually.
11-07-2016 4:21 AM
Well, the program sends an email including an alv-like table. Two of the columns get their data from submitting this other standard program.
When i execute the tcode manually, email is correctly filled with data. When it is set as a background job, email is still sent but those two columns are empty. When debugged, the FM LIST_FROM_MEMORY returns sy-subrc 1, thats why the columns are empty.
But still cant figure out why it returns subrc 1 when run in background and why it doesnt when run manually.
11-07-2016 6:00 AM
Does htrcedt0 produce spool when "Z programm" is executed in background?
Because, if 'htrcedt0' is anything like HBRCEDT0, you seem to be out of luck with trying to import its list in background:
You could perhaps get the Spool somehow, but all these get my data via "other application's" list or spool output seem like suspect solutions...
cheers
Jānis
11-07-2016 7:01 AM
Wow, that is so spot on. I found around ~4000 files waiting in the spool list. Although the spool output does not contain the required data.
Even if i captured the output sent to spool, it wont be of any use.
All this time i have been searching for the problem on the wrong place.
Thanks everyone, especially you Janis. I guess i have to get those data by something else.