cancel
Showing results for 
Search instead for 
Did you mean: 

Some Funtion that download a Sapscript to PC in .PDF

Former Member
0 Kudos

Hi All;

I have a Transaction 'Z' that prints a Form Sapscritp. The user needs to download this form to a PC en .PDF format.

Could you tell me if there is a funtion or something do that ?

I know the standard program RSTXPDFT4. Even I created a transaction for this program. But the user need something

more direct .

Thanks

Kind regards

Marisol

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

[Converting SAP Script outputs to PDF file|https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/49e15474-0e01-0010-9cba-e62df8244556&overridelayout=true]

Regards,

Sravanthi

Former Member
0 Kudos

Hi Sravanthi;

Thank u very much. This really solved my problem.

Kind Regards

Marisol de Ochoa

MTY, MEXICO

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

See to this link.

Regards,

Revathi Bhoopal.

Former Member
0 Kudos

Hi ,

You can use program RSTXSCRP

Or

you can use the T.code SE71 goto Utilities

in Utilities u find list---->in that u find down load to pc

then it wil down load.

Hope this will clear your doubt.

Or else you can refer to the follwoing links:

http://www.sap-basis-abap.com/sapac013.htm

http://www.sap-img.com/ts004.htm

Regards,

Dhanalakshmi L

Edited by: Dhanalakshmi Lakshumanan on Aug 7, 2009 12:25 PM

Former Member
0 Kudos

Hi,

Check out with this link,

or, also this link might be helpful for u.

Hope, it will help you.

with regards,

Mamta Kumari

Former Member
0 Kudos

Hi,

To download the Form in PDF format, first you need to get the FORM output data in PDF format, but what we get from FORM output is OTF data.

data : lt_itcpp TYPE itcpp.

lt_itcpp-TDGETOTF = 'X'.

CALL FUNCTION 'CLOSE_FORM'

IMPORTING

result = itcpp " Information can be useful

TABLES

otfdata = lt_otfdata

EXCEPTIONS " eg dest, spool nr etc

unopened = 1.

from the above, U ill get the OTF data in lt_otfdata table.

CONSTANTS c_bin TYPE CHAR10 VALUE 'BIN'."unicode

CONSTANTS c_pdf TYPE char10 VALUE 'PDF'."unicode

DATA pdfdata_tab LIKE tline OCCURS 200.

DATA bindata_tab LIKE solisti1 OCCURS 200.

DATA filename_as_string TYPE string.

DATA filesize TYPE i.

DATA lv_lines TYPE i.

DESCRIBE TABLE lt_otfdata LINES lv_lines.

IF lv_lines <= 0.

pv_subrc = 4.

EXIT.

ENDIF.

IF destfile IS INITIAL.

pv_subrc = 4.

EXIT.

ENDIF.

FM converts the OTF data to PDF format

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = c_pdf

IMPORTING

bin_filesize = filesize

TABLES

otf = lt_otfdata

lines = pdfdata_tab

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

OTHERS = 4.

IF sy-subrc <> 0.

*-- Fehler beim Aufbereiten der PDF-Datei.

pv_subrc = 4.

exit.

ENDIF.

CALL FUNCTION 'QCE1_CONVERT'

TABLES

t_source_tab = pdfdata_tab

t_target_tab = bindata_tab

EXCEPTIONS

convert_not_possible = 1

OTHERS = 2.

IF sy-subrc <> 0.

*-- Fehler beim Aufbereiten der PDF-Datei.

pv_subrc = 4.

EXIT.

ENDIF.

Method to download the output in PDF

CALL METHOD cl_gui_frontend_services=>gui_download

EXPORTING

BIN_FILESIZE = filesize

filename = destfile

FILETYPE = c_bin

IMPORTING

FILELENGTH = filesize

changing

data_tab = bindata_tab.

Hope it helps!!

Rgds,

Pavan

Former Member
0 Kudos

Go to Transaction SP01.....Check the spool number and press the button "Print with Changed Parameters"........

There will be option to enter the Frontend Printer........select "Amyuni PDF Converter" from Dropdown.....

Now Press Print button....it will get a popup asking for Presentation server path...........

Give the path name and it will be stored as PDF format.....

Sandra_Rossi
Active Contributor
0 Kudos

Just read the program to get hints, and then search the forum for more details