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

Submit & export problem

Former Member
0 Likes
463

Hi,

I am using a sumbit program B and return in Program A and which calls Program B where i am exporting 2 internal tables.

I am using the submit in a Loop in the Program A, for the first entry in the loop submit happens properly and returns, where else for the second time in the loop it does not returns with sy subrc as 4 and no internal tables are exported.

I am clearing the memory id also, still then it happens the same way.

pls give some idea to over come this.

Points assured.

Regards,

Prabhu

3 REPLIES 3
Read only

Former Member
0 Likes
433

Hi,

You can use EXPORT and IMPORT statement.

Please check this sample code.

Program A :
SELECT-OPTIONS: S_BELNR FOR BKPF-BELNR.

EXPORT S_BELNR TO MEMORY ID 'ZXC9'.

Program B :
DATA: BEGIN OF S_BELNR OCCURS 10.
INCLUDE STRUCTURE STRUC1.
DATA: LOW LIKE BKPF-BELNR,
HIGH LIKE BKPF-BELNR.
DATA: END OF S_BELNR.

IMPORT S_BELNR FROM MEMORY ID 'ZXC9'.

For EXPORT: http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/export01.htm

For IMPORT: http://www.geocities.com/siliconvalley/campus/6345/import01.htm

Hope this will help.

Thanks

VIkranth

Read only

0 Likes
433

Hi Vikranth,

I am using submit and return in a loop, for the first time it is ok for all the other itteration it does not happen.

Points assured

regards,

Prabhu

Read only

Former Member
0 Likes
433

hi use this ..

SUBMIT zmio_manu_dmd_fcst_unit_extr WITH SELECTION-TABLE it_seltab2 VIA JOB jobname NUMBER jobnum AND RETURN.

MOVE 'ZMIO_MANU_DMD_FCST_UNIT_LAUNCH' TO jobname. "Creating a new job for DMD_FILE

PERFORM open_job.------> call function module job_open

PERFORM create_batch_job.--->submit command

CONCATENATE '1 Job ' jobname ' scheduled' INTO g_name.

PERFORM close_job.------>call functin module job_close

g_current_job_count = g_current_job_count + 1.

g_end_job = 'Y'.

PERFORM check_for_spawned_jobs.

MOVE 'N' TO g_ws_canc_flag.

LOOP AT it_holdjob.

SELECT SINGLE status

INTO it_holdjob-status

FROM tbtco

WHERE jobname = it_holdjob-jobname

AND jobcount = it_holdjob-jobnum.

IF it_holdjob-status = 'A'. "aborted

MOVE 'Y' TO g_ws_canc_flag.

IF g_ws_canc_flag = 'Y'.

IF sy-batch = 'X'.

MESSAGE i043 WITH 'Not all jobs finished successfully'.

STOP.

ELSE.

WRITE: /1 'Not all jobs finished successfully'.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

this is in my existing program..with multiple jobs