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: 

About SAP function CONVERT_OTF

Former Member
0 Kudos

Dear Experts,

When I used function "CONVERT_OTF" to convent smartforms to PDF, Italic and bold and font size can not be shown correctly . font size is not same as po preview. i want to show same layout as po preview.

who can tell me how to do?

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

IMPORTING

BIN_FILESIZE = GV_BIN_FILESIZE

TABLES

OTF = GT_OTF

LINES = GT_PDF_TAB

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3

OTHERS = 4.

IF SY-SUBRC <> 0.

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

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

ENDIF.

Best Regards,

Merry

6 REPLIES 6

dhirendra_pandit
Active Participant
0 Kudos

Hi Marry,

This you can achieve by using some function module in sequence. just try to follow the steps :-

1. First you need to get the function module name by calling Function module SSF_FUNCTION_MODULE_NAME. and use this function module name to see the preview.Like Call function (module name).

2.Execute that function module and you'll got your preview to the output now. and get the spool id.

3. Take that spool id and pass it to function module 'CONVERT_ABAPSPOOLJOB_2_PDF' and save your file in pdf.

0 Kudos

3. Take that spool id and pass it to function module 'CONVERT_ABAPSPOOLJOB_2_PDF' and save your file in pdf.

Wrong function. That is for ALI-based spools not OTF-based spools. See RSTXPDFT4 for more details on how spool types are handled.

To the original poster, have you checked RSTXPDFT4 to verify that it's not an issue with your code? Have you checked for OSS notes?

0 Kudos

Hi,Can you tell me how can i get spool number? which function can be used?now i am using smartform to change pdf.

looking forward to your reply,thanks in advance.

0 Kudos

You don't need a spool number because you can use the OTF data returned by the form call directly (in the job_output_info-otfdata table). However, you can also get the spool numbers from the spoolids table in the same structure. Have you looked at the interface of your smartform function call?

Former Member
0 Kudos

hi,

check the thread:

Former Member
0 Kudos

thank you