cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC Payload attachment send with PI E-Mail Adapter using mail package

Former Member
0 Kudos

Dear all,

maybe this would discussed several times before, so sorry for that, but unfortunately I couldn't find any solution in this forum.

Okay follow scenario:

We get a message to our PI as an IDOC payload.

In the second step, we have to send an E-Mail on different E-Mail recipient with fully IDOC payload as an attachment.

We have to use the mail package and we get the E-Mail with an attachment.

Unfortunately its only the mailpackage, but not the IDOC Payload.

But in the ABAP Stack, I can see the payload, before I did the mapping

So, what should I do, that I get the IDOC Payload as an attachment instead of the mail package attachment ?

Short: I need the incoming payload as an attachment before the mapping.

Is this possible? and yes, how??

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

I tried to understand your issue, but i failed. Could you give a short overview about your scenario, where does the message come from, where does it go to (adapter type?) What do you have and what do you want to have? The PayloadSwapBean is not really useful. It does not swap the payload and attachment in real. I think you have to swap attachment and payload with Java mapping.

Former Member
0 Kudos

Hi Stefan,

follow Scenario:

the incoming IDOC would be arrived us as an IDOC XML file.

Next step will be to send this file as an attachment via E-Mail Adapter.

Now  the challange:

The customer sent from different sites the same message type. We should indentify which co-work are responsibility for this site, and than they get the relevant E-Mail.

e.g. Customer X Site X sent a ORDER Idoc Message.

We should send than a E-Mail to the responsibility co-worker for Customer X Site X.

Customer X Site Y sent a ORDER Idoc Message.

We should send than a E-Mail to the responsibility co-worker for Customer X Site Y

(This is the reason, why we have to work with the mail-package, or?)

What we have is follow

An E-mail with an attachment. Unfortunately this attachment is only mail-package, nothing else. This means the attachment contains the mapped content value.

stefan_grube
Active Contributor
0 Kudos

When I want to have an email with body and attachment, then i prefer using a Java mapping to create the entire MIME structure, because the mail adapter has many restrictions and it is really hard to work with it. When I understand you correct, your original message is just the Idoc payload and no attachment. So you can use this blog to create mail package with Java mapping: http://scn.sap.com/people/stefan.grube/blog/2007/04/17/xi-mail-adapter-an-approach-for-sending-email...

Former Member
0 Kudos

Hello Stephan,

This can be done if you have a sender CC by simply clicking on save as attachment, however a CC is a java component. Here IDoc is involving an ABAP stack, and it is not possible to directly use CC.

So you need to use NW BPM which belongs to java stack, and which will have a CC, and hence you can click on the check-box for "save as attachment".

Kind Regards,

Souvik

Former Member
0 Kudos

Hi Souivik,

the payload is  as well in the Java Stack, because the message is coming from the customer:

So, question: is it possible to swap the payload with module PayloadSwapBean?

Former Member
0 Kudos

Ok, so in that case, please check the checkbox in the sender CC "save as attachment".

PayloadSwapBean is used to convert attachment to Payload.

Kind Regards,

Souvik

Former Member
0 Kudos

Hi Souvik,

maybe we have here a misunderstanding, because as I wrote above, I get an attachment, but unfortunately the mail package and NOT the incoming Payload.

In short words I need the incoming Payload BEFORE mapping as an attachment.

Next maybe you mix the PayloadSwapBean with another bean...

you can indeed replace the payload with the PayloadSwapBean. Please read the help document by SAP: Adding PayloadSwapBean in the Module Processor -  Adding Modules to the Module Processor - SAP Libr...

...

You use the PayloadSwapBean module to replace the application payload of the XI message that contains the business data with another payload that is appended to the XI message as an additional attachment.

The module can be applied in adapters that forward attachments.....

So, back to the start...I'll try something others maybe I find a solution, or other helpful comments will be welcome

Former Member
0 Kudos

What seems strange over here is, how can a message containing idoc and coming from customer contain an idoc number??