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

Convert to PDF

Former Member
0 Likes
461

Hello,

I've used FM CONVERT_ABAPSPOOLJOB_2_PDF with the Spool number as a parameter. This returned a table, PDF STRUCTURE TLINE, which I am not able to save with .pdf extension in the debug mode.

I would like to be able to save it with .pdf without

running GUI_DOWNLOAD or SO_NEW_DOCUMENT_ATT_SEND_API1.

I know if I pass this file to either of the FM, they will

produce a .pdf file, but why can't I just save it as .pdf

before calling these FM's.

Thanks,

Alex.

Hello,

I've used FM CONVERT_ABAPSPOOLJOB_2_PDF with the Spool number as a parameter. This returned a table, PDF STRUCTURE TLINE, which I am not able to save with .pdf extension in the debug mode.

I would like to be able to save it with .pdf without

running GUI_DOWNLOAD or SO_NEW_DOCUMENT_ATT_SEND_API1.

I know if I pass this file to either of the FM, they will

produce a .pdf file, but why can't I just save it as .pdf

before calling these FM's.

Thanks,

Alex.

2 REPLIES 2
Read only

Former Member
0 Likes
427

Check this code it may help u.

DESCRIBE TABLE IT_OTF LINES GV_LINE.

SOOD-OBJLEN = GV_LINE.

CONTENT_IN[] = IT_OTF[].

CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'

EXPORTING

FORMAT_SRC = 'OTF'

FORMAT_DST = 'PDF'

DEVTYPE = 'HPLJ5SI'

LEN_IN = SOOD-OBJLEN

TABLES

CONTENT_IN = CONTENT_IN

CONTENT_OUT = CONTENT_OUT

EXCEPTIONS

ERR_CONV_FAILED = 1

OTHERS = 2.

Regards

Read only

0 Likes
427

Ravi,

Thanks for your reply.

Here is what I get in one table:

1 255044462D312E330D0A25E2E3CFD30D0A322030206F626A0D0A3C3C0D0A2F54797065202F<

2 79706520485034313030202020466F6E742048454C5645202020206E6F726D616C204C616E<

and here is what I get in another table:

1 //XHP4100 0700 0000000000 <

2 IN01EZCUSTACCTSTAT FIRST <

3 OPLETTER P 144 240 1581712189000010000100001 <

If I try to save it as .pdf at this point, I can not open them as pdf files once saved.

So, what do I need to do to save them as .pdf?