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: 

ABAP background job SUBMIT with EXPORTING LIST TO MEMORY problem

icicek
Explorer
0 Kudos

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.

1 ACCEPTED SOLUTION

Private_Member_7726
Active Contributor

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

6 REPLIES 6

horst_keller
Product and Topic Expert
Product and Topic Expert

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

Sandra_Rossi
Active Contributor

I don't understand "one of the data fields im retrieving with submitting another standard program". Do you mean you have:

  • Your Z program: SUBMIT PROG1 EXPORTING LIST TO MEMORY, followed by call to FM LIST_FROM_MEMORY
  • PROG1: SUBMIT PROG2
  • PROG2: it prints a list

Do you start your Z program in background, or is it your Z program which runs PROG1 as a job in background?

icicek
Explorer
0 Kudos

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.

icicek
Explorer
0 Kudos

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.

Private_Member_7726
Active Contributor

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

icicek
Explorer
0 Kudos

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.