‎2013 Apr 15 8:30 AM
Dear All,
I am using Submit statement to get stock value from MC.9 report and using LIST_FROM_MEMORY i am getting the values. Everything is working fine in foreground, but when i run my report in background, am not getting any values from submit statement. Below is my coding:
SUBMIT ZRMCB0300
WITH SL_WERKS IN R_CHE
WITH SL_SPMON IN R_SPMON
* with sl_matnr in r_matnr
WITH SL_MTART IN R_MTART
AND RETURN EXPORTING LIST TO MEMORY .
check sy-subrc eq 0.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = ABAPLIST
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
call function 'LIST_TO_ASCI'
tables
listobject = ABAPLIST
listasci = INT_S000
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
Am not getting any values in ABAPLIST if i run my program in background.
Please suggest what will be the problem.
Regards,
Rithika.
‎2013 Apr 15 8:39 AM
Hi,
Did you try to run your program ZRMCB0300 directly in background to check that you have results with your selection?
Best regards,
Jonathan
‎2013 Apr 15 9:23 AM
Dear Jonathan,
Execute in Background option is missing in my ZRMCB0300, whereas if if run MC.9 directly i can see that. What should i do.
Regards,
Rithika.
‎2013 Apr 15 9:03 AM
Hi Rithika,
Put Submit between JOB_OPEN & JOB_CLOSE and use submit via job.
Hope this helps.
Thanks,
Tooshar Bendale
‎2013 Apr 15 9:48 AM
Hello Rithika,
Please follow tooshar suggestion he is rite.
Regards
Suresh Nair
‎2013 Apr 15 10:39 AM
Dear Tooshar,
I have used submit via job, but still am not able to see any values in ABAPLIST variable. Below is my coding:
CALL FUNCTION 'JOB_OPEN'
EXPORTING
* DELANFREP = ' '
* JOBGROUP = ' '
JOBNAME = GV_JOBNAME
* SDLSTRTDT = NO_DATE
* SDLSTRTTM = NO_TIME
* JOBCLASS =
IMPORTING
JOBCOUNT = GV_JOBCOUNT
* CHANGING
* RET =
* EXCEPTIONS
* CANT_CREATE_JOB = 1
* INVALID_JOB_DATA = 2
* JOBNAME_MISSING = 3
* OTHERS = 4
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
SUBMIT ZRMCB0300
WITH SL_WERKS IN R_WERKS
WITH SL_MTART IN R_MTART
WITH SL_SPMON IN R_SPMON
VIA JOB GV_JOBNAME
NUMBER GV_JOBCOUNT
AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = GV_JOBCOUNT
JOBNAME = GV_JOBNAME.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
check sy-subrc eq 0.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
LISTOBJECT = ABAPLIST
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.
call function 'LIST_TO_ASCI'
tables
listobject = ABAPLIST
listasci = INT_S000
exceptions
empty_list = 1
list_index_invalid = 2
others = 3.
Regards,
Rithika
‎2013 Apr 15 10:58 AM
Hi,
Remove the return statement from submit and debug to know what is happening in the called program.
‎2013 Apr 15 10:58 AM
Hi Rithika,
Use SUBMIT using RETURN EXPORTING LIST TO MEMORY.
Just by return it will not return the output in the list format.
Hope this helps.
Thanks,
Tooshar Bendale
‎2013 Apr 15 11:04 AM
Dear Tooshar,
If i use RETURN EXPORTING LIST TO MEMORY it will show error The addition "EXPORTING LIST TO MEMORY" cannot be used with the addition "VIA JOB". I have already tried it.
Regards,
Rithika.
‎2013 Apr 15 1:06 PM
Hi,
Have you checked the job using the transaction SM37 ? Check the job log and also if the job has an output it will be seen in spool.
Thanks,
Tooshar Bendale
‎2013 Apr 15 10:18 AM
I dont know if this will work or not. But try
SUBMIT ZRMCB0300
WITH SL_WERKS IN R_CHE
WITH SL_SPMON IN R_SPMON
* with sl_matnr in r_matnr
WITH SL_MTART IN R_MTART
EXPORTING LIST TO MEMORY
AND RETURN .
‎2013 Apr 15 11:05 AM
Dear Suruchi,
I have this statement already in the program which works fine in foreground but not in background.
Regards,
Rithika.
‎2013 Apr 15 11:24 AM
I mean use EXPORTING LIST TO MEMORY before Return.
You were using After return.
I hav used the same in my program also...It worked fine...
‎2013 Apr 15 12:13 PM
Dear Suruchi,
I have used below coding the same code as you said still am not getting value in background:
SUBMIT ZRMCB0300 "USING "SELECTION-SCREEN 1000
WITH SL_WERKS IN R_WERKS
WITH SL_SPMON IN R_SPMON
WITH SL_MTART IN R_MTART
EXPORTING LIST TO MEMORY AND RETURN .
Regards,
Rithika