Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Recently we have developed a HTTP to File scenario in PI. There was a requirement that the target file name will be same as the attachment file name. SAP has provided a java method to read the attachment data and content type, content ID, but there is no standard function to read the attachment file name.

We have referred the following blog to create the HTTP test client for our interface.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/08/12/http-test-tool-for-sap-pi-73

The new java HTTP adapter supports attachment, Multipart Documents, form submission. The adapter also provides options to send URL parameters and Header Parameters in the dynamic header of the PI message.

So to read the attachment file name, we have passed the attachment file name in the URL and then read the same from dynamic header. Below are the detail steps

  1. Find the input parameter for attachment , inside the HTML form

<td width="30%"><input type="file" name="Attachment1" size="40" /></td>

Attachment1 is the parameter.

2. Modify the java script to include the attachment file name in the URL

So in the URL file name parameter will carry the actual attachment file name.

3.Make the change in the communication channel so that the file name will be populated in the dynamic header

4.Write the following line of java code to read that value from header and then set the same for file adapter so that the target file will be generated with that name

Test Result:

File name populated in header

Target file name generated

3 Comments
Labels in this area