on 02-09-2012 6:00 PM
Hi Sdn,
I have requirement where I need to convert the file to GZIP extension and keep it at Application layer.
Can any one please help me how to convet the file to GZIP in file adaptor?
Thanks
Naresh N
You can find the option Run Operating System Command After Processing in your receiver Communication channel. See some more details here:
http://help.sap.com/saphelp_nwpi71/helpdata/en/44/556cb799c93677e10000000a114a6b/frameset.htm
Try typing "gzip %f" or "gzip %F" to see whether full (%F) or relative path (%f) is required. If this works fine, then you can also add "rm %f" to delete the uncompressed file.
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have a constant file name, you can use it like that: "gzip user/COMM/XXXXXX.xml"
But if not, you can make use of this:
When the operating system command is called, you can specify the file name currently being processed with the following placeholders:
%f (file name)
%F (absolute file name including path)
Greg
please, find below a lonk to a module I have developed to zip and unzip messages using gzip:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Naresh,
You could try with this adapter module PayloadZipBean:
http://help.sap.com/saphelp_nw73/helpdata/en/45/da9358a1772e97e10000000a155369/content.htm
I'm not really sure if you can get the gzip file, or only zip. But this might be a nice point to start.
Hope this helps,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think this option is for the normal ZIP.
Honestly I was afraid this could be true.
So I think there is no other option than to create your own adapter module. Find a step-by-step guide on how to create adapter modules here:
http://wiki.sdn.sap.com/wiki/display/NWTech/CustomAdapterModuleDevelopment-SAPPI+7.1
And a Java class that will help you compress the data stream with GZIP:
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/zip/GZIPOutputStream.html
Hope this helps,
Greg
Hi Naresh,
For this requirement you could use a java mapping and use the GZIPOutputStream in java.util.zip to compress the payload. Copy the InputStream to the GZIPOutputStream which inherits from OutputStream and then just zip the contents using finish() and then close() the stream.
Regards,
Ryan Crosby
Hi Naresh,
The usage of java mapping requires that you use interface determination so you'd have to create that in the ESR. But in order to create the interface determination you'd first have to write the java code for the mapping and then compile it into a .jar file. Once you finish that you can import the .jar archive in the ESR and finish the interface determination. Then you simply reference the interface determination in your PI configuration.
Regards,
Ryan Crosby
Hi Naresh,
Also the easiest way to do the gzip compression if you are using the file adapter is to simply run an OS command line for gzipping the file after the message has been processed. I suppose I wasn't paying full attention and read the other reply before thinking about the solution. This of course is a much easier way to achieve the same outcome.
Regards,
Ryan Crosby
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.