cancel
Showing results for 
Search instead for 
Did you mean: 

Scripts - PDF download

Former Member
0 Kudos

Hi All ,

Can we download the pdf file from the sap sripts.

Thanks

Ravi

Accepted Solutions (0)

Answers (4)

Answers (4)

mnicolai_77
Active Participant
0 Kudos

hi,

to download a SAP-SCRIPT in pdf format

1 - you need to have the otf data from the smartforms.

for having back this table you have to pass the value 'X' to tdgetotf of itcpo structure

>itcpo-tdgetotf = 'X'.

>CALL FUNCTION 'OPEN_FORM'

> EXPORTING

> ...

> options = itcpo

> ...

>EXCEPTIONS

>OTHERS = 12.

the function CLOSE_FORM now gives back in otf_data tables parameter a table that contain in OTF format the sapscript

>DATA: otf_data TYPE itcoo OCCURS 100 WITH HEADER LINE.

>CALL FUNCTION 'CLOSE_FORM'

> TABLES

> otfdata = otf_data

> EXCEPTIONS

> unopened = 1

> bad_pageformat_for_print = 2

> send_error = 3

> spool_error = 4

> codepage = 5

> OTHERS = 6.

now you can call the function CONVERT_OTF_2_PDF for converting the data and then download it with GUI_DOWNLOAD

>DATA: lt_pdf LIKE tline OCCURS 0 WITH HEADER LINE,

> l_len TYPE i,

> lt_docs TYPE docs OCCURS 0 WITH HEADER LINE.

>

>CALL FUNCTION 'CONVERT_OTF_2_PDF'

> EXPORTING

> use_otf_mc_cmd = 'X'

> IMPORTING

> bin_filesize = l_len

> TABLES

> otf = otf_data

> doctab_archive = lt_docs

> lines = lt_pdf.

>

>

>CALL FUNCTION 'GUI_DOWNLOAD'

> EXPORTING

> bin_filesize = l_len

> filename = 'c:\my_pdf.pdf'

> filetype = 'BIN'

> TABLES

> data_tab = lt_pdf

> EXCEPTIONS

> OTHERS = 99.

bye

Former Member
0 Kudos

hi

Look this program RSTXPDFT4

Regards

Gregory

Former Member
0 Kudos

Use the Program RSTXPDFT4

Any Report in the SAP Scripts Spool can be converted to PDF using the Program RSTXPDFT4

Regards.

Former Member
0 Kudos

Hi,

By using the program RSTXPDFT4 we convert the script into pdf format.

satish.