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

SAPSCRIPT to save as external file

Former Member
0 Likes
473

is it possible that i can save my output in SAPSCRIPT in an external file like MS Word?

thanks

is it possible that i can save my output in SAPSCRIPT in an external file like MS Word?

thanks

2 REPLIES 2
Read only

Former Member
0 Likes
448

You can convert to PDF formats using

SX_OBJECT_CONVERT_OTF_PDF

Conversion From OTF to PDF (SAPScript conversion)

Also see <a href="http://searchsap.techtarget.com/tip/1,289483,sid21_gci933581,00.html">Get SAPScript output as PDF</a>

Ps: Reward points if helpful.

Read only

Former Member
0 Likes
448

Hi!

First get SAPScript output as OTF:

options-tdgetotf = 'X'.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

options = options

...

CALL FUNCTION 'CLOSE_FORM'

  • IMPORTING

  • RESULT =

  • RDI_RESULT =

TABLES

otfdata = it_otf

EXCEPTIONS

unopened = 1

bad_pageformat_for_print = 2

send_error = 3

spool_error = 4

OTHERS = 5.

Then convert it to PDF:

DATA:

it_pdf LIKE tline OCCURS 100 WITH HEADER LINE,

v_len_in LIKE sood-objlen.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

  • ARCHIVE_INDEX = ' '

IMPORTING

bin_filesize = v_len_in

TABLES

otf = it_otf

lines = it_pdf

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

OTHERS = 4

.

Then download it_pdf as binary using DATASET or WS_DOWNLOAD.

Hope it helps.

Regards,

Maxim.