01-16-2018 2:02 PM
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.
01-16-2018 2:42 PM
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).
01-19-2018 11:44 AM
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'.
01-19-2018 4:37 PM
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....)
01-23-2018 11:45 AM
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.