Application Development 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: 

convert sap script into otf format

Former Member
0 Kudos

hi,

can anyone tell me that how to convert sap script into otf format in background job scheduling ,currently by default it is taking list format.

thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,,

Check this report RSTXCPDF

Reward if useful!

4 REPLIES 4

Former Member
0 Kudos

Hi,,

Check this report RSTXCPDF

Reward if useful!

Former Member
0 Kudos

check options of OPEN_FORM

ITCPO-GETOTF = 'X'.

Regards

Peram

Former Member
0 Kudos

hi,

Visit this link for SAMple code of SAPSCRIPT to PDF.:

http://www.sapgenie.com/abap/pdf_creation.htm

and check the following weblog for code samples.

/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp

chk this one

http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

some function modules useful would be

CONVERT_OTF

SO_NEW_DOCUMENT_ATT_SEND_API1 to send mails with attachments

plzz refer to this link..it will solve ur problem

Regards

Former Member
0 Kudos

Hi,

Try this and reward if found helpfull. Please look at these function modules.

<b>Please reward if found helpfull</b>

Regards,

Rakesh.



DATA: wa_itcpp LIKE itcpp.
DATA: wa_itcpo LIKE itcpo.
DATA: doc LIKE TABLE OF docs.
DATA: tlines LIKE TABLE OF tline.
DATA: bin_filesize TYPE i.

DATA: it_otf LIKE TABLE OF itcoo.


wa_itcpo-tdgetotf = 'X'.
CALL FUNCTION 'OPEN_FORM'
 EXPORTING
*   APPLICATION                       = 'TX'
*   ARCHIVE_INDEX                     =
*   ARCHIVE_PARAMS                    =
   device                            = 'PRINTER'
   dialog                            = 'X'
   form                              = 'ZSCRIPT_BOX_PS'
   language                          = sy-langu
   OPTIONS                           = wa_itcpo
*   MAIL_SENDER                       =
*   MAIL_RECIPIENT                    =
*   MAIL_APPL_OBJECT                  =
*   RAW_DATA_INTERFACE                = '*'
*   SPONUMIV                          =
 IMPORTING
*   LANGUAGE                          =
*   NEW_ARCHIVE_PARAMS                =
   RESULT                            = wa_itcpp
 EXCEPTIONS
   canceled                          = 1
   device                            = 2
   form                              = 3
   OPTIONS                           = 4
   unclosed                          = 5
   mail_options                      = 6
   archive_error                     = 7
   invalid_fax_number                = 8
   more_params_needed_in_batch       = 9
   spool_error                       = 10
   codepage                          = 11
   OTHERS                            = 12
          .

CALL FUNCTION 'WRITE_FORM'
   EXPORTING
     element                        = 'ELE1'
     function                       = 'SET'
     type                           = 'BODY'
     window                         = 'MAIN'
* IMPORTING
*   PENDING_LINES                  =
   EXCEPTIONS
     element                        = 1
     function                       = 2
     type                           = 3
     unopened                       = 4
     unstarted                      = 5
     window                         = 6
     bad_pageformat_for_print       = 7
     spool_error                    = 8
     codepage                       = 9
     OTHERS                         = 10
            .


CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
*   RESULT                         =
*   RDI_RESULT                     =
 TABLES
   otfdata                        = it_otf
 EXCEPTIONS
   unopened                       = 1
   bad_pageformat_for_print       = 2
   send_error                     = 3
   spool_error                    = 4
   codepage                       = 5
   OTHERS                         = 6
          .


CALL FUNCTION 'CONVERT_OTF_2_PDF'
  IMPORTING
    bin_filesize   = bin_filesize
  TABLES
    otf            = it_otf
    doctab_archive = doc
    lines          = tlines.

BREAK-POINT.
CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    bin_filesize = bin_filesize
    filename     = 'D:New FolderTESTPDF.PDF'
    filetype     = 'BIN'
  TABLES
    data_tab     = tlines.