cancel
Showing results for 
Search instead for 
Did you mean: 

PO Proxy binary files --> sftp scenario

Former Member
0 Kudos

Hi,

We have a report, that is creating two files (pdf & xml) which should be sent via SFTP to a target system. As it´s ABAP reports, I would like to avoid the files on SAP side and create a proxy, to which the binary file data can be sent then.

So my idea is to create an interface (and generate the proxy), which has one or more elements for the file and each of them has an element for the filename and an element for the binary file content (base64Binary).

I would go for Java mapping and would like to create a file on the target system via the SFTP adapter, for each file element (which has the filename and the binary filedata as elements).

How can this be done the best way? Do I need to call the proxy for each file or can I do that with one proxy call and then design the mapping the way, that the SFTP adapter creates the files?

Thank you & best regards,

Arne

Accepted Solutions (1)

Accepted Solutions (1)

manoj_khavatkopp
Active Contributor

Arne,

Why dont you just send the XML file as main payload and the PDF as proxy attachment.

Br,

Manoj

Former Member
0 Kudos

Thanks for the help. I found an example.

Answers (2)

Answers (2)

former_member182412
Active Contributor

Hi Arne,

  • For dynamic file name for XML file you can use DynamicConfiguration in message mapping or if you have the file name in the one of the field in XML then you can use variable substitution.

Reuse FunctionLibrary for DynamicConfiguration and Message Header Attributes

  • If you set the file name for PDF attachment already in the proxy then you can enable the check box store attachments then attachments also will write in target directory.

To keep the same file name use below parameter under Advance Mode section as additional parameters in SFTP receiver channel.

Parameter Name : retain.attachment.name

Parameter value : true

Regards,

Praveen.

Former Member
0 Kudos

Thank you very much, Praveen! That was really helpful!

former_member638032
Discoverer
0 Kudos

Hi Praveen ,

I used the same parameter retain.attachment.name = true and it retained the attachment name but it fixed the main paylaod name to "MainDocument" .

I tried all the thing( variable substution/Dynamic config UDF) but unable to affect the main paylaod name from MainDocument to any other name.

Could you please provide any input on this .

Regards,

Saurabh

Former Member
0 Kudos

Hi Manoj,

this sounds like a good approach. I haven't done that much with PI the last years, so I was not sure how to do this.

So when I send the XML file in the payload and the PDF as attachment, how should the outbound interface and the inbound/file receiver side look like? Somehow I would also need to set the file names dynamically.

Thank you for your advices.