cancel
Showing results for 
Search instead for 
Did you mean: 

Process MailAttachment payload instead of MailMessage

Former Member
0 Kudos

I want to receive mails and forward the attached csv file to an XI Receiver.

But always the MailMessage and the MailAttachment are forwarded and only the MailMessage is then processed at the XI receiver:

Configuration details of the mail sender adapter:

- Message protocol: XIPAYLOAD

- Use mail package: yes

- Keep attachments: yes

- Adapter modules:

  • PayloadSwapBean
    • swap.keyName: Content-Type
    • swap.keyValue: application/vnd.ms-Excel
  • MessageTransformBean
    • (parameters for SimplePlain2XML transformation)
  • CallSapAdapter

I expected the PayloadSwapBean would let me process the attachment only. Why is the MailMessage still added as payload?

I tried using XIMailAdapterBean instead of CallSapAdapter but still the MailMessage is processed.

SAP note 2040884 looks like a solution. But I cannot make use of the required SP.

Any other ideas how to put the attachment payload only into the message?

Accepted Solutions (1)

Accepted Solutions (1)

engswee
Active Contributor
0 Kudos

Hi Waldemar

PayloadSwapBean just switches which payload is referred to as the Main Document. It does not remove any payload or attachments from the message. Therefore even after swap, it is passed on to the XI receiver. However, that shouldn't bother you unless the ABAP Proxy receiver logic explicitly checks that there should not be any attachments. Otherwise, the ABAP proxy logic can just worked on the swapped payload.

If you really need to remove the unwanted MailMessage payload, you need to use custom logic to remove the attachment in either a Java mapping or a custom adapter module.

Regards

Eng Swee

Former Member
0 Kudos

Hi Eng,

thanks for the explanation.

In the manifest of the message I could find that the MailAttachement-1 is of type "Application" (and MailMessage of type ApplicationAttachment).

It is only a bit confusing that in the answer message the MailMessage is given as payload.

But by remote debugging I found that MailAttachment-1 is being processed.

So everything is working now. Thanks.

Regards,

Waldemar

engswee
Active Contributor
0 Kudos

Yup, the SXI_MONITOR on the ABAP stack does not show the swap quite well, so it can be a bit confusing.

PIMON shows clearly which is the main payload and which are the attachment(s).

In reality, the payload is not being moved, it's just a change of pointer reference internally.

Answers (0)