cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a PDF-Mail-Attachment via Abap Mapping possible ?

detlefrathke
Explorer
0 Kudos

Hi folks,

I am trying to build a szenario like: Getting an Idoc -> sending it to abap mapping -> map a pdf from smartforms in abap -> map the from/to for the mail payload -> come back from abap mapping -> send it with the mail adapter .

But now I am stuck at the point "coming back from abap mapping", because the pdf -data seems to become unreadable because of conversion. I am using Ixml and trying to attach the create pdf (looks hex-right at that point) by method create_simple_element as content-tag of the mail. But after rendering and coming back out of mapping, it seams that that data is not converted from xstring back in the right way. Can someone give a hint ? Is that way by IXML not possible for data including binary-data ? Have I to go another way?

Thanks in advance

Detlef

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

> as content-tag of the mail.

Sometimes I have to read the request several times to find the issue:

No you cannot put a binary as part of an XML element.

You can only send a plain binary as payload, so the whole mail would be nothing besides the PDF.

In PI 7.1 you can create also an additional attachment out of mapping, but I do not know if this works for ABAP mapping also.

The whole "I want to send an email with attachment out of PI" topic is not supported from PI development in any way.

So you have to write a lot of code (especially Java code) to achieve this.

> Regarding your opinion. Its based on customer requirements to have central focal point in dezentral landscape.

The PI expert has to advise the customer for the scenarios. That is part of the job.

detlefrathke
Explorer
0 Kudos

Hello Stefan,

thanks for your useful answer regarding the binary data. I will reqard points for that, though I personally feel that some of your "judging" sounds a little bit too offensive for a public forum like that

with regards

Detlef

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

Maybe you find something useful in function group SAPLSCMS_CONV.

In my opinion it is not a good idea to create a PDF from IDoc in an ABAP mapping.

PI is made for system integration, not a mail sending progrm.

I recommend using the mail function of the application system.

detlefrathke
Explorer
0 Kudos

Hello Stefan,

thanks for your answer. I tried to use the scms_string_to_xstring before, but the output looked the same as the output of the renderer on the result-xstring. So I stopped that try. I will have a try on the binary_to_xstring. Maybe works better. I am interested in the question, whether pdf -data can be transfered like that or if i am only loosing time.

Regarding your opinion. Its based on customer requirements to have central focal point in dezentral landscape.

with regards

Detlef

madhusudana_reddy2
Contributor
0 Kudos

Hi Instead you can do it with simple adapter module in receiver mail adapter,

you are having all methods to convert the payload into attachment and set attachment name etc in module java methods.

http://wiki.sdn.sap.com/wiki/display/XI/AdapterModulePI7.0SetAttachmentName

thanks,

madhu

detlefrathke
Explorer
0 Kudos

Thanks Madhusudana for your Answer,

does the advice in the link mean, that i have to call the that kind of module after getting the xstring from the abap mapping and it will convert the data back ?

with regards

Detlef