‎2008 Jun 18 8:48 AM
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
‎2008 Jun 18 8:51 AM
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
‎2008 Jun 18 9:00 AM
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
‎2008 Jun 18 9:26 AM
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