Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Spool Id - OTF end command // missing in OTF dat

Former Member
0 Likes
769

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....

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
543

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

2 REPLIES 2
Read only

Former Member
0 Likes
544

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

Read only

0 Likes
543

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...