‎2009 Nov 24 12:46 PM
Hello all,
I searched a lot about this error in SDN But i could not get a clear solution...
I am having a SAP Script and i have generated the spool request through OPEN_FORM and CLOSE_FORM
Converted that to PDF using CONVERT_OTF_2_PDF...
But when i try to trigger a mail...
Throwing error "OTF end command // missing in OTF dat"....
Kindly, let me know how should i generate or get the spool id so as to pass this spool id to CONVERT_OTF_2_PDF
to avoid this error...
Is CONVERT_ABAPSPOOLJOB_2_PDF FM a must to use instaed of CONVERT_OTF_2_PDF...
If that is the case how can i capture the spool id to pass that in CONVERT_ABAPSPOOLJOB_2_PDF....
Waiting for your replies....
‎2009 Nov 24 1:54 PM
Hi,
this is how you are going to capture the Spool number in Driver Program..
DATA : wa_result LIKE itcpp.
******* OPEN FORM ZTERMSANDCONDITIONS FOR CREATING SPOOL #
CALL FUNCTION 'OPEN_FORM'
EXPORTING
device = 'PRINTER'
dialog = ' '
form = 'ZTERMSANDCOND'
OPTIONS = wa_options
IMPORTING
RESULT = wa_result.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = wa_result
"The spool number generated is avaialable in wa_result-tdspoolid.
"now call the below function module to generate PDF from Spool.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = wa_result-tdspoolid "THis is Spool number field in the open form and Close form..
no_dialog = 'X'.
Regards,
Prabhuads
‎2009 Nov 24 1:54 PM
Hi,
this is how you are going to capture the Spool number in Driver Program..
DATA : wa_result LIKE itcpp.
******* OPEN FORM ZTERMSANDCONDITIONS FOR CREATING SPOOL #
CALL FUNCTION 'OPEN_FORM'
EXPORTING
device = 'PRINTER'
dialog = ' '
form = 'ZTERMSANDCOND'
OPTIONS = wa_options
IMPORTING
RESULT = wa_result.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = wa_result
"The spool number generated is avaialable in wa_result-tdspoolid.
"now call the below function module to generate PDF from Spool.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = wa_result-tdspoolid "THis is Spool number field in the open form and Close form..
no_dialog = 'X'.
Regards,
Prabhuads
‎2009 Nov 25 4:16 AM
Hello Prabhu,
Thanks for your guidance, i tried this code but i could not get the spool id from Open and Close Forms...
Could you please suggest me some more things...