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: 

import from memory ... export to memory ... batch problem

Former Member
0 Kudos

Hi All!

I've an abap with three-step-work.

In first step local files will be loaded into internal tables.

In the second step these table contents will be changed and enriched from sap tables.

In the third step these content will be saved local again.

'Cause the program runs a long time we can't use it any longer as a dialogue app and have to run it as a background task.

So i divided the program.

1. Load the local data and do a "export itab to memory id 'abc...'.

2. After this i start the program again as a background task.

Getting the data via "import itab from memory id 'abc...', do the work in sap and do a "export itab to memory id 'abc...'.

3. Now there's the last start for the program.

Getting the data via "import itab from memory id 'abc...' and save the data local.

When i'm doing the second step in dialogue then all works fine.

When i start the second step as background task after the import i've got sy-subrc=4... and i don't know why?

Perhaps here's anyone who can help?

Thanks a lot in advance.

Cheers, Ingo

1 ACCEPTED SOLUTION

chaouki_akir
Contributor
0 Kudos

Hello,

Instead of "export itab to memory id 'abc...'" try to use "export imara = imara to shared buffer indx(st) id l_key" as Rich Heilman explains [here|;:

"Ivo suggestion (EXPORT it_table TO MEMORY ID 'MY_MEM_ID'.) will not help as you are crossing work processes, you must use the shared buffer because it goes across all process, system wide."

I would say that background job starts a new process. So that memory exported in 1st step is not available.

Cordialement,

Chaouki

3 REPLIES 3

chaouki_akir
Contributor
0 Kudos

Hello,

Instead of "export itab to memory id 'abc...'" try to use "export imara = imara to shared buffer indx(st) id l_key" as Rich Heilman explains [here|;:

"Ivo suggestion (EXPORT it_table TO MEMORY ID 'MY_MEM_ID'.) will not help as you are crossing work processes, you must use the shared buffer because it goes across all process, system wide."

I would say that background job starts a new process. So that memory exported in 1st step is not available.

Cordialement,

Chaouki

0 Kudos

...

peter_peng
Advisor
Advisor
0 Kudos

Hi,

you can not use export/import in background task, the memory can't be read by import.

so if you have to use background task, I suggest you save data to temporary database table or file, then delete them finally.