Skip to Content
0

How to split payload and attachment in SAP PI?

Apr 20, 2017 at 03:02 PM

240

avatar image

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.

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
2

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

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.

1

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

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

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.

0

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

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

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.

Share
10 |10000 characters needed characters left characters exceeded