cancel
Showing results for 
Search instead for 
Did you mean: 

PayloadZipBean with customized zip filename

Former Member
0 Kudos

Hi,

I am using PayloadZipBean for zipping my XML payload, However i get zip file as expected e.g. rakesh_05_05_2010.xml.zip But inside this zip file i get MainDocument or untitle.txt based on zip.filenameKey setting as payloadName or contentType etc..

Question : Is their any way by which i can get files named as rakesh_05_05_2010.xml wrapped in rakesh_05_05_2010.xml.zip ?

i want to have embedded file name as zip file name without .zip.

Please let me know how we can achieve this in SAP PI 7.0.

Regards,

Rakesh Mourya.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

For Dynamic File name, you can handle it in Message Mapping itself. You can write a UDF in the Header Level for getting File names Dynamically.

Thanks,

snair

stefan_grube
Active Contributor
0 Kudos

> Please let me know how we can achieve this in SAP PI 7.0.

When you want a dynamic filename, then this is not possible without implementing an adapter module.

When you can accept a static filename, you can set the name with help of the MessageTransformBean.

/people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework

Former Member
0 Kudos

Hi Stefan,

Thanks for your quick response.

I have ABAP Proxy to FILE scenario wherein my file content are in form of XML in payload i don't have filename in this scenario.

any idea how can we change payload name during runtime so that i can use zip.filenameKey setting as payloadName.

by default payloadname is always MainDocument.

Any help will be greatly appreciated.

Regards,

Rakesh Mourya.

Former Member
0 Kudos

Hi,

I have used O.S Command after File proccessing to do this zip on UNIX (one of easy ways to do this in unix scripts).

Regards,

Rakesh Mourya.

markbernabe
Active Participant
0 Kudos

Hi Rakesh,

I have the same requirement. Did you create a shell script and mention it in the command line? Did it work?

Former Member
0 Kudos

Hi Mark,

Yes, Shell Script on command line after file is created filename.xml.

You need to be very careful in scripting ... you need to put some delay or wait time.

Since file creation and availability of file on drive /folder take time and Shell script execution is very fast.

You need to ensure you put sufficient amount of wait time depending on maximum size of xml or file you are creating else file will not be zipped.

Hope it helps!!!

Regards,

Rakesh Mourya.

markbernabe
Active Participant
0 Kudos

Hi Rakesh,

Thanks for the wonderful advice! I'll make sure of it when I implement my own shell scripts.

BR Mark