Using variable in Payload Zip Bean

Hi to everyone, in my scenario I'm using receiver file adpater to create a zip file with payload and its attachment using Payload zip bean Module.
In the parameter Transform.ContentType I insert:text/xml;name = 'test.xml' for the payload and text/xml;name = 'test.txt' for the attachment.
I would zip theese files keeping their orinal file name, so is it possible to use the variable %filename% that contains the name of the message interface, or also the original file name?
Thank's in advance for your help.
Anassap_XI.

Hi,
Please check :
/people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework
You find more information about the PayloadZipBean in SAP note 965256.
*Pls: Reward points if helpful*
Regards,
Jyoti

Similar Messages

  • Payload Zip bean

    Hi All,
    Is it possible to use Payload Zip bean module in Receiver File Adapter with File Content Conversion option?
    Iam getting the below error when iam trying to enable the communication channel with with Message Protocol as FCC and using AF_Modules/PayloadZipBean bean together.
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 50, 4b, 3(:main:, row:1, col:3)(:main:, row=1, col=3) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 50, 4b, 3(:main:, row:1, col:3)': java.lang.Exception: Exception in XML Parser (format problem?):'com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 50, 4b, 3(:main:, row:1, col:3)(:main:, row=1, col=3) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 50, 4b, 3(:main:, row:1, col:3)'
    However when i run the same scenario with the below single options, the interface is working fine
    Message Protocol: File; Module:AF_Modules/PayloadZipBean -->Worksfine
    Message Protocol: File Content Conversion; Module: None -->works fine
    From the Audit Log data, it's showing that the channel is trying to zip the file first and then its trying to do the FCC (its erroring out at this stage) when enabling both Zipping and FCC functions together.
    Any idea's on how to enable both these options together??
    Thanks
    Pradeep

    Hi Pradeep,
    Yes u r correct that if u specify both the payloadXipBean and FCC, this problem will arise.
    The reason is that the sequence of processing of the inbound payload.
    So what i suggest is, in receiver communication channel please change the sequence of processing of adapter modules., once and check it.
    first put the File then the AF_Modules/PayloadZipBean.
    It will work,not a problem.
    If still problem exists pl do post the prblm.
    Babu

  • SOAP To File (Attachment swapping with Payload using Payload Swap Bean)

    Hi,
    I am working on the subject line. The scenario works well and good when I use the bean in Receiver File Communication Channel.
    The same bean configuration if I use on the sender SOAP the swapping of payload and attachment is not happening.
    Any Ideas.............
    Thanks,
    - Gujjeti.
    Edited by: Praveen Gujjeti on Feb 27, 2009 1:53 PM
    Edited by: Praveen Gujjeti on Feb 27, 2009 1:53 PM

    Hi Praveen,
    Clearly written in SAP help document :
    "SOAP sender Adapter does not support Moduls"
    so using Payload swipe bean is all van.
    Thanks
    Sunil Singh

  • Using Variable Substitution

    Hi Im new to XI and Im testing a simple file to file scenario by using Variable Substitution method.
    PFB the input payload of my scenario:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:INF94145_Emp_Input_MT xmlns:ns0="http://infosys.com/xi/projects/adidas/n2">
    - <Employee>
    - <Details>
      <Name>A</Name>
      <ID>1</ID>
      <Designation>SE</Designation>
      <Salary>123456</Salary>
      <DOJ>24-02-2008</DOJ>
      <Other />
    - <Address>
      <City>Asd</City>
      <ZIP>505001</ZIP>
      <Country>India</Country>
      </Address>
      </Details>
      </Employee>
    - <Employee>
    - <Details>
      <Name>B</Name>
      <ID>2</ID>
      <Designation>SE</Designation>
      <Salary>123456</Salary>
      <DOJ>24-02-2008</DOJ>
      <Other />
    - <Address>
      <City>Asd</City>
      <ZIP>505001</ZIP>
      <Country>India</Country>
      </Address>
      </Details>
      </Employee>
      </ns0:INF94145_Emp_Input_MT>
    I  used the variable substitution feature of Receiver File adapter to get the Output file name as one of the Field value from payload(Employee name in this case).
    Now my question is can I be able to get the output files based on employee names.i.e.,for two employee details I should get two out files and for n employee details I should get n output files.
    Can anyone tell how  the above scenario could be done.
    Thanks for your help.
    Regards,
    Prajwal

    Hi,
    I have used multi mapping and I tested the same and is working fine when I test in TEST tab present in mapping.
    My scenario is a file to file and also I used same fields in input and output DT(datatype) for understanding purpose.
    My input data type is as follows:
    - <ns1:INF94145_Emp_Input_MT xmlns:ns1="http://infosys.com/xi/projects/adidas/n2">
    - <Employee>
    - <Details>
      <Name>A</Name>
      <ID>1</ID>
      <Designation>qw</Designation>
      <Salary>122</Salary>
      <DOJ>2-22-2222</DOJ>
      <Other>asasa</Other>
    - <Address>
      <City>asdsada</City>
      <ZIP>12</ZIP>
      <Country>dsada</Country>
      </Address>
      </Details>
      </Employee>
    But when coming to END to END testing I'm getting an error in IE as follows:
    <SAP:Code area="MAPPING">GENERIC</SAP:Code>
      <SAP:P1>Split mapping created no messages</SAP:P1>
    Can anyone say what i have to do to overcome this problem.
    Thanks and regards,
    Prajwal

  • Error-Receiver File Adapter using Variable substitution when file is empty

    XI Experts,
    We are on PI 7.0, SP14.
    We are using variable subtitution to get the filename from source message. This works fine as long as we have data in the payload for filename element. But we have a scenario where we don't have to create file when certain condition does not exists in source message so in the message payload filename element will not exists in such condition and file will be empty and we should not create file.
    Parameter in the communication channel for Handling empty message is "Ignore".
    Does anyone knows how to handle this scneario. We don't want to default any file name in the message mapping if source file name element does not exists.
    We are following getting error in the Adapter engine.
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: file: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: file
    Thanks
    MP

    You can implement this by writing the module to throw an exception or whatever method you want to execute.
    If you don't want to receive an error message then module is suitable for you.
    Gaurav Jain

  • Filename extension in Payload Swap bean

    Hi Experts
    I have a scenario Proxy to FTPS , where I have to send an excel attachment. I have used payload swap bean in receiver channel and it is working fine as I am now able to see attachment in final destination folder however since the file name is coming from ECC and we are using dynamic configuration in PI to handle this. excel attachment is missing the extention .xls when it is being triggered from ECC and therefore in FTP folder file is getting generated but with no extention.
    I have added the extention .xls (as per the MIME header) in dynamic config and also tried to use concat function to achieve this extention to be added as final name of the file but when I did above adjustments I can see the correct name being generated in Main payload in SAP PI receiver channel monitoring but not in final destination folder, file still looks same as earlier (without any extention) , I believe since I am using payloadswapbean in module whatever I am getting in Mainpayload is being swapped by excel attachment values but not sure why the correct extention is not being shown up at final destination folders.
    Please suggest how can I get the correct file name in destination folder with the help of SAP PI, I know I can do this if ECC will add .xls in attachment name.

    Hi Mohit,
    I have tested the same scenario and it is working with PayloadSwapBean and DynamicConfiguration in the mapping and the file name correctly placed in the target.
    Receiver File CC:
    Dynamic Configuration:
    Target Directory:
    If your file name correctly set in dynamic configuration then the target file will be created correctly.
    Regards,
    Praveen.

  • Payload Swap bean not working

    Hi All,
    We are working on PI 7.11. We are trying to retrieve the attachments from the mails and convert them into files. We have enabled Keep Attachments in sender mail adapter. For swapping the payload we used payload swap bean. We referred the below blog
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    We are just trying with XML attachments.
    The problem now is the payloads are not swapping. The file contains only the body of the mail not the attachment. I dont know what I'm missing. Please advice
    Regards,
    Malini

    Hi abhishek,
    Please find below the config done in adapters
    1     localejbs/AF_Modules/PayloadSwapBean                          Local Enterprise Bean     1
    2     sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean     Local Enterprise Bean     mail
    1     swap.keyName     Content-Description
    1     swap.keyName     Content-Disposition
    1     swap.keyValue     MailAttachment-1
    1     swap.keyValue     attachment;filename="MailAttachment-1.xml"
    Regards,
    Malini

  • Payload Swap Bean in SFTP adapter

    Hi ,
    I want to use Payload Swap Bean in SFTP Receiver adapter. Please tell me the flow.
    Regards,
    Manigandan

    My Configuration in Adapter
    File names in message

  • FTPs connection error:When using Variable substitution for Directory path

    Hi
    I am transferring data from BI to xml file via PI: Here a Client proxy from BI sends the data to PI and the PI FTPs the XML file to a remote location. For FTP I am using FTPs SSL connection.
    It was working fine untill I used Variable susbstitution to determine Directory path dynamically. I am using this because different xml files are intended to goto the different locations.
    I did the variable substitution like this:
    Target Message Structure:
    ---> Target Directory: %var1%
    <?xml version="1.0" encoding="UTF-8" ?>
    <MT_BI_EXTRACT_FILE>
      <Header>
         <Directory>/Customer</Directory>
    </Header>
    <Detail>
    </Detail>
       </MT_BI_EXTRACT_FILE>
    And in the variable substitution I am doing it this way
    payload:MT_BI_EXTRACT_FILE,1,Header,1,Directory,1
    And the error I am getting is:
    Attempt to process file failed with Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
    MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
    Exception caught by adapter framework: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
    Delivery of the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Error when getting an FTP connection from connection pool: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure.
    Does anybody have some Idea of this ??
    Regards
    Naina

    Hi,
    I guess the problem is not with Variable Substitution..
    Error when getting an FTP connection from connection pool:
    So its a connection problem..
    Also check the option Disable Security check and try again...
    Try to check again if the interface is executing properly without Variable substitution and let us know..
    Babu
    Edited by: hlbabu123 on Jan 7, 2011 2:46 PM

  • Used variable substitution to substiture the field 'date' in file name

    Hi gurus
    I have used variable substitution to substiture the field 'date' (dd/MM/yyyy/hh/mm/ss) in the file name so when empty payload (a valid xml ) is generated by Message mapping then the communication channel is failing by showing the following error
    File processing failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during
    variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload
    : date
    As of now the business is not getting effected as the business scenarion needs only customer master data at the reciever side But when ever there is no custmer master data in the sourse side the message mapping is generating an empty payload and the communication channel is failing ( so it is an internal issue and is there any way which could solve the both (ie the business must not get effected and as well the communication channel must not fail)
    any coments on this will be higly apreciated
    thanks and regards
    sandeep

    Hi Sandeep -
    Yes If you use the Variable substitution from the payload , that perticular field has to be generated in the target structure.
    To handle this You can do the following:
    Sourcefield --->exists -> IfThenElse-->TargetField
    Where     SourceField>exists(node function)-> If
                   SourceField -
    >Then
                   CurrentDate(Date Function)----->Else
    Hope this will help !!
    Regards.
    Jeet.

  • Blank Lines at end of file when using Variable Substitution in File Adapter

    Hi all,
    I'm using variable substitution in a File Adapter, it's refers an element of message, like:
    filename    payload:MESSAGE_INTERFACE,1,FILENAME,1
    The variable substitution is working right, but it's append a BLANK LINE at end of file.
    Anyone knows how to solve this problem ?
    Thanks in advance.

    Hi Regis,
    I suppose you're using content conversion?
    if so try adding
    <b>endSeparator</b> = '0'
    to your last element
    this will delete the default line break at the end
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

  • File to file with out message mapping and using variable substitution

    Hi,
    Can any one send me a scenario where we can have file to file scenario with out message mapping and where i can use variable substitution.
    As of now i am using integrate configurations where i cant use variable substitution as the message does not reflect in integration engine. I need to populate time stamp between <filename><timestamp>.txt.pgp
    I am as of now using configuration scenario.
    The time stamp always writes before the last file extension.
    Let me know your thoughts?
    Thanks,
    Chandra.

    Hi Chandra,
    u can use the Variable substitution even without IR contents also(Mapping....).
    in the receiver communication channel just specify the path u want to access for a value...
    eg: filename                             payload:mt_name,1,records,1,name,1
    and in th file name give it as %filename%.txt... or vt ever ur requirement
    Babu

  • Different files using variable substitution

    Hi,
    I've one scenario in which I'll be getting information like below
    Cust_Data      1..1
    VKORG          0..unbounded
         KUNNR      1..1
         NAME1      0..1
         LAND1      0..1
    now I am supposed to create various files containing customer data containing kunnr, name1, land1 only for each of VKORG
    I've tried using variable substittuion, in which i've given follwing information
    File Name Scheme : Customer_for_%vkorg%.txt
    Variable name                    Reference
    vkorg                                  payload:Cust_Data,1,VKORG,1
    but by providing this information, I am getting only one file having all the customer records.
    So My question is:
    1. How do I create different files for each of different VKORG
    2. How do I place customer data only pertaining to that VKORG only.
    Thanks,

    Go for 1:n multi-mapping. For details, you can refer to /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible and /people/ranga.rajan2/blog/2010/03/17/multi-mapping-with-a-simple-scenario--fledgling-kit .
    Regards,
    Sunil Chandra

  • Passing variable in a method bean to JSP Page

    Hello Everyone,
    Can I Have a quick example of passing method variables from a java bean to a JSP page, (no forms involved)
    thanks

    Hello again,
    maybe I didn't explain my self correctly,
    I have a java program that read's from an external file. The program tokenizes the file (I use String Tokenizing). What I want is for the Tokenized string to display on a JSP page, How do I accomplish this?
    Below is a small fragment of my string Tokenizing program: Please I need help.
    package dev;
    import java.io.*;
    import java.util.*;
    public class RoundDetail2
    public static final String SUITS[] = {" ", "Clubs", "Hearts", "Spades", "Diamonds", "Joker", "FaceDown"};
    public static final String VALUES[] = {"Joker ","Ace", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
    public static final String SuitVALUES[] = {" ","1","2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14"};
    public RoundDetail2() throws FileNotFoundException
    DataInputStream inFile=
                 new DataInputStream(
                    new BufferedInputStream(
                   new FileInputStream("C:/apps/jakarta-tomcat-4.0.6/webapps/ROOT/WEB-INF/classes/dev/Data_452SY2.txt")));
              DataOutputStream outFile = new DataOutputStream(
                               new FileOutputStream("C:/apps/jakarta-tomcat-4.0.6/webapps/ROOT/dev/jsp/wager_history.jsp"));
              String readDetail_topLayer;
           try
                 while((readDetail_topLayer = inFile.readLine()) != null)
              StringTokenizer tokenizer_topLayer = new StringTokenizer(readDetail_topLayer,"\t");
                   while  (tokenizer_topLayer.hasMoreTokens())
                        String string_gameID = tokenizer_topLayer.nextToken();
                        String string_roundID = tokenizer_topLayer.nextToken();
                        String string_bet = tokenizer_topLayer.nextToken();
                        String string_win = tokenizer_topLayer.nextToken();     
                        String string_roundDetail = tokenizer_topLayer.nextToken();     
                        String string_date_time = tokenizer_topLayer.nextToken();
                        System.out.println ("test tab!" + string_gameID);

  • How to remove ":"  in file name while using Variable substution

    Hi ALL
    I am using  file adapter and I what to create file name dynamically by acesssing PO number and time stamp from the payload using variable substution.
    But the problem is I am getting ":" in time stamp field value and it is not acceptable for file name .
    So could you please tell me a way that I can remove this ":" from that particular field value and create the file name dynamically.
    Note 1)Add Time stamp option will not help me as we require a time stamp of particular zone.
    2) Dynamic Configuration code is also not use full as I am using 1:n file creation

    >
    Prasanna Kumar wrote:
    > Hi ALL
    >
    > I am using  file adapter and I what to create file name dynamically by acesssing PO number and time stamp from the payload using variable substution.
    > But the problem is I am getting ":" in time stamp field value and it is not acceptable for file name .
    > So could you please tell me a way that I can remove this ":" from that particular field value and create the file name dynamically.
    >
    > Note 1)Add Time stamp option will not help me as we require a time stamp of particular zone.
    > 2) Dynamic Configuration code is also not use full as I am using 1:n file creation
    does the time stamp with the ":" a part of your output file?
    else use a replaceAll function in your mapping and replace the : with empty string then use the value in the variable substitution
    Another option is use the normal BPM for 1: N message flow. The use a simple java mapping that will introduce a dynamic configuration and you can create the file name as you want. the java mapping will be used in the flow of messages from BPM to target system.
    ref: /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name

Maybe you are looking for

  • Battling Hardware MPE, Episode 2: Chunky Blurs

    Round Two of my hardware acceleration MPE tests... When using direct export with hardware MPE, any effect that renders a blurred alpha channel (Fast Blur, Gaussian Blur, etc.) creates an extremely ugly/chunky/unusable result. The source footage and s

  • Error Handling in Struts

    Hi all, I am using Struts framework in one of my projects. How do i implement Error handling using global Exceptions of config file? Now i am using a different method. But Still i can't catch all the errors Properly. Is it possible to handle all type

  • Can I direct connect FIOS service to a TV without any boxes or adapters?

    I just built a new small bedroom in my basement, and am about to buy a new 22" flat screen TV that will be hung on the wall. If the cabling is split with a bi-directional splitter, do I need to have another adapter in my house? I already have 2 of th

  • Adobe Premiere

    PC configuration: Windows 7 Professional Service Pack 1 Intel Core i7-4600U 8GB RAM 64-bit OS Adobe Premiere Pro CC 2014.2 Problem: As soon as I import a video (even 1MB) the app crashes. Please advise. Thank you.

  • Pages iPad Cut and Paste not working right in latest update

    First -- everything on my iPad is up to date with iOS and Pages update...and everything has been rebooted and works just fine... BUT -- new problem...anytime I select a paragraph and cut and paste, it places it in a text box, resizes it, and inserts