cancel
Showing results for 
Search instead for 
Did you mean: 

How to split payload and attachment in SAP PI?

Former Member
0 Kudos

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,

Ashok.

Accepted Solutions (0)

Answers (2)

Answers (2)

manoj_khavatkopp
Active Contributor

Ashok,

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.

Br,

Manoj

former_member190293
Active Contributor

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
0 Kudos

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.

Regards,

Ashok

manoj_khavatkopp
Active Contributor
0 Kudos

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
0 Kudos

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

Regards,

Ashok

former_member190293
Active Contributor
0 Kudos

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.

https://help.sap.com/saphelp_nwpi711/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/content.htm

For example:

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

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

Regards, Evgeniy.