‎2020 Feb 19 12:33 PM
Hi All,
I am calling the standard progrom as below:
SUBMIT crm_socm_service_report TO SAP-SPOOL
SPOOL PARAMETERS priparms
WITHOUT SPOOL DYNPRO
VIA JOB lv_jobname NUMBER lv_jobcount
AND RETURN
WITH pmy = pmy
WITH poffice = poffice
WITH pcoll = pcoll
WITH pteam = pteam
WITH pstatop = pstatop
WITH pstatcl = pstatcl
WITH pstatal = pstatal
WITH sobject = sobject-low
WITH cancel = abap_true
WITH next = abap_false
WITH noupd = abap_false
WITH SELECTION-TABLE lt_selection.
WAIT UP TO 5 SECONDS.
lv_spool = sy-spono.
Spool number is not getting generated. Butwhen I checked in SP01, spool number is generated. Am I missing anything please let me know if anyone faced the same issue. Alsi I tries the below link but did not work.
SUBMIT statement not generaitng spool
Thanks,
HT
‎2020 Feb 19 12:37 PM
Could you give us your real objective ? maybe there is another way to proceed
‎2020 Feb 19 12:58 PM
I have to read the data from the spool into internal table and display it in the output. This is what I am trying to do. But in debugging, spool no is 00000000.
‎2020 Feb 19 1:14 PM
Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area. At the same time, the person will be informed of your comment (currently not).
‎2020 Feb 19 1:04 PM
SUBMIT (p_prog) VIA SELECTION-SCREEN AND RETURN EXPORTING LIST TO MEMORY.
CALL FUNCTION ‘LIST_FROM_MEMORY’
TABLES
listobject = it_listobj
EXCEPTIONS
not_found = 1
OTHERS = 2.you could export to memory directly
‎2020 Feb 20 8:25 AM
I have tried LIST TO MEMORY and when my SUBMIT report is crm_socm_service_report is executed, in the report output I am getting the below error and exiting from my report.
error:SET SCREEN not allowed in subscreen(screen: SAPLSBL_DISPLAY 0101). If I use TO SPOOL, I am not getting this error. Any idea why this error is coming.
‎2020 Feb 19 1:13 PM
To sum up your code, you launched a background job and you have a code to wait and get the ID of the spool request generated by the job:
CALL FUNCTION 'JOB_OPEN' ...
SUBMIT ... VIA JOB ... TO SAP-SPOOL ...
WAIT UP TO ...
spoolnumber = sy-spono.
CALL FUNCTION 'JOB_CLOSE' ...
" the rest of your algorithmSo, it's normal that SY-SPONO is not initialized by the spool generated in the submitted background job. System fields correspond to data in the current session, not in other sessions.
Moreover, WAIT UP TO ... makes no sense, how can you know the duration of a background job !
If you want to stick to the job solution, you'd better add a second step (custom program to create) to your job, that is started right after the first step, read the spool numbers in table TBTC_SPOOLID, and do the rest of your algorithm in that new program. Of course, it means that you need to split your main program. I don't know if it's worth the try.
‎2020 Feb 20 9:07 AM
The question title is incorrect. This one would be better: