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: 

ADS_CREATE_PDF_SPOOLJOB retunring NO PDF Error

u9_
Explorer
0 Kudos

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.

4 REPLIES 4

Sandra_Rossi
Active Contributor
0 Kudos

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).

0 Kudos

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 Kudos

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....)

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.