‎2009 Oct 27 8:26 PM
Hi Experts,
I am facing a problem in getting the spool no using the SUBMIT statemet.I am exporting an internal table with some data and then importing the same in another dummy program to get the ALV list output.This dummy program is called using the SUBMIT TO SAP-SPOOL statement.
The code is as follows:
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
The trouble is the submit statement is not calling the dummy program in this case.What can be the problem here and how can it be resolved.In my dummy program I am simply using the exported table to convert into list display so as to get a spool no. for it.
My objective is to get the spool no. for this sothat I can convert this spool to PDF.
Thanks and Regards
Abhishek
Edited by: abhishek singh on Oct 27, 2009 9:26 PM
Edited by: abhishek singh on Oct 27, 2009 9:27 PM
Edited by: abhishek singh on Oct 27, 2009 9:29 PM
Edited by: Rob Burbank on Oct 27, 2009 4:41 PM
‎2009 Oct 27 8:31 PM
hi,
I dont believe you donT know how to post code.
please try again.
clemens
‎2009 Oct 27 8:58 PM
Hi Experts ,
I am posting the code again:
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = lv_name
IMPORTING
jobcount = lv_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
archive_mode = gc_spool_print "For print = '1'
no_dialog = abap_true
IMPORTING
out_parameters = lv_print_parameters
valid = lv_valid_flag
EXPORT fui_fin_split TO MEMORY ID 'CUSTOMER'.
SUBMIT zvrr9333_dummy TO SAP-SPOOL
SPOOL PARAMETERS lv_print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB lv_name NUMBER lv_number
AND RETURN.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = lv_number
jobname = lv_name
strtimmed = abap_true "Immediate Start
MESSAGE 'Spool not created'(e15) TYPE gc_success.
ENDIF.
SELECT jobname
jobcount
stepcount
listident
FROM tbtcp
INTO TABLE gi_spool
WHERE jobname EQ fuv_name
AND jobcount EQ fuv_number.
IF sy-subrc EQ 0.
READ TABLE gi_spool INTO lw_spool INDEX 1.
fcv_spoolno = lw_spool-listident.
ENDIF.
SELECT jobname
jobcount
stepcount
listident
FROM tbtcp
INTO TABLE gi_spool
WHERE jobname EQ fuv_name
AND jobcount EQ fuv_number.
IF sy-subrc EQ 0.
READ TABLE gi_spool INTO lw_spool INDEX 1.
fcv_spoolno = lw_spool-listident.
ENDIF.
‎2009 Oct 27 9:44 PM
Any hints,
Do let me know if I need to elaborate the situation.
Regards
Abhishek
‎2009 Oct 28 7:30 AM
Hi abhishek,
just to make sure you are still able to learn something from here: Please mark your code with the mouse, hit the above <_> Code button and check the results in the preview tab.
Kind regards,
Clemens
‎2009 Oct 28 6:35 PM
Thanks Sir,
I actually was trying to do that even for the first time but was not aware of the 2500 character limit.So I could not understand why is the code not coming properly.Thanks again...its a new learning for me both ways.
I resolved my problem in this manner:
SUBMIT zvrr9333_dummy TO SAP-SPOOL
WITHOUT SPOOL DYNPRO
AND RETURN.
IMPORT lv_spool TO lv_spool FROM MEMORY ID 'SPOOL'.The value imported here gives me the spool no. generated in the submitted program zvrr9333_dummy.The corresponding export statement was written after the lis(or grid) ALV call in that program.Also mentioned below:
CALL METHOD go_table->display. "I am using factory method of ALV
lv_spool = sy-spono.
EXPORT lv_spool TO MEMORY ID 'SPOOL'.Initially i was doing steps not required in this case.