cancel
Showing results for 
Search instead for 
Did you mean: 

Unzip file and send with same name

Former Member
0 Kudos


Hi Experts,

I have scenario File to IDOC.

Here file is coming as .zip file

1) example: "MaterialNumbers_123.zip" (with in it "Details.CSV" ) and I need to Unzip and read file and map to Idoc.

If it needs complex Java mapping I will consider second approach.

2) File to File

Unzip with same name "MaterialNumbers_123.CSV" and process .CSV file with other interface.

Can any one advise me best and simple approach for this on how to unzip with same name.

gone through below thread:

http://scn.sap.com/docs/DOC-63302

If possible want to avoid Java mapping for this.So checking for simple alternate if available.

BR

Siri

Accepted Solutions (1)

Accepted Solutions (1)

sahithi_moparthi
Contributor
0 Kudos
Former Member
0 Kudos

Hi Sahiti,

Thanks for your reply,

Stefan's Blog explaing process of merge files and Zip

My requirement here is to Unzip file and rename inside file name exactly like .zip file name.

I am not sure how this approach helps me ,

if you see my requirement is possible with above blog.

it helps me if you can explain me little more detailed as sender side settings are not explained in this,

Thanks in advance...

Regards

Siri


markangelo_dihiansan
Active Contributor
0 Kudos

Hi Siri,

You can unzip the file via payloadzipbean and then use messagetransformbean to convert the csv to an xml After the payload has been converted to XML, normal message mapping can take place.

Regards,

Mark

Former Member
0 Kudos

Hi Mark,

Thanks for reply..

But I am confused at carrying same name to unzipped file.

As I am doing unzip its creating .csv file with its actual name but I need .csv file name same as .zip

example:

Original .Zip file "MaterialNumbers_123.zip" (with in it "Details.CSV" )

MaterialNumbers_123.zip

should become

MaterialNumbers_123.csv after unzip instead "Details.CSV"

so, I can read "_123" value and pass it to Idoc target field in my mapping.

or is there any other way where I can capture .zip file name and read it in my map while doing mapping to CSV to Idoc.

My requirement is :

I need "123" value from .zip file name to use in my mapping to pass it to IDOC.

in FILE to IDOC Mapping.

how to get this ...

Thanks in advance..

Regards

Siri


Former Member
0 Kudos

Hi,

In otherway..

FILE(ZIP) to IDOC

Is Unzip (payloadzipbean) and reading its CSV file(messagetransformbean) using Content conversion is possible in one sender communication channel?

Thanks in advance..

Regards

Siri

stefan_grube
Active Contributor
0 Kudos

Is Unzip (payloadzipbean) and reading its CSV file(messagetransformbean) using Content conversion is possible in one sender communication channel?

Yes, this is possible. You can put both modules into the "processing sequence" in "module" tab.

Make sure that the PayloadZipBean is the first, the MessageTransformBean the second and the CallSapAdapter the last. The file name of the original zip file can be stored into the adapter specific message attributes and used within mapping with help of a user defined function.

Former Member
0 Kudos

Hi Stefan/Mark,

Thanks a lot for inputs..

Using AF_Modules/PayloadZipBean,AF_Modules/MessageTransformBean,CallSapAdapter.


I am now able to Unzip and Read CSV file and mapping it to IDoc.And Its working fine.

But If I try to add DC UDF for reading Source ZIP file Name and map it to target filed, its creating only DC used field value with ZIP file name and ignoring all other field mapping.

I am little confused on this, why remaining fields are getting Ignored if I use DC for one field.

How to read sender ZIP file name and send it to one of the fields of IDOC in this mapping

Thanks in advance


Siri

maheswarareddykonda
Active Contributor
0 Kudos

Hi Stefan,

I have gone through your link( ) and did an small POC...it working untill unless zip file contains only one file..could you please guide me how to handle multiple files with out java mapping..

Thanks in advance !!

Regards,

Maheswarareddy

Former Member
0 Kudos

Hi Stefan/Mark,

got it now, I was using fieldSeparator "'0x09'"  its causing error,

      once it's replaced with "," solved the issue.

I need to skip intial few Rows while reading file , so in MTB how to maintain "Document Offset" Value, I am not able to find parameter for this..

Thanks for help..

Regards
Siri

Answers (0)