cancel
Showing results for 
Search instead for 
Did you mean: 

proxy to file

Former Member
0 Kudos

hi all,

proxy to file in sap pi 7.31

scenario created. complexity is a file needs to be output in dir B, which is inside dir A, which is inside root folder - for example, let say the root folder is \root, then the file tmp.xml needs to be created inside \root\A\B directory.

then the directory A needs to be zipped to get a tar file with name say A.tar - then this A.tar needs to be gzip to get A.tar.gz in the \root folder.

so how to get it done through file adapter - we have PI on a window server - tar and gzip are unix commands? or tar and gzip can run in windows os.

any idea, pls. thx. all helpful replies will be appreciated.

Accepted Solutions (0)

Answers (4)

Answers (4)

0 Kudos

Hi Stewart,

I have a same kind of requirement.

Please let me know how you have achieved this ?

Thanks much..

Regards,

Akhil

anupam_ghosh2
Active Contributor
0 Kudos

Hi Akhil,

             Please can you open a new thread for this purpose.

You can get more response.

Regards

Anupam

former_member190293
Active Contributor
0 Kudos

Hi Stewart!

You could try to do this using OS script with option "Execute OS command after message processing".

Regards, Evgeniy.

0 Kudos

Hi Stewart,

as already mentioned above you can do it with a java mapping or adapter module by using

java.util.zip.GZIPOutputStream

and

org.apache.commons.compress.archivers.tar.TarArchiveOutputStream

Regards

Mathias

iaki_vila
Active Contributor
0 Kudos

Hi Stewart,

Have you tried with the standard payloadzipbean?. Check this blog

Regards.

former_member186851
Active Contributor
0 Kudos

Hello Inaki,

This module performs ZIP for only one message right?,is there a way to collect and zip using this module?

iaki_vila
Active Contributor
0 Kudos

Hi Rahuraman,

AFAIK you are right and it can be used only to zip all the payloads in only one message or "communication".

Regards.

Former Member
0 Kudos

hi inaki,

payloadzipbean would zip the output file only right?

my requirement is to create the file under dir B under dir A - so i create dir A, dir B and then tmp.xml inside dir B - something like \root\A\B\tmp.xml

so if i just use payloadzipbean - would it just create a zip file containing only tmp.xml file and produce tmp.gz - right? how to include the directory strucuture A\B\tmp.xml in the zip file - can payloadzipbean do it?

also my requirement is to have tmp.tar.gz - so first a .tar file having directory structure A\B\tmp.xml and then gzip it - any idea how to get it?

iaki_vila
Active Contributor
0 Kudos

Hi Stewart,

AFAIK with payloadzipbean you can zip all the files in one directory, but if you have n files you will have n zip files. Check these examples SAPTechnical.COM - Zipping Files/Payloads using Module PayloadZipBean or this one

I'm sorry, i missunderstood you requirement with only one zip file. I think the only way is to do an own module or your initial idea with a OS batch file.

Regards.