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

CONVERT into PDF Files

Former Member
0 Likes
1,161

hi all,

i have the scenario to convert Purchase Order into PDF Format.

that PDF format should be stored in app server.

please help me to solve this problem.

Your help is greatly appreciated.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,092

PO as SMART Form and mail as PDF

How to convert smartform output to PDF and mailing them

https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-001...

8 REPLIES 8
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
1,092

Hi,

You can use RSTXPDFT4 to convert the report into pdf format..

Read only

Former Member
0 Likes
1,093

PO as SMART Form and mail as PDF

How to convert smartform output to PDF and mailing them

https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-001...

Read only

Former Member
0 Likes
1,092

HI ,

u can get idea on looking this code.

data: ctrlparams type ssfctrlop.

data: fm_name type rs38l_fnam,

fname type string value 'c:\reportpdf.pdf',

bin_size type i,

joboutput type ssfcrescl,

  • it_result like table of itcoo,"JOBOUTPUT-OTFDATA

otf like table of itcoo,

doc like table of docs,

tlines like table of tline.

data: begin of struct occurs 0.

include structure spfli.

data: end of struct.

data: itab like table of struct with header line.

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = 'ZSIVA_SMARTFORMS'

  • FORMNAME = 'SF_TOTALS'

importing

fm_name = fm_name

.

if sy-subrc <> 0.

endif.

ctrlparams-getotf = 'X'.

call function fm_name

exporting

control_parameters = ctrlparams

importing

job_output_info = joboutput

tables

itab = itab.

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5.

*

*IF SY-SUBRC <> 0.

*

*ENDIF.

call function 'CONVERT_OTF_2_PDF'

importing

bin_filesize = bin_size

tables

otf = joboutput-otfdata[] "otf
\

doctab_archive = doc

lines = tlines

.

call function 'GUI_DOWNLOAD'

exporting

bin_filesize = bin_size

filename = 'C:\siva\test.pdf'

filetype = 'BIN'

tables

data_tab = tlines.

  • * Open PDF

data: program like soxpc-path.

call function 'SO_PROGNAME_GET_WITH_PATH'

exporting

doctype = 'PDF'

importing

pathname = program

exceptions

path_not_found = 1

program_not_found = 2

no_batch = 3

x_error = 4

others = 5.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

*

call function 'WS_EXECUTE'

exporting

commandline = 'C:\siva\test.pdf'

program = program

exceptions

frontend_error = 1

no_batch = 2

prog_not_found = 3

illegal_option = 4

gui_refuse_execute = 5

others = 6.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

regards,

shan

Read only

Former Member
0 Likes
1,092

Dear anburaja,

SAP have created a standard program RSTXPDFT4 to convert your Sapscripts spools into a PDF format.

Specify the spool number and you will be able to download the sapscripts spool into your local harddisk.

It look exactly like what you see during a spool display.

Please note that it is not restricted to sapsciprts spool only. Any reports in the spool can be converted using the program 'RSTXPDFT4'.

Read only

0 Likes
1,092

how will i get the spool request number

Read only

0 Likes
1,092

1.when u call FM CLOSE_FORM , from there u can get the spoool number.

2.First go thru links given by RAVI , try out these steps then post.

3.

regards

Prabhu

Read only

Former Member
0 Likes
1,092

i have only PO numbers.where i can start?

Read only

Former Member
0 Likes
1,092

hi all,

some of the cases PO is not holding messages.

it means no messages for PO's.

that scenario dump occurs while i'm using ECP_PDF_DISPLAY fm...

how can i handle that situation?

creating message( using BDC for ME22N ) is not working in background.

it display errors like.

Unable to initialise ABAP Control Framework ...

Unable to initialise ABAP Control Framework ...

Control Framework: Fatal error - GUI cannot be reached

Runtime error RAISE_EXCEPTION has occurred

Message was not created