cancel
Showing results for 
Search instead for 
Did you mean: 

ZIP file in sap pi

0 Kudos

hi

i have one scenario which is to pick zip file from one ftp and to drop it on other ftp as a text files.

then i tested it and i get files with unreadable format(content get changed).

but when i try to drop zip file the file content will not change.

so what is the problem with it or did i miss something on my configuration

please help me

thanks

Accepted Solutions (1)

Accepted Solutions (1)

pkrauthan
Explorer
0 Kudos

Hi,

the issue is that you try to store binary file (zip file) as an text file. You have to use binary as file type in the file adapter.

If you want to unzip the zip file and you want to store the content of the zip file, you have to use the Payloadzip-Bean as an adapter modulle

Best regards,

Peter

Answers (5)

Answers (5)

0 Kudos

hi all

am trying to use java code in massage mapping the code provided by Praveen Gujjeti in


now am facing the below error in sxmb_moni

       <SAP:P3>Content is not allowed in prolog.</SAP:P3>

<sap stuck> Runtime exception occurred during application mapping com/sap/xi/tf/_MM_zip_; com.sap.aii.utilxi.misc.api.BaseRuntimeException:Content is not allowed in prolog.<sap stuck>

as i said earlier my senario is to pick zip file(which contain multiple files) from ftp and to put files as .txt in other ftp.

can any body help me in this issue?

please help am new for sap pi


thanks

pkrauthan
Explorer
0 Kudos

Hi Getinet,

message mapping expects XML as input.

You have to write a Java mapping by yourself.

see for example:

but keep in mind that you need a multi message mapping.

Much easier would it be, if you use the PayloadZipBean in the receiver adapter. In this case, however, you cannot access the payload in PI (i.e. no content based routing)

Best regards,

Peter

0 Kudos

thanks all for your replay

now its working fine for the first file but its ignoring other files

is there any module to unzip many files or i have to use java code?

thanks

former_member186851
Active Contributor
0 Kudos

Hello ,

As I mentioned previously,Only first file will be unzipped.

Check the link I shared and try using Java mapping.

pkrauthan
Explorer
0 Kudos

If you don't have to Access the payload in PI (no Content based Routing, no Transformation) you could do the unzip in the Receiver File Adapter.

If you unzip in the Sender Adapter you only get one file.

BR,

Peter

apu_das2
Active Contributor
0 Kudos

Along with PayloadZipBean additionally use Messahe transformBean and make the content type text/xml. I guess your content type is getting changed.

Thanks,

Apu

0 Kudos

dears

i used PayLoadZipBean module in sender channel

bzw it work perfect to drop the same zip file but when try to drop .txt file file content will show like the below format.

PK        Jn I‰7Ú &   -       a1.txtK-I- ¢T…ÊÊÊT  ’IJäâäô” ^®â””ÔôôT0LO  PK        Un IÍ…Fþ            a2.txt31ååJL  PK          Jn I‰7Ú &   -     $           a1.txt
       ¦¬z úÑ ¦¬z úÑ P+¥z úÑ PK          Un IÍ…Fþ          $       J   a2.txt
       ¹ì£ˆ úÑ ¹ì£ˆ úÑ B¢œˆ úÑ PK      °   v
Former Member
0 Kudos

This looks like you are not unzipping, because starting with "PK..." is a ZIP-File.

Could you post your module configuration?

br, Heiko

0 Kudos

hi heiko

this is my module configuration

former_member186851
Active Contributor
0 Kudos

Hello Getinet,

If am not wrong multiple files cant be unzipped using the payload bean.

Try the approach in the below link

Unzip multiple files | SCN

Former Member
0 Kudos

Hi Getinet,

there is a simple spelling mistake. It has to be "AF_Modules/PayloadZipBean" (small L)

Have you checked the channel monitor after processing the message? There should be a message.

br, Heiko

manoj_khavatkopp
Active Contributor
0 Kudos

When you say unreadable format(content get changed) is the format of the file or and content inside it its getting corrupted .

How are you unzipping the file ? Using java or PaylaodZipBean ?

Br,

Manoj

0 Kudos

hi manoj

i used PayLoadZipBean module