cancel
Showing results for 
Search instead for 
Did you mean: 

How to zip and unzip xml files dynamically by XI

Former Member
0 Kudos

Dear All ,

I am having <b>IDOC-XI-FILE</b> and <b>FILE-XI-IDOC</b> scenario and the output file or the input file is a .xml file .

<b>The xmls generated by XI(in case of Outbound scenario) or xmls taken by XI(in case of Inbound scenario) are to be ZIPPED in .zip files Dynamically Storewise .

We have to DYNAMICALLY GENERATE the zipped files as per the following convention : <Storecode>_<CurrentBusinessDay>_Filename.zip</b>

Note : I am able to generate files dynamically but generating zipped files dynamically is not known to me . Plz help . Also how to unzip Inbound xml files .

Thanks & Regards

Prabhat

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Prabhat,

In the File Receiver Adapter, you can use an OS command. This can be a call to a native program in the Application Server, or can be a Shell Script in the OS. You can use a Shell Script program that calls the Zip exe application and creates a zip file in the specified folder.

Pleae refer to these blogs:

/people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi

This also has a refernce to XML file:

/people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching

For Sender Adapter, I am not sure if it works. For sender adapter parameters, please refet to the SAP Note 801926.

If this helps, please remember to award the points.

Good luck,

Bhanu

Former Member
0 Kudos

Dear Bhanu ,

Thanks for your input

<b>My Operating system is Windows Server 2003 .</b>

I have following queries :

1)In <b>IDOC-XI-FILE</b> scenario , Currently I am generating xml files using variable Substitution and the naming convention I follow is : <b>%<STORE_CODE>%_%<BUSINESS_DAY>%_Filename.xml</b>

<b>Now I have to dynamically pickup the files storewise and Zip it Dynamically as</b> : ]%<STORE_CODE>%_%<BUSINESS_DAY>%_Filename.zip

2)Which DOS command I should use for Zipping the files in File adapter OS command .

First plz provide me the solution for Receiver File adapter .

For points don't worry I will give you 10 points if it solves my problem !!!!!!

Thanks & Regards

Prabhat

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>2)Which DOS command I should use for Zipping the files in File adapter OS command .

I think many programs allow you to zip files from a commanp prompt + using .bat files like the one below:

have a look at this docu

http://www.winzip.com/prodpagecl.htm

Regards,

michal

Former Member
0 Kudos

Hi,

Yes. Michal's URL takes you tot the Winzip download for Command Line Add-On. The command line format is:

winzip32 [-min] action [options] filename[.zip] files

If you want to see how it works before you download, check:

http://www.memecode.com/docs/winzip.html

Hope this helps,

Bhanu

Former Member
0 Kudos

Dear Michal / Bhanu ,

Thanks for the information but I didn't get any answer on the following :

<b>In IDOC-XI-FILE scenario , Currently I am generating xml files using variable Substitution and the naming convention I follow is : %<STORE_CODE>%_%<BUSINESS_DAY>%_Filename.xml</b>

<b>Now I have to dynamically pickup the files storewise and Zip it Dynamically as : %<STORE_CODE>%_%<BUSINESS_DAY>%_Filename.zip</b>

Please help me on this also .

Thanks & Regards

Prabhat

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>Now I have to dynamically pickup the files storewise and Zip it Dynamically as : %<STORE_CODE>%_%<BUSINESS_DAY>%_Filename.zip

just use the variable substitiustion

or dynamicconfiguration if you have SP14

and name the file as you like

then zip if with os command

if you need to pick up the file from a folder dynamicaly then you hava to use java proxy

Regards,

michal