Sender File Zip
Hi guys.
I have to pick up a file. This file is zipped.
Could I pick the zip up, unzip it ant process the file with content conversion?
Thanks a lot.
Regards.
Sorry I had forgotten to add it in this threat.
This is the right configuration I have!!!
row (1..n)
>TRANSPORTES (1)
>ENTREGAS (1..n)
I have configured the module tag lin this way:
AF_Modules/PayloadZipBean - zip
AF_Modules/MessageTransformBean - transform
CallSapAdapter - 0
zip - zip.mode - unzip
transform - Transform.Class - com.sap.aii.messaging.adapter.Conversion
transform - xml.ENTREGAS.endSeparator - 'nl'
transform - xml.ENTREGAS.fieldFixedLengths - 1,30
transform - xml.ENTREGAS.fieldNames - TIPO,NUM_ENTREGA
transform - xml.ENTREGAS.keyFieldValue - E
transform - xml.TRANSPORTES.endSeparator - 'nl'
transform - xml.TRANSPORTES.fieldFixedLengths - 1,30
transform - xml.TRANSPORTES.fieldNames - TIPO,NUM_TRANSPORTE
transform - xml.TRANSPORTES.keyFieldValue - T
transform - xml.keyFieldType - CaseSensitiveString
transform - Transform.ContentType - text/plain;charset=utf-8
transform - xml.conversionType - StructPlain2XML
transform - xml.documentName - MPrueba_Zip
transform - xml.documentNamespace - http:/XXXXXX.es/XXXX/sap/prueba
transform - xml.keyFieldName - TIPO
transform - xml.processFieldNames - fromConfiguration
transform - xml.recordsetName - row
transform - xml.recordsetStructure - TRANSPORTES,1,ENTREGAS,*
Thanks everybody!!!
Similar Messages
-
Zipping multple files and sending the Zipped folder to target location using Biztalk
Hi all,
I have requirement like
Seperate Xml files will be coming as incoming message to Biztalk
Biztalk need to send a zipped folder contining all these xml to target location
any link or component i can use to meet this requiremant plese help
regards,
VineethCreate or use the publicly available custom component for unzipping the received message and for send use another component to replace all attachments of a multi-part message
(multiple parts to multiple files to zip) for its zipped equivalent. If not multiple message use any zipping API to zip the multiple
files to zip file and send the zipped file in send port.
BizTalk Pipeline Custom Component Message Unzippper
Zip Files in a Custom Pipeline Component
Multi-Part Message Attachments Zipper Pipeline Component
BizTalk Multipart Message Attachments Zipper is a pipeline component
List of custom Pipeline component you can use
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
Unzip file using PayloadZipBean in Sender FILE adapter
I am trying to unzip a flat file in Sender FILE adapter using PayloadZipBean.
I am getting mapping error. The problem is File adapter is reading data without unzipping. I am getting weird characters/data, so mapping error.
I searched all the blogs/ forum threads and help.sap.com, everywhere the focus is on zipping, not unzipping.
the file I have is with .gz extension, but I tried with .zip extension also.
Please help in resolving this issue.
Edited by: Gopal Janagama on May 2, 2008 11:42 PMGopal,
GZIP and ZIP format are slightly different, as stated here :
"GZIP compresses only one file and does not have a header. ZIP contains header information about what files are contained in the file."
So I'm not sure the PayloadZipBean supports GZIP format ... Try to ungzip and then zip its content and see if the bean works for it
Rgds
Chris -
Problem with file zipping!
I have problem with my zip files. all that i need is a simple zipping of files. here's is what i am doing
//this mehod takes 2 arugments, first argument is the file which is to be zipped and the second argument is the name of the zip file
public void makeZIP(File fileToZip, String zfileName) throws IOException{
try{
byte[] buff = new byte[BUF_SIZE];//BUF_SIZE =128
int cnt=0;
FileInputStream swcConvFis = new FileInputStream(fileToZip);
ZipEntry swcConvZipEntry = new ZipEntry(zfileName);
ZipOutputStream swcConvZipOutputStream = new ZipOutputStream(swcConvFos);
swcConvZipOutputStream.putNextEntry(swcConvZipEntry);
while((cnt = swcConvFis.read(buff,0,BUF_SIZE)) != -1){
swcConvZipOutputStream.write(buff,0,cnt);
swcConvFis.close();
swcConvZipOutputStream.closeEntry();
}catch(NullPointerException npe){npe.printStackTrace();}
whis code is a part of the servlet code that has to send the zipped file to the applet. What's happening is i am able to zip the files. but when i try to open the zip file it gives me a an error window saying " cannot open file: it does not appear to be valid archive."
ofcourse the file is zipped on a linux machine and i am trying to open it in windows...it think this shouldn't be a problem though!!
please somebody throw some light on this. i have searched the archives but not helpful sofar.
thanks
srithe outputToApplet is the ObjectOutputStream object.
at the applet's reading end this is what i am doing
ObjectInputStream intputFromServlet = new ObjectInputStream(connect.getInputStream());
//code to read the output files from the servlet
byte[] buff = new byte[BUF_SIZE];
int cnt = 0;
ArrayList getOutputFilesFromServlet = (ArrayList) inputFromServlet.readObject(); // at the servlet end i am writing outputToApplet.writeObject(send2Files), send2Files is an ArrayList object that has one .txt file and another .zip file
System.out.println("total no.of files "+getOutputFilesFromServlet.size()); //shows 2
Iterator getOutputFilesFromServletIterator = getOutputFilesFromServlet.iterator();
while(getOutputFilesFromServletIterator.hasNext()){
File file = (File)getOutputFilesFromServletIterator.next();
String fname = file.getName();
System.out.println("received "+fname);//shows correct file names
try{
File nfile = new File(getOfile.getParent()+System.getProperty("file.separator")+fname);//puts the files in the requested directory on the client machine
FileOutputStream toFile = new FileOutputStream(nfile);
//reading the files uploaded by the applet
while( (cnt = dump.read( buff )) > -1 ){
if(cnt<BUF_SIZE){
toFile.write( buff, 0, cnt );
toFile.close();
break;
toFile.write( buff, 0, cnt );
}catch(Exception e){e.printStackTrace();}
System.out.println("finished reading all files from the servlet....");
}//while(it.next)
not only the zip file even the other text file is not downloaded properly....(i.e) it shows some junk characters instead of the actual file context. so maybe there is mistake in the way that i am reading the files...but what i am doing at applet's end is just a mirror reflection of what i am doing at the servlet's end. you got me!! hope i am not confusing!
any suggestions!! -
Condition check (based on sender file name) at receiver determination step
Hi,
My scenario is File to AS2 (Sender side file adapter and receiver side AS2 adapter)
We have 5 customers, but the source location is same to pick the files, Here we are not using any ESR objects.
Based on the source file name PI need to determine to whoom this file need to send at receiver determination step
Craeted objects
1 Sender CC,
1 Sender agreement,
1 Receiver determination
5 Interface determinations
5 Receiver agreements
5 Receiver CCs.
Could you please provide me your valuable inputs.
Thanks
RameshHi Venkataramesh,
I understand your scenario as, picking files (different file naming standard for different target customer) from one source folder. Based on file name, that payload should be sent to corresponding target customer. You have mentioned u201CHere we are not using any ESR objectsu201D. I can see two reasons for this decision
1. PI is used to route the messages, i.e., no need to transform the payload. OR
2. Files can binary files like PDF, ZIP, JPG, GIFu2026
Now I can see two possible solutions
1. Simple solution, as proposed by u201CPrabhu Rajesh Janardananu201D, make it into 5 different scenarios (5 sender channels).
2. Bit complex solution, only one sender channel, using extended receiver determination
Step 1:- In Sender File channel check u201CAdapter u2013 Specific Message Adapteru201D in Advanced tab. File Name should be checked.
Step 2:- In Receiver Determination, Select Type of Receiver Determination as u201CExtendedu201D. http://help.sap.com/saphelp_nwpi711/helpdata/en/48/ce2a423a8e5430e10000000a42189b/frameset.htm
Step 3:- Do a Graphical Mapping (use it Operation Mapping in Receiver Determination).
Step 4:-
Source and target of graphical mapping will be same (below), because you donu2019t want to access input payload (it can be XML, flat file, JGP, GIF and you donu2019t have its structure).
<Receivers>
<Receiver>
<Party agency="" scheme=""></Party>
<Service></Service>
</Receiver>
</Receivers>
Step 5:- Write a UDF in Graphical mapping as below. http://help.sap.com/saphelp_nwpi71/helpdata/EN/43/03612cdecc6e76e10000000a422035/frameset.htm Pay attention to method declaration
public String Determine_Receiver( Container container) throws StreamTransformationException
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);
String valueOld = conf.get(key);
//Put your logic here
if (valueOld.equal(u201Cuser1u201D)) {
return u201Cuser1u201D;}
if (valueOld.equal(u201Cuser2u201D)) {
return u201Cuser2u201D;}
if (valueOld.equal(u201Cuser3u201D)) {
return u201Cuser3u201D;}
Step 6: Now use this UDF to map to u201CReceiveru201D and u201C Serviceu201D.
This solution need more fine tuning.
Regards,
Raghu_Vamsee
Edited by: Raghu Vamsee on Jan 8, 2011 5:56 PM -
How to create Word file and send file in mail as an attachment
Hi Guys,
I want to create report which fetech data from table and create word file of the same data and send file in mail as an attachment.Hello Sagar,
Before posting please use GOOGLE,any way it may help u,
DivulgeSAP: Send email with PDF, ZIP, TXT etc., as attachment from CL_BCS interface
Thanks
Sam -
FTP Sender - file as attachment
Hi all,
I need to build a scenario where I have two files that needs to be picked up from ftp location.
One file needs to be attached as binary document to the second file (xml).
How can I achieve this?
We are using SAP PI 7.31.
Thanks in advance!Hi Tim,
Option1: You can consider the files as single zip file and then use payloadzipbean to unzip them in sender file adapter.
Option2: You can write an adapter module with similar functionality of "Specifying Additional Files"
Regards,
Praveen Gujjeti -
Sender file adapter has to zip the files and provide password protected for the zip. Can this be achieved using PI.
ThanksHi,
You have to use PayloadZipBean module of the XI Adapter Framework to meet your req.
You can go thru Stefan's blog on this thing :-
/people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
http://help.sap.com/saphelp_nw2004s/helpdata/en/45/da9358a1772e97e10000000a155369/frameset.htm
Also if ur req. is just to pick a file and zip it to post it to some place then u just have to follow the above blog for receiver file adapter configuration.
/people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository -
this blog will help u in the design part for the above scenario
hope its of some help to u
Regards,
Rohit -
I am recording some tunes that I want to send to another person who is mixing the completed songs for a cd. He needs the file on the basic or raw form and I do not how to do this. Any help will be appreciated. The files I have recorded have only two tracks, piano and trumpet.
if you used any loops, use Save As and Archive (same goes if you pasted in a region from another project)
once that's done, find the project, control click on it and select "Archive" (this is a different archive), you MUST do this. finally, send the .zip file that is created. if it's more than 10MB, most email servers won't handle it so you'll need to find an alt route like FTP or one of the web sites that will accept large files. -
when on ichat i cant share or send files to others why?
Mac OS X (10.4.7) MacBook intel Core Duo,Power Mac G5 QuadHello L A R E !
Sending files without zipping them first works for me.
What methods are you trying? There are several ways to send a file. In my testing with other iChat users, the most common technique to try first seems to be to drop a file into the text entry line in an iChat IM (text) window and then pressing the <<i>return> key. Occasionally that method fails.
When the text entry line method fails, try the methods recommended in your Mac's iChat > Help. I find that when dragging to the text input line fails, usually using the iChat > Buddies > Send File... method will not work either, but it does no harm to try.
When the menu command method fails, if you have an open video or audio chat window with the buddy to whom you want to send the file, you can drag the file and drop it in the open video or audio window. Note that iChat pauses AV transmission during file transfer to make the process faster.
Alternatively, try dragging the file and dropping it on the name in your Buddy List of the chat buddy to whom you want to send the file.
<hr width="85%">
Also consider that the problem may be at the receiving end of the file transfer. Does the problem occur with everyone, or only with a few of your buddies. If file transfer fails only with some of your contacts, ask them to be certain that they are clicking on the files to receive them. If those few buddies receive no indication that you are attempting to transfer files, ask them if they can receive files from anybody. Perhaps the problem lies within their systems.
<hr width="85%">
If none of those suggestions help you, consider possible issues within your system. Your system info shows that you are still using 10.4.7. Consider applying the 10.4.9 Combo Updater using the following method:- Backup your Home Folder, or at least, your important files.
- Repair permissions.
- Then download and apply the appropriate combo updater for your Mac:
Mac OS X 10.4.9 Combo Update (iNtel) or
Mac OS X 10.4.9 Combo Update (PPC)
- Finish with another Permissions Repair, and then try sending a file again.Users have reported fixes to a variety of audio, video, connectivity, and software conflicts and unreliability issues after properly applying Combo Updates.
<hr width="85%">
If your Mac checks out, your internet connection may be causing problems.
Do you have anything other than your computer (for example, VOIP, game, etc., that use the internet) connected to your internet connection? If so, disconnect everything except your compute, and try sending a file again. If it works with everything disconnected, you can try connecting one device at a time to test for which device is the source of your problem.
Alternatively, I note from your system info that you have two Macs. Do you use a router to create a LAN at your location? If you cannot transfer files from either Mac, your router may be the problem. Disconnect your router, connect your Mac directly to your modem via ethernet cable, and try again.
If your problem goes away whenever the router is disconnected, add the router back and test again. Try this test two or three times. If the problem returns every time the router is connected, your router is causing the problem. If you have another router (or can borrow one) you can test whether any router will work with your system.
<hr width="85%">
If the above suggestions do not resolve your problem, post back all available details about your system, internet connection, and testing results. We will try to offer more specific suggestions based on your response.
Jim
Mac OS X (10.4.9) G5 DP 1.8 External iSight -
FileName in Sender File Adapter Module
Hi Folks,
In my sender file adapter have written a module to read the picked file name. The protocol used is NFS.
Notice that the file name read in the module has the absolute path, including the directory path. E.g The file name xyz has to be picked from source directory
XIServer\Outbound. In the module when I retrieve the file name, it comes up as
XIServer\Outbound\xyz. Is this expected behaviour?
I was expecting just the file name<xyz> to be retrieved.
Thanks,
AnandHI,
Create an UDF and write this code.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key =
DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
in Adapter u will have Adapter specific parameters check the file name check box.
Using this UDF u will get the file name at target side.
Regards,
Phani. -
OS command before file processing in Sender File adapter
Hi there,
I'm having troubles running a os command from the sender file (NFS) adapter. The batch file which I try to run is not getting executed at all.
When I manually run the same batch file from the command prompt then it works perfectly.
The OS command looks like this from the adapter config:
myserver\xi\interface\in\dothis.bat
I have also try with this notation
G:\myserver\xi\interface\in\dothis.bat
Please give me some tips how can I solve this problem, is there any way how can I debug the OS command? When I look at the adapter monitonr no errors are showed.
Thanks for any tips.
RobertoHi all,
The problem is solved.
Issue: File Receiver Channel does not execute the OS Command before message processing.
Reason: XI always expects an input file (in my case the sender communication channel) on the source folder. If no input files are found then the rest of the adapter configuration is not executed at all.
In our scenario the OS command is responsible for retrieving the input files from a FTP server the adapter. SO XI will never trigger the OS Command.
Solution: Place a dummy input file on the source folder , the sender adapter will always read in this file and put it back on the same location.(e.g. using a condition in the receiver determination).
Thanks,
Roberto -
Advance select for source file in Sender File Adapter
Hi
I am trying to utilise the parameter 'Advance Selection for source file' on a sender file adapter to pick the file from multiple folders
My problem is that this parameter that is listed on the SAP help is not getting in File accessing Parameters.
I am running PI 7.02 (NW702_07_Rel)
Service pack 07
Has anyone come across this before?
any suggestions on how to do this?Hi,
In PI7.0 the property exists. I have used it previously. I think SP was 13.
Regards,
Nutan
Edited by: nutan champia on Nov 24, 2011 10:42 AM -
Mapping problem due to FCC in sender file adapter
Hi All
I am doing File( Flat File ) to RFC Scenario.it is working fine..
the problem comes in mapping with multiple records.
FCC at sender file adapter is used
my Data Type are :
Source DT Target RFC import parameter(table).
E2ED20* ITEM*
KEY VBELN
VBELN POSNR
E2E24* CHARG
KEY
POSNR
CHARG
<b>*->>multiple occurence
E2ED20 and E2E24 are 2 segment ,KEY is used in FCC to identify E2EDL20 & E2EDL24</b>
My source text file is like this :
E2EDL20 0200
E2EDL24 xyz
E2EDL20 0201
E2EDL24 abc
E2EDL24 efg
E2EDL24 mln
E2EDL20 0202
E2EDL24 gty
so the payload should be :
0200 xyz
0201 abc
0201 efg
0201 mln
0202 gty
in <i>FCC ignoer record set= true</i>
otherwise is not called...
i try to use split by value & use oneasmany , not helpfull.
in message mapping when i checked th field VBELN -> display queue
i am getting an array 0200
0201
0202 in white fields
thanks & regards
Ashutosh Rawat<b>Source payload</b>
<?xml version="1.0" encoding="utf-8" ?>
- <ns:MT_MATNO_FILE xmlns:ns="urn:abc:xxx">
- <E2ED20>
<KZ>E2EDL20</KZ>
<FIELD1>020</FIELD1>
<b><VBELN>0083662685</VBELN></b>
</E2ED20>
- <E2E24>
<KZ>E2EDL24</KZ>
<FIELD2>020</FIELD2>
<POSNR>900001</POSNR>
<CHARG>1078629</CHARG>
<LFIMG>3200</LFIMG>
<MEINS>PCE</MEINS>
</E2E24>
- <E2E24>
<KZ>E2EDL24</KZ>
<FIELD2>020</FIELD2>
<POSNR>900002</POSNR>
<CHARG>1078630</CHARG>
<LFIMG>1895</LFIMG>
<MEINS>PCE</MEINS>
</E2E24>
- <E2E24>
<KZ>E2EDL24</KZ>
<FIELD2>020</FIELD2>
<POSNR>900003</POSNR>
<CHARG>1079145</CHARG>
<LFIMG>1883</LFIMG>
<MEINS>PCE</MEINS>
</E2E24>
- <E2E24>
<KZ>E2EDL24</KZ>
<FIELD2>020</FIELD2>
<POSNR>900004</POSNR>
<CHARG>1079146</CHARG>
<LFIMG>3195</LFIMG>
<MEINS>PCE</MEINS>
</E2E24>
- <E2ED20>
<KZ>E2EDL20</KZ>
<FIELD1>020</FIELD1>
<b> <VBELN>0083662648</VBELN></b>
</E2ED20>
- <E2E24>
<KZ>E2EDL24</KZ>
<FIELD2>020</FIELD2>
<POSNR>900011</POSNR>
<CHARG>1001450</CHARG>
<LFIMG>2946</LFIMG>
<MEINS>8PC</MEINS>
</E2E24>
- <E2ED20>
<KZ>E2EDL20</KZ>
<FIELD1>020</FIELD1>
<b> <VBELN>0083673936</VBELN></b> </E2ED20>
- <E2E24>
<KZ>E2EDL24</KZ>
<FIELD2>020</FIELD2>
<POSNR>900012</POSNR>
<CHARG>1073953</CHARG>
<LFIMG>2458</LFIMG>
<MEINS>PCE</MEINS>
</E2E24>
</ns:MT_MATNO_FILE>
<b>at target what required is</b>
<item>
<b><VBELN>0083662685</VBELN></b>
<POSNR>900001</POSNR>
</item>
<item>
<b><VBELN>0083662685</VBELN></b>
<POSNR>900002</POSNR>
</item>
<item>
<b><VBELN>0083662685</VBELN></b>
<POSNR>900003</POSNR>
</item>
<item>
<b><VBELN>0083662685</VBELN></b>
<POSNR>900004</POSNR>
</item>
<item>
<b><VBELN>0083662648</VBELN></b>
<POSNR>900011</POSNR>
</item>
<item>
<b><VBELN>0083673936</VBELN></b>
<POSNR>900012</POSNR>
</item>
in Sender FCC
E2ED20.fieldFixedLengths 7,76
E2ED20.fieldNames KZ,VBELN
E2ED20.keyFieldValue E1EDL20
E2ED20.endSeparator 'nl'
E2E24.fieldFixedLengths 7,24,13,7,3
E2E24.keyFieldValue E1EDL24
E2E24.fieldNames KZ,POSNR,CHARG,LFIMG,MEINS
E2E24.endSeparator 'nl'
ignoreRecordsetName true
source file is already there...
Message was edited by:
ashutosh rawat -
Multiple Exclusion Criteria[Exclusion Mask] in Sender File Adapter
Hello All,
I have a requirement to specify multiple exclusion criteria in the 'Exclusion Mask' property of a Sender File Adapter, i.e. I need to pick up files that correspond to 111*.txt from a specified source directory, but I would also want to exclude specific individual files that go by the following names:-111ACC.txt, 111INV.txt & 111PUR.txt.
I have tried the following - Specified 111*.txt in the 'File Name' field and in the 'Exclusion Mask' field specified ACC, INV & PUR - the exclusion criteria separated by commas. But this does not seem to work. All the 111* files are getting picked up.
Have gone through a couple of weblogs that deal with exclusion masks, but they do not talk about multiple exclusion criteria.
Is there any other way I could accomplish this?
Thanks,
AnandHi,
Try this config.
Give *.txt in filename. and Directory as <YourDir>
In exclusion mask give 111ACC.txt
Below this there will be a table. Add two Entries
Dont add anything to FilenameMask.
Directory ->FileNameMask--->ExclusionMask
<yourDir>->--->111INV.txt
<YourDir>->--->111PUR.txt
Try this and get back.
Regards,
Sudharshan
Message was edited by:
Sudharshan Aravamudan
Maybe you are looking for
-
Unable to open .xslm file in Excel from Document Library
When selecting edit on an Excel Macro file opens Excel Web App, with the warning 'Data validation', 'VBA Project', ... click Cancel and open it in Excel, but nothing in SharePoint will allow document to open in Excel. Using the ribbon 'Edit Document'
-
Sending mails even after changing the rpd.
hi, i have successfully created the functionality of ibot, conditional ibot and chain ibot. i can see the report in the mails.and everything is working fine now. If i want oracle bi to send the mails (to let the ibot run ) even when i change the repo
-
SQL Server 2005: Multi-part identifier could not be bound
Hello, I use IBM WebSphere Portal and am desperately trying to move data from the default Cloudspace Database to MS SQL Server 2005, of course following the official guidelines. What happens is that WebSphere's Configuration Wizard fails because of a
-
Is it possible to run a dialog, change a control, and update an indicator simultaneously ? In the example code I would like to be able to change the control values and update the indicator while the dialog is open. When I select OK from the dialog
-
Migrating Regular Expression from apache to Java1.4
Did any one out there migrate from apache regular expressions to the new Java regular expressions? Are the two compatible? How much work is it to do this? What are the pitfalls? Are there any resources on this topic? Thanks,