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 FROM MEMORY in job submitted program

former_member770378
Active Participant
0 Likes
1,012

Hi experts,

In a method I do:

SUBMIT zemr0044 USER sy-uname

VIA JOB lc_jobname

NUMBER lv_jobcount

AND RETURN.

Before this submit I have done:

IMPORT ls_header = ls_header FROM DATABASE.

IMPORT iv_distr = iv_distr from DATA BUFFER.

IMPORT lt_items = lt_items FROM DATA BUFFER.

In program ZEMR0044 I do:

IMPORT ls_header = ls_header FROM MEMORY ID 'ls_header'.

IMPORT iv_distr = iv_distr from MEMORY ID 'iv_distr'.

IMPORT lt_items = lt_items FROM MEMORY ID 'lt_items'.

---> Unfortunatly it doesn't work.

If I do SUBMIT zemr0044 AND RETURN it works fine.

It seems that the data import doesn't works in background.

How can I transfer data from my method to my program ?

Program must be launched in background.

Thanks guys.

1 ACCEPTED SOLUTION
Read only

ThomasZloch
Active Contributor
0 Likes
677

> Before this submit I have done:

>

> IMPORT ls_header = ls_header FROM DATABASE.

> IMPORT iv_distr = iv_distr from DATA BUFFER.

> IMPORT lt_items = lt_items FROM DATA BUFFER.

>

> In program ZEMR0044 I do:

>

> IMPORT ls_header = ls_header FROM MEMORY ID 'ls_header'.

> IMPORT iv_distr = iv_distr from MEMORY ID 'iv_distr'.

> IMPORT lt_items = lt_items FROM MEMORY ID 'lt_items'.

Doesn't fit together...are you EXPORTING to MEMORY ID before the submit? This will store data in "ABAP memory" in the context of a user session. I strongly believe by submitting in background this context is lost.

Check out all the other options of the IMPORT and EXPORT statements for alternatives like shared memory.

Thomas

Hi experts,

In a method I do:

SUBMIT zemr0044 USER sy-uname

VIA JOB lc_jobname

NUMBER lv_jobcount

AND RETURN.

Before this submit I have done:

IMPORT ls_header = ls_header FROM DATABASE.

IMPORT iv_distr = iv_distr from DATA BUFFER.

IMPORT lt_items = lt_items FROM DATA BUFFER.

In program ZEMR0044 I do:

IMPORT ls_header = ls_header FROM MEMORY ID 'ls_header'.

IMPORT iv_distr = iv_distr from MEMORY ID 'iv_distr'.

IMPORT lt_items = lt_items FROM MEMORY ID 'lt_items'.

---> Unfortunatly it doesn't work.

If I do SUBMIT zemr0044 AND RETURN it works fine.

It seems that the data import doesn't works in background.

How can I transfer data from my method to my program ?

Program must be launched in background.

Thanks guys.

2 REPLIES 2
Read only

Former Member
0 Likes
677

Hi

"Ugly" solution for this specific problem is to create table in database and use it for values you need, but usually you can avoid it.

Best Regards

Yossi

Read only

ThomasZloch
Active Contributor
0 Likes
678

> Before this submit I have done:

>

> IMPORT ls_header = ls_header FROM DATABASE.

> IMPORT iv_distr = iv_distr from DATA BUFFER.

> IMPORT lt_items = lt_items FROM DATA BUFFER.

>

> In program ZEMR0044 I do:

>

> IMPORT ls_header = ls_header FROM MEMORY ID 'ls_header'.

> IMPORT iv_distr = iv_distr from MEMORY ID 'iv_distr'.

> IMPORT lt_items = lt_items FROM MEMORY ID 'lt_items'.

Doesn't fit together...are you EXPORTING to MEMORY ID before the submit? This will store data in "ABAP memory" in the context of a user session. I strongly believe by submitting in background this context is lost.

Check out all the other options of the IMPORT and EXPORT statements for alternatives like shared memory.

Thomas