cancel
Showing results for 
Search instead for 
Did you mean: 

convert pdf xstring to pdf file format

Former Member
0 Kudos

Hi, All,

Could anybody know how to convert xstring(hexadecimal format like 255044462D) to pdf file format? I have to output pdf xstring which generated in SAP to XI, then output PDF file. Thanks a lot!

Marea

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi Marea,

I never tried that but maybe you can

1. put the xstring into attachment as shown in my blog:

/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments

2. inside file adapter switch the main payload with the one from

attachment (file receiver adapter does not work with attachments

but if you put adapter module before that it may still be there - I'm not sure

but worth a try)

Regards,

michal

Former Member
0 Kudos

Hi, Michal,

Thank you for the quick response. I just got my adapter module work.:).

Intentionally, I want to send out pdf xstring as a xml message to xi through proxy. And then I will build a adapter module to take the xml header and trailer out, leave the content pdf xstring. And then convert the pdf xstring to PDF file format. And then output it to somewhere using FTP adapter. The whole process works fine now. But I don't know how to convert that pdf xtring to pdf file format in my adapter module. I tried to use base64 to decode it. But it seems does not work. I guess it must has other decode tool that I don't know.

But your method may worth to try.

I will try it and let you know if it works. Thanks again.

Marea

henrique_pinto
Active Contributor
0 Kudos

From what I've understood from Michal's blog code, it will depend on the format that you choose for the file to have.

In his case, he used

type = if_ai_attachment=>C_MIMETYPE_JPEG

In your case, you could use the equivalent type for PDF files.

If you search for the IF_AI_ATTACHMENT interface in SE80 (ABAP Workbench), under Attributes folder you'll be able to see the constants which are defined in the interface. And there you have C_MIMETYPE_PDF (associated to the content-type 'application/pdf').

I don't know whether it is possible to do the type association using the RFC payload (probably not). The ABAP Proxy attachment seems to be the best approach.

Regards,

Henrique.

Former Member
0 Kudos

Hi, Henrique, Michal,

Thanks for the adding. I am wondering why I did not get email telling me my question got new answer. Anyway, I tried, but it seems does not work. My itab has two elements tdformat and tdline. I think I have to concatenate them both to attach_xstring. But their type does not match xstring. They are char. I can not put them together. do you have any idea on this one?

Also, I tried my old one. I can convert pdf xstring to pdf file format now, but when I send it out through my adapter module, I got an error saying "The transaction is marked for rollback.". Have you ever encounter the same problem? How do you sovle it? I may ask too much, but please help me. Thanks a lot!

Marea