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: 

Getting otfdata from structure (SAPLSTXC)....

Former Member
0 Kudos

Hi Guys,

While working on SAPScript, the driver program RM08NAST control comes out of MRM_ERS_ENTRY function module ,I am using (SAPLSTXC)itcpp-tdspoolid to fetch spoolid(which I use for conversion to pdf)

But now I want otfdata because instead of using spoolid , I want to use OTFdata directly so that I can directly convert in pdf.

Do I get it from same structure (SAPLSTXC)itcpp or somewhere else ?

Inputs will be appreciated...

3 REPLIES 3

Former Member
0 Kudos

HI,

Check the below code......

Get the OTF from CLOSE_FORM (otf_data)

  • Convert OTF to PDF

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

IMPORTING

bin_filesize = pdf_size

TABLES

otf = otf_data

lines = it_pdf.

  • Make each line 255 characters

CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'

TABLES

content_in = it_pdf

content_out = it_pdfout.

  • Create the PDF File

CLEAR it_pdfdata.

REFRESH it_pdfdata.

LOOP AT it_pdfout.

MOVE it_pdfout-tline TO it_pdfdata-line.

APPEND it_pdfdata.

CLEAR it_pdfdata.

ENDLOOP.

Use GUI_DOWNLOAD to to downlaod it_pdfdata file.

<b>Refer this Thread:-</b>

Regards

Sudheer

0 Kudos

I know how to convert data in pdf. My question is completely different. I am asking how can I get otf data in stucture (SAPLSTXC)itcpp.....

sridhar_k1
Active Contributor
0 Kudos

Hello Rajesh,

Try this to get otf data...

Before MRM_ENTRY_ERS call add:

NAST-SORT1 = 'SWP'.

After the MRM fm call add the following fm to get otf data:

data:  lt_otf_data type  itcoo occurs 0.
call function 'READ_OTF_FROM_MEMORY'
 EXPORTING
   MEMORY_KEY         = NAST-OBJKY
  tables
    otf                = lt_otf_data.
 EXCEPTIONS
   MEMORY_EMPTY       = 1
   OTHERS             = 2

Regards

Sridahr