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

OTF TO PDF IN SCREEN PROGRAMMING

Former Member
0 Likes
796

in module pool it is showing that, "OTF end command // missing in OTF "

when iam running my program

IF OK_CODE = 'BACK' .

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

IMPORTING

BIN_FILESIZE = w_line

  • BIN_FILE =

TABLES

otf = IT_ITCOO

lines = IT_TLINE

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.

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

BIN_FILESIZE = W_LINE

  • CODEPAGE = ' '

FILENAME = 'd:\test.PDF'

FILETYPE = 'BIN'

  • MODE = ' '

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • COL_SELECT = ' '

  • COL_SELECTMASK = ' '

  • NO_AUTH_CHECK = ' '

IMPORTING

FILELENGTH = W_LINE1

TABLES

data_tab = IT_ITCOO

  • FIELDNAMES =

EXCEPTIONS

FILE_OPEN_ERROR = 1

FILE_WRITE_ERROR = 2

INVALID_FILESIZE = 3

INVALID_TYPE = 4

NO_BATCH = 5

UNKNOWN_ERROR = 6

INVALID_TABLE_WIDTH = 7

GUI_REFUSE_FILETRANSFER = 8

CUSTOMER_ERROR = 9

NO_AUTHORITY = 10

OTHERS = 11

.

IF sy-subrc <> 0.

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

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

ENDIF.

ENDIF .

in module pool it is showing that, "OTF end command // missing in OTF "

when iam running my program

IF OK_CODE = 'BACK' .

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

IMPORTING

BIN_FILESIZE = w_line

  • BIN_FILE =

TABLES

otf = IT_ITCOO

lines = IT_TLINE

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.

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

BIN_FILESIZE = W_LINE

  • CODEPAGE = ' '

FILENAME = 'd:\test.PDF'

FILETYPE = 'BIN'

  • MODE = ' '

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • COL_SELECT = ' '

  • COL_SELECTMASK = ' '

  • NO_AUTH_CHECK = ' '

IMPORTING

FILELENGTH = W_LINE1

TABLES

data_tab = IT_ITCOO

  • FIELDNAMES =

EXCEPTIONS

FILE_OPEN_ERROR = 1

FILE_WRITE_ERROR = 2

INVALID_FILESIZE = 3

INVALID_TYPE = 4

NO_BATCH = 5

UNKNOWN_ERROR = 6

INVALID_TABLE_WIDTH = 7

GUI_REFUSE_FILETRANSFER = 8

CUSTOMER_ERROR = 9

NO_AUTHORITY = 10

OTHERS = 11

.

IF sy-subrc <> 0.

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

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

ENDIF.

ENDIF .

4 REPLIES 4
Read only

Laxmana_Appana_
Active Contributor
0 Likes
745

Hi,

Check this program for reference :RSTXPDFT and check the contents of the IT_ITCOO table , the contents will start like below format in IT_ITCOO .

TDPRINTCOM TDPRINTPAR

// XXXXXXXXX - first line

// XXXXXXXXX - last line.

Laxman

Read only

0 Likes
745

Hii Laxman,

Could you pls tell me how to use the standard program RSTXPDFT? I mean, the input values to be filled up in the selection-screen. I have a program HINCEDT0 which generates a payslip. I want this payslip to be converted into PDF format. How can these two programs be merged to get a PDF form of payslip?

Read only

Faaiez
Product and Topic Expert
Product and Topic Expert
0 Likes
745

Abdul Azeez

Have a look at the following post, you can read the ABAP spool to convert your output to PDF.

/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp

Regards

Read only

Former Member
0 Likes
745

Hi Anil,

The internal table should be populated with otf data before coverting it to PDF.

we can get that by checking this field.

ls_control_param-getotf = 'X'. and passing it to the function module.

After that we need to pass it_output_info-otfdata this deep structure to the 'CONVERT_OTF' function module.

Thanks,

Vamsi.