Skip to Content
0

ADS_CREATE_PDF_SPOOLJOB retunring NO PDF Error

Jan 16 at 02:02 PM

64

avatar image
Former Member

Hello All,

I have string and pass to ADS_CREATE_PDF_SPOOLJOB, But its returning error 'Not PDF'.

What I did is - I convert string into xstring as below

DATA :lv_buffer TYPE xstring,
lv_xstrpdf_ads TYPE xstring.
CLEAR : lv_buffer.

EXPORT my_data = lv_string_cc TO DATA BUFFER lv_buffer.
IMPORT my_data TO lv_xstrpdf_ads FROM DATA BUFFER lv_buffer IN CHAR-TO-HEX MODE.

and pass this lv_xstrpdf_asd to above FM.

My question is how to pass string to this FM so it will give me success.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Sandra Rossi Jan 16 at 02:42 PM
0

How did you manage to obtain a string of characters from a PDF file? Because a PDF is known to not be a text file ; a PDF is a binary file i.e. a string of bytes (XSTRING). So, your question should be how to get a PDF as a XSTRING (and then passing it to ADS_CREATE_PDF_SPOOLJOB is easy).

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hello Sandro,

Thanks for your reply.

I got one long string from one web service and now my requirement is pass that string to ADS_CREATE_PDF_SPOOLJOB but input of this FM is xstring. So I converted that STRING to XSTRING, and then passed. But it's giving error 'NOT PDF'.

0

Your issue is maybe already in the STRING. So whatever the way you convert it to XSTRING, the issue will always remain in the XSTRING. Please show the content of first few bytes of XSTRING in hexadecimal (should start with

255044462D312E... i.e. ASCII %PDF-1....)

0
Former Member
Sandra Rossi

Hello Sandro,

Yes, the problem was in the string. Now they(web Service) are sending xstring and that xstring is start with 2550444.

Thank You very much.

1