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

Import / export not working.

gouravkumar64
Active Contributor
0 Likes
4,495

Hi All,

I am facing one issue regarding import / export.

Existing code is :

export it_abcd from it_abcd_temp

to database index(ab) id job_name.

or

export it_abcd to memory id 'CRM08'.

Value coming upto this level to it_abcd.

But after

submit zefgh via job job_name number job_number with .... & return.

if sy-subrc = 0.

call function 'job_close'.

And

import it_abcd to it_abcd    "1st line of zefgh

from database indx(ab) id p_name.

or

import it_abcd from memory id 'CRM08'.

Value is not coming after importing to it_abcd.

Any Input on this?

Thanks.

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,754

ABAP memory(EX-/IMPORT to MEMORY-ID) won't help because the BG job is run in a different process.

DB-cluster(INDX-like tables) should definitely work. The key here is that the IDs should be same. In your example i see that you use the IDs JOB_NAME & P_NAME. Are they same?

PS - After the export check in INDX table if the record is created.

8 REPLIES 8
Read only

Former Member
0 Likes
2,754

Hi Kumar,

    

Check the status of your background job, you will get the value only if the scheduled job is in Active or finished status.

For that please check the scheduling parameters of your FM JOB_CLOSE.





Regards

Kishan Shah

Read only

0 Likes
2,754

Hi,

Background job is finished in SM37 & I debug using JDBG also,

there I am getting no value after import.

Thanks.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,755

ABAP memory(EX-/IMPORT to MEMORY-ID) won't help because the BG job is run in a different process.

DB-cluster(INDX-like tables) should definitely work. The key here is that the IDs should be same. In your example i see that you use the IDs JOB_NAME & P_NAME. Are they same?

PS - After the export check in INDX table if the record is created.

Read only

0 Likes
2,754

Hi Suhas,

Both P_NAME & JOB_Name is tbtcjob-jobname.

I checked in indx in se11 where relid = 'AB' no record there   for memory id or export to database index.

Thanks.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,754

So now you know why the EX-/IMPORT with dataclusters doesn't work. Now you need to troubleshoot your EXPORT code!

IMO the ABAP documentation is fairly clear about the DOs/DONTs regarding memory handling.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
2,754


Just to clarify:

When using SUBMIT VIA JOB, a three step process takes place:

  1. Directly after SUBMIT, the called program is loaded to an internal session and there all processing blocks before START-OF-SELECTION are executed. There, you have access to the ABAP Memory filled with EXPORT TO MEMORY in the calling program. But after selection screen processing the program flow returns to the calling program.

  2. The called program is scheduled for background processing, where the selection screen data (passed from caller or entered by user) are stored in an internal variant.

  3. The actual background processing of the called program takes place in an own background session. The complete program is executed, including the processing blocks before START-OF-SELECTION. The selection screen is darkly filled from the internal variant.  In that background session, you neither have access to the ABAP Memory filled by EXPORT TO MEMORY nor to the User Memory filled by SET PARAMETER of the calling program. If the background session happens to run on the same apllication server as  the calling program, you have access to the shared memory filled by EXPORT TO SHARED BUFFER|MEMORY.

Of course, access to the database is possible everywhere and EXPORT/IMPORT TO DATABASE must definitely work, if you do it right ...

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,754

Wow! Thanks for the insight. Read the online docu again & everything is clear now.

For other additions of SUBMIT i understand that the internal session is replaced by the called program. Does this mean the EX-/IMPORT TO MEMORY should work?

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
0 Likes
2,754

Admittetly, I adjusted the next release of the documentation for VIA JOB a little bit by dividing the paragraph into the three steps just now ...

Without AND RETURN the internal session is replaced. With AND RETURN a new internal session is created. In both cases, you stay in the current call chain and you have access to the same ABAP Memory (EXPORT|IMPORT TO|FROM MEMORY).