cancel
Showing results for 
Search instead for 
Did you mean: 

how to process a zip file with XML and pdf in it

Former Member
0 Kudos

Hi Folks,

Vendor is sending us a zipped file 2 files in it

1) transactionId_payload.xml

2) transaction_invoice.pdf( or Tiff)

my requirement is

1) read the ZIp file using SFTP sender adapter.

2) Unzip the file and map transactionId_payload.xml to Idoc

3) Place the transaction_invoice.pdf  in a NFS mounted folder

Any suggestion?

Accepted Solutions (1)

Accepted Solutions (1)

abhijitbolakhe
Advisor
Advisor
0 Kudos

Hi Biplab

1)Use "PayLoadZipBean" in Module processor to unzip the file in a folder.

2) Create 2nd Interface to send the respective files to IDoc & NFS Folder respectively.

Refer the follwoing sap help link

http://help.sap.com/saphelp_nw73ehp1/helpdata/en/45/da9358a1772e97e10000000a155369/content.htm?frame...

SFTP Adapter Config Doc:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/305eeb5b-81e7-2f10-d8aa-9216de04c...

Regards

Abhijit

Former Member
0 Kudos

Thanks Abhijit.

Are you saying

1) create a interface which will unzip the file in a folder

2) create another interface to pull the files?

For the first interface can PayloadZip bean unzip both the files together?

Also , i was thinking in order to minimize the point of failure/ number of interfaces - can't we do it in a simple interface. May be a Java mapping or Adapter module?

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Biplab,

Two things you need to do here:

1) Unzip using PayloadZipBean module in the File sender adapter to pick the files. Then use the "PayloadSwapBean" to send the PDF as an attachment.

2) Send the two different files to two diffetent locations (FTP and NFS) - there is a round about way to do that - 

In the file adapter config. make sure the the file name and file path are from these payload fields. You can use a context object to refer these fields. Voila...the files are created in the 2 direcoties you mentioned.

of course the simplest way is to route the same message to 2 business systems/services and write them out using 2 ccs.,

Thanks,

Partha

gagandeep_batra
Active Contributor
0 Kudos

Hi Biplab,

As above said first create  first SFTP to file(NFS) scenario without ESR object and use "PayLoadZipBean" in the reciver CC to unzip the file at receiver side or you can also use RunOS command after message processing  to unzip the file

then create another interface from XML file to idoc and schedule sender CC after first interface..

Regards

GAGan

Former Member
0 Kudos

Thanks Gagan,

i'm trying that. My test.zip file has 2 files. During test i am getting following error.

Transmitting the message to endpoint <local> using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.lib.mp.module.ModuleException: Zip: error occured during processing: java.io.EOFException

gagandeep_batra
Active Contributor
0 Kudos

Hi Bilab,

first try to without zip module. just place a file from source to destination.

if it is successful then add zip bean

and what is the file name you have give at receiver side it' should like  xyz.zip

or you can use ASMA also

or another option you can go for RUN OS command to unzip the file also

plz check following link

http://scn.sap.com/thread/2144052

Former Member
0 Kudos

Still not working and i don't want to use OS command due to dependency on basis team and its maintainability...

gagandeep_batra
Active Contributor
0 Kudos

is it working without module means simple by pass scenario?

Former Member
0 Kudos

Yes.

I have used same file name in both sender and receiver adapter.I'm getting new error now.

MP: exception caught with cause com.sap.aii.af.lib.mp.module.ModuleException: Zip: error occured during processing: java.util.zip.ZipException: invalid distance too far back

gagandeep_batra
Active Contributor
0 Kudos

Hi Biplab,

First can you check with single zip file which have only one file and try to unzip it first using module.

and also check:

http://scn.sap.com/people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the...

Regards

GAgan