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: 

SMART FORMS TO PDF

Former Member
0 Kudos

Hi all,

Can anybody tell me waht is the function module for coverting Samrtforms to PDF ?

Is it HRHAP_DOC_CONVERT_SMF_TO_PDF.

If it is correct Can you tell me what all the types of parameters to be passed for this?

Thanx

Kelly.

1 ACCEPTED SOLUTION

ssimsekler
Active Contributor
0 Kudos

Hi Kelly

Try "<b>CONVERT_OTF_2_PDF</b>" or "<b>SX_OBJECT_CONVERT_OTF_PDF</b>" .

Kind Regards

*--Serdar

ssimsekler@yahoo.com

13 REPLIES 13

ssimsekler
Active Contributor
0 Kudos

Hi Kelly

Try "<b>CONVERT_OTF_2_PDF</b>" or "<b>SX_OBJECT_CONVERT_OTF_PDF</b>" .

Kind Regards

*--Serdar

ssimsekler@yahoo.com

0 Kudos

Hi,

Can please tell me what are the parameters we are passing to the FM CONVERT_OTF_2_PDF?

Because I am getting a dump error...

Thank you,

Kelly

0 Kudos

Hi Kelly

I do not know whether you still seek for an answer but here is a sample whºch I didn't try on a system but may give an idea:

CALL FUNCTION sf_func_name "smartform calling function"
  EXPORTING
    output_options = ...
    control_parameters = ...
  IMPORTING
    job_output_info = <i><job_output_info></i> .

CALL FUNCTION 'CONVERT_OTF_2_PDF'
  EXPORTING
    use_otf_mc_cmd = 'X'
  IMPORTING
    bin_filesize = <i><pdf_file_size></i>
  TABLES
    otf = <i><job_output_info></i>-otfdata
    lines = <i><pdf_tab></i> .

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    bin_filesize = <i><pdf_file_size></i>
    filename = <i><pdf_file_name></i>
    filetype = 'BIN'
    mode = space
  IMPORTING
    filelength = <i><pdf_file_size></i>
  TABLES
    data_tab = <i><pdf_tab></i>
  EXCEPTIONS
...

Hope this much helps

Regards

*--Serdar

ssimsekler@yahoo.com

Lakshmant1
Active Contributor
0 Kudos

Hi Kelly,

Have a look at demo program RSTXPDFT4.

Thanks

Lakshman

Former Member
0 Kudos

Hi all,

I´m using the function "

CONVERT_OTFSPOOLJOB_2_PDF

", this function convert a spool order to PDF file, with this function Can I separate in several PDF file only one spool order?.

For example if in one spool order I have 5 pages, I need separate the pages, in one pdf file the page 1 to 2 and in another one the pages 3 to 5, it is this possible.

Thank.

Jhon

0 Kudos

Hi Jhon,

Can I suggest you start a new thread for this?

Brad

Former Member
0 Kudos

Hi Kelly,

Hi!

All you have to do is call your SF to get OTF and then concert it to PDF. Works like charm:

s_control_parameters-no_dialog = 'X'.

s_control_parameters-getotf = 'X'.

CALL FUNCTION v_func_name "call your smartform

EXPORTING

output_options = s_output_options

control_parameters = s_control_parameters

IMPORTING

job_output_info = s_job_output_info

call function 'CONVERT_OTF_2_PDF'

tables

otf = s_job_output_info-otfdata

lines = t_pdf

Hope this helps!

Regards,

Ankur

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Check this link for the code sample.

In that code sample, I am converting the output of smartform into PDF and then mailing the output.

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

Hope this link is useful.

In case of any doubt,get back to me.

Regards,

J.Jayanthi

0 Kudos

Jayanthi

Could you perhaps tell me what size are the PDF documents produced by this program?

Regards

Faaiez

0 Kudos

Hi,

It is 1 MB .

Former Member
0 Kudos

Hi everyone SDNer!!!

I'm gettting trouble with converting Smartform to PDF and displaying Unicode in PDF output.

Instead of letters it displays '#'. Can you tell me why?

BR,Reno_D

P.S. Thank you for reply. I can't guess the right thing.

0 Kudos

Hello !

I'm in the same situation than Reno D.

We try to convert a smartform to PDF in slovakian language and we have 2 kinds of problem :

- certain special caracters are displayed as #

- other special caracters are displayed correctly but the next caracter is displayed at the same place (written over the special one)

Could someone help us ?

Thanks in advance

Message was edited by: Jean-Charles CARRET

0 Kudos

After investigation we have found a solution.

2 actions are required :

- You must create a device with good unicode in SPAD transaction. (For SK it is an ISO latin 2 device.)

Affect this device to concerned users.

Before calling smartform, put the user default print in the device parameters

- Use a policy containing good caracters.

ex COURRIER policy doesn't contain all special SK caracters whereas TIMES or HELVETIC do.

Good luck