Skip to Content

How to split payload and attachment in SAP PI?

Apr 20, 2017 at 03:02 PM


avatar image
Former Member

Dear Experts ,

My scenario is SOAP sender to Two SFTP Receivers.

I am using SOAP UI tool one XML payload and one attachment (it can any attachment PDF ,image.)

1) SOAP sender

2) Two target SFTP Server .

In SFTP server it can differentiate one XML payload goes to one target folder and another attachment is goes to one another target folder.

Now i am getting both in one folder with XML and attachment .

Note:-- i want to split the attachment and payload with two different folder in SFTP server .

How I achieve it.

Java Mapping was suggested by few people. Would like to know how to split the XML file and Attachment.

Please do needful ASAP

Best Regards,


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Manoj K Apr 21, 2017 at 12:23 PM


Create 2 SFTP channels :

1.Channel1 Dont check "Keep Attachments " in this case you will get only xml file.

2.Channel 2 Dont check "Keep Attachments " use payload swap bean and in this case you will have the attachment.



Show 4 Share
10 |10000 characters needed characters left characters exceeded

Addition to Manoj's answer: you need to create two receiver interfaces as well.

And you should set correct file name in ASMA of your second adapter.

Regards, Evgeniy.

Former Member

Hi Manoj,Evgeniy Kolmakov,

Thanks for your reply,

I create 2 SFTP receivers and both channel unchecked "store attachment " and i use payload swap bean and enabled ASMA also but i am getting only payload in both SFTP Receivers .test.png

Before that payload and attachment comes in both receivers folders. test2.png

Please help me how to split payload and attachment .

Note:- I am sending payload and attachment by using SOAP UI tool .sender.png

Please do needful.



test.png (3.9 kB)
test2.png (5.5 kB)
sender.png (45.1 kB)

please cross check your paylaodswap bean parameters , check the message log and see the module execution part whcih expalins if swap was successful or not.

Former Member

Hi Manoj,

I checked logs its showing warning Swap: parameter missing swap.keyName and swap.keyValue please tell me which parameters are useful to my scenario .i configured parameters like swap.png and check the logs swapbeanlog.png.

Please help me ASAP



swap.png (8.2 kB)
swapbeanlog.png (48.5 kB)
Evgeniy Kolmakov Apr 24, 2017 at 06:43 AM

Hi Ashok!

As per SAP help on PayloadSwapBean:

Add Parameters in the Module Configuration
3. To ensure that the attachment that is to replace the application payload can be found, you must specify a parameter from the MIME header. Under Parameter Name, enter swap.keyName.
4. Under Parameter Value, enter a payload attribute such as payload-name or payload-description, or an attribute from the MIME header such as content-type or content-description.
5. Under Parameter Name, enter swap.keyValue.
6. Under Parameter Value, enter the value that the attribute is to have. The MIME headers of the payloads are searched in order and the system takes the first payload that meets the criteria. This payload is swapped with the application payload.

For example:

swap.keyName = Content-Disposition
swap.keyValue = attachment;filename="file_name.ext"

swap.keyName = Content-Description
swap.keyValue = Attachment-1

Regards, Evgeniy.

10 |10000 characters needed characters left characters exceeded