11-25-2009 4:46 AM
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....
I tried the below...But still i could not get the spool id........
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'.
Waiting for your replies....
11-25-2009 4:51 AM
Generally Spool id is returned in CLOSE_FORM
DATA WA_RESULT TYPE ITCPP .
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = WA_RESULT .
WRITE WA_RESULT-TDSPOOLID .
Then pass the spool no to convert_otf fm
a®
11-25-2009 4:51 AM
Generally Spool id is returned in CLOSE_FORM
DATA WA_RESULT TYPE ITCPP .
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT = WA_RESULT .
WRITE WA_RESULT-TDSPOOLID .
Then pass the spool no to convert_otf fm
a®
11-25-2009 4:55 AM
Hi,
I tried the option what you have suggested me...But the spool id is always coming here as 0...
Could you please suggest me some more........
11-25-2009 6:29 AM
Hello all,
Thanks a lot for helping me...
Solved that problem myself....
Should use start and end forms between open and close forms and then use the function module
CONVERT_OTF_2_PDF and then trigger this pdf as mail....
SDN Rocks!!!!!!!!!!!!!!!