cancel
Showing results for 
Search instead for 
Did you mean: 

print smartform otf

Former Member
0 Kudos

Hi All,

i am converting smartform output in to otf in order to send it as email or fax or printout as per customer requirement. now my problem is i can convert otf to pdf and fax.

in script we can use .

PERFORM OTF_PRINT(SAPLSTXC) TABLES OTF

USING w_result.

But in smartform i want to know how to convert the otf to printout.

urgent requirement. Pls reply.

Thanks,

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING

bin_filesize = v_bin_filesize

TABLES

otf = st_job_output_info-otfdata

doctab_archive = it_docs

lines = it_lines

EXCEPTIONS

err_conv_not_possible = 1

err_otf_mc_noendmarker = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

former_member15255
Active Participant
0 Kudos

Hi,

Function for generating PDF output

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = pdf_file_size

TABLES

otf = gs_output_info-otfdata

lines = t_pdf_data

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

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

concatenate file ls_bil_invoice-HD_KOMK-BIL_NUMBER c_extn into filename.

regards

suresh krishnan

Former Member
0 Kudos

Hi ,

thanks for your response.

i am using for email - 'CONVERT_OTF_2_PDF'

for fax - 'CONVERT_OTF_AND_FAX'

for printout - ?????

but my question is how to take print out from that otf. is there any function module to convrt otf to spool.

thanks,

Former Member
0 Kudos

Hi Madhu,

Try this:

1. FM SSFDISPLAY_OTF to get the OTF format of your smartform spool

2. Code:

PERFORM OTF_PRINT(SAPLSTXC) TABLES OTF

USING ITCPP.

Then from spool you can give printout directly.

Hope this resolves your query.

<b>Reward all the helpful answers.</b>

Regards

Former Member
0 Kudos

Hi Nagaraj,

PERFORM OTF_PRINT(SAPLSTXC) TABLES OTF

USING ITCPP.

this itcpp values from which FM can i get.

please give some reference codings.

Thanks

Former Member
0 Kudos

Hi Madhu,

When you call the smart form FM, you can get the OTF data in a tables parameter.

You can convert the OTF data into PDF data using the function module.

Hope this resolves your query.

<b>Reward all the helpful answers.</b>

Regards

Former Member
0 Kudos

hello

Refer to this link

https://wiki.sdn.sap.com/wiki/x/jkM. here i have written complte code to convert the SMArtform to PDF.

Please Close this thread.. when u r problem is solved. Reward all Helpful answers

Regards

Naresh Reddy K