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

Similar Messages

  • White lines generateds in a File Adapter when using variable substitution.

    Hi all,
    I have been a problem in File generated by XI, my File Adapter is using variable substitution with reference to a field of my message type. Because it, the files generated has white lines in top of file.
    What can I do to not apears these lines ?
    Thanks

    Regis,
    Try to give a more detailed description of your problem otherwise I don't know who's gonna answer...
    Alexx

  • 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.

  • Reciever File Adapter - Temp File Name Scheme using Variable Substitution

    How can I create a temporary file that uses variable substitution? 
    We are having a problem with files merging when we write files using the "Use Temporary File" setting on the FIle Adapter.  So two independent files are merging into a single file.  We are not using the "Append" setting.
    We would like to use a Temp File Name Scheme that would append the message id onto the temporary file name. 
    Using variable substitution we created a msgid variable.  When added to the temporary file name using %msgid% the temporary file name is created with %msgid% in the name instead of the actual message id.  We put the variable into the "File Name Scheme" as well and the end completed file used the message id in the name.
    Any Ideas?
    Thanks,
    Matt

    HI Matthew,
    Why are you adding the message id into the temporary file??
    I understand that you want the output of the filename to contain message id .. and hence you are using variable substitution for the same.
    Temporary file name will anyways get overwritten by the actual file name (here the actual filename will be using variable substituion).
    So i suggest to achieve your scenario you can add any name in the temporary file and maintain the desired filename you require as output in the variable subsititution.
    Temporary File Name option actually acts as a lock - unlock mechanism from PI side while the file is getting written to the file server so that while PI is writting the file no third party application batch program picks it up.
    I hope this helps.
    Cheers
    Dhwani

  • 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

  • White lines generated in a txt File when using variable substitution

    Hello,
    I have a problem with a File generated by XI, my File Adapter is using variable substitution with reference to a field of my message type. I use content conversion as well and the generated file has a white line in top of file.
    How could I avoid this and make the white lines disappear? I was trying a lot of things but I don’t really know how to solve this issue, the following is the data type used:
    <FILE_NAME></FILE_NAME>
    <COMPANY>
         <COMPANY_CODE></COMPANY_CODE>
         <COMPANY_NAME></COMPANY_NAME>
         <ADRESS></ADRESS>
    </COMPANY>
    FILE_NAME is the field I use for variable substitution and COMPANY is declare as 0..unbounded.
    Thanks a lot in advanced,
    Luis

    Hi Jai,
    I have declare the following Content Conversion parameters:
    Recordset Structure: COMPANY
    FILE_NAME.fieldFixedLengths     0
    FILE_NAME.fixedLengthTooShortHandling     cut
    COMPANY.fieldFixedLengths     10,80,10,2,50,30,5,5,2,50,50
    COMPANY.addHeaderLine     0
    COMPANY.endSeparator     'nl'
    But it does not work, I have the same white line in the beginning of the file. Do you have any other suggestion??
    I couldnt find the blog written by Sravya either, could you post the link?
    Thanks a lot,
    Luis

  • Receiver File Adapter:Variable substitution :FATAL  ERROR

    HI all
    as per the previous thread :
    <b>Receiver File Name Variable Substitution :payload: Fatal Error
    in our idoc to file sceanrio, we are using simple <b>graphical mapping.</b>
    for dynamic file name , variable field is at <b>Target message type</b>,So  on using <b>Variable substitution</b>, again the error is same :
    SAXException while parsing XML payload: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) .
    <b>Our XI  Component version : 2004
    WAS 6.4 SP 15</b>
    Thanks
    AR

    Ashutosh,
       There is nothing to do with your mapping programs. Its the mistake in ur reciever file adapter configuration for variable substitution.I asked u whether u changed message mapping in order to implement the UDF!!
    Did u tried checking the audit log. Ok just to see where u are going wrong, instead of using Payload :... in Variable substitution use Message:..... and give some interface name so that to check whether the file is created with Interface name.
    Juz give a try!!!
    Best regards
    raj.

  • 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

  • File adapter - Variable Substitution

    Hi all,
    I’m trying to use Variable Substitution functionality in my receiver file adapter. The objective is: During process message XI read the payload of an xml message and picks the value of tag <ORIGEM> coming with the File Name and do the substitution of File Name Schema of receiver file adapter.
    This is what I have donned in the configuration of receiver file adapter:
    File Name Schema: <b>R3%var1%.xml</b> (file construction mode: Add Time Stamp)
    Variable Substitution: <b>Enable</b>
    Variable name: <b>var1</b>     
    Reference: <b>payload:nr1:IfContabilizacao_Source_Log,1,INFO_CONTROLO,1,ORIGEM,1</b>
    The XML Message:
    <?xml version="1.0" encoding="utf-8"?>
      <nr1:IfContabilizacao_Source_Log
    xmlns:nr1="http://xi/XI/InterfaceContabilistico">
        <INFO_CONTROLO>
          <ORIGEM>TESTE</ORIGEM>
          <DESTINO>This is a string 2</DESTINO>
          <IDENTIFICACAO>This is a string 3</IDENTIFICACAO>
          <DATA>1999-01-24</DATA>
          <VERSAO>This is a string 4</VERSAO>
        </INFO_CONTROLO>
        <INFO_DADOS>
          <HEADER_DOCUMENTO>
            <BLDAT>1999-01-24</BLDAT>
            <BLART>C</BLART>
            <BUKRS>C</BUKRS>
            <BUDAT>1999-01-24</BUDAT>
        </INFO_DADOS>
      </nr1:IfContabilizacao_Source_Log>
    When I execute the process both sxmb_moni flags are ok! But in the adapter monitoring I receive this error message:
    2005-12-20 10:51:25 WET: Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1
    Var1 is the name that I have defined in variable name! Is wrong? Anybody see something wrong in this configuration or something in reference payload of  tags hierarchy… I think that I have checked all…
    Thanks in advance,
    Ricardo.

    Renjith,
    Adapter monitoring continues with this error mesage: VariableDataSourceException: The following variable was not found in the message payload: var1
    This error means that the reference showed bellow have something wrong! But I can't see where is the error!!!
    payload:IfContabilizacao_Source_Log,1,INFO_CONTROLO,1,ORIGEM,1
    Anybody see where is the error of my reference, or any other idea?
    Thanks in advance,
    Ricardo.
    Message was edited by: Ricardo  Quintino

  • PI File Adapter variable substitution

    Hi everybody,
    I do have the following message:
    <?xml version="1.0" encoding="utf-8"?>
    <ns:MT_FileIn_Budget xmlns:ns="urn:rlp.de:test:budgeting">
         <BudgetRecord>
              <Monat>Pa</Monat>
              <Jahr>b_Lie</Jahr>
                                               ................. etc.
    I want to extract the "Monat"  variable in the Receiver File Adapter as a substitution variable in the "Advanced" Tab  in the
    Receiver File Adapter configuration.
    I have the following value in the Substitution table :
    var1     payload:BudgetRecord,1,Monat,1
    (and then use var1 in the filename)
    If I use Header Mapping instead , everythings works.
    Any ideas? something misspelled?
    cheers hs

    Hi Michael,
    maybe you can clarify a better solution for my problem:
    The reason why I am using variable substitution is, that I am not using graphical mapping here.
    I am using a XSLT style sheet translation (PI 7.11) as a mapping step. 
    I need to set the file name depending on the operation mapping.
    For every specific situation (about 10) , there is one OM. This OM (XSLT, no SAP Graphical Mapping) should set a specfic filename.  for every specific situation there is an integration scenario with the specific OM.
    The Business Component with one comm channel should only be there once (we don't want 10 communication channels)
    Do you have a recommendation ?
    thx
    hs

  • Retrieve the message put in message header using variable substitution

    hi,
    i am using dynamic configuration to put some information in the message header.is it possible to retrieve the message using variable substitution and if it is possible then how it be done using variable substitution.
    regards,
    Meenakshi

    Variable Substitution does not allow you to read all the messaeg header elements only some of them can be read/ access....for more info on how to read the message header elements refer: /people/jin.shin/blog/2007/04/27/sap-netweaver-xi-variable-substitution-with-adapter-specific-message-attributes-via-dynamicconfigurationbean
    From the above blog:
    When using Variable Substitution, only certain standard message header attributes can be used/accessed (e.g. sender_party,
    sender_service, receiver_party, receiver_service, interface_name, interface_namespace, message_id)
    Better use Dynamic Configuration to read the parameters.
    I am wondering why you need to read the message header parameters when you are putting them using Dynamic Configuration.....cant you just get the details from the dynamic configuration UDF itself?
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Dec 10, 2009 1:18 PM

  • ORA-04054 : using variable substitution for the database link name

    Hi,
    I need to use variable substitution for the database link name.
    Here is my command :
    declare
    GET VARCHAR2(50);
    begin
    select OIA_GET_DESIGNATION into GET from INFODRI.OMA_IN_ARTICLES;
    for rec in (select * from [email protected]_GET_DESIGNATION)
    LOOP
    dbms_output.put_line('TEN_CODE vaut : '||rec.ten_code);
    END LOOP;
    exception
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERREUR ORACLE DETECTEE : '||rec.OIR_CUR);
    DBMS_OUTPUT.PUT_LINE('Message Erreur : '||SUBSTR(SQLERRM,1,245));
    :crd := -1;
    end;
    When I run this programm, I receive the error :
    ORA-04054: database link REC.OIA_GET_DESIGNATION does not exist
    When I replace :
    for rec in (select * from [email protected]_GET_DESIGNATION)
    by :
    for rec in (execute immediate 'select * from tensions@'||rec.OIA_GET_DESIGNATION)
    I receive the error :
    PLS-00103 : Encountered the symbol "IMMEDIATE" while parsing.
    What can I do to resolv my problem ?
    Regards,
    Rachel

    What is the name of the DB Link and the name of the object you are selecting
    from?
    I find it easier to create a view on the remote object then use that in selects.
    e.g,
    Link Name = MyLink
    Object_name = Addr_Loc
    create or replace VIEW Rem_Addr_Loc AS
    select * from addr_loc@mylink;
    In the code I then use the view
    begin
      for C_Rec in (select * from Rem_Addr_loc)
      loop
         dbms_output.put_line('Rec: '|| C_Rec.Col1);
      end loop;
    end;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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

  • 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

Maybe you are looking for

  • How to store smartform in the table TOA03 so that it can be archived later.

    Hi Friends, i have a very urgent requirement i.e to store the complete smartform in the link table TOA03 so that it can be archived later i.e it can be printed later. At present what i am doing is i am passing the parameters ARC_PARAMS and ARCHIVE_IN

  • Trying to watch videos from my mac

    i downloaded the newest flash player to my mac & is still unable to watch videos

  • Connection issue after XI R2 - XI R3.1 upgrade.

    Hi, I am receiving the 'Connection or SQL sentence error: (DA0005)'  Exception: DBD, [NCR][ODBC Teradta Driver] Not enough information to logonState: 28000.  This error causes reports refreshes to fail in Deski XIR3.1 and in Infoview refreshing.  How

  • How is added this clause to  a standard VO query... ?

    Hi friends, [AppsR12] I've seen a peculiar behaviour while executing a LOV query: Standard LOV query is: select class_code, description, class_code||' - '||description display ,CLASS_CATEGORY, START_DATE_ACTIVE, END_DATE_ACTIVE from pa_class_codes wh

  • Pick Slip Sequence

    We are using the Apps 11.5.5 Trying to set the Picking slip number to start at a specific number and then increase at each pick slip. Our Setups : OM: Shipping > Setup > Documents > Document Sequences and create a sequence name = Pick slip, the Appli