Comm Channel Variable Substitution - Use of wildcards to reference payload

Hi!
I am building a solution to write out tagged / XML IDOCs to a file adapter. I am using variable substitution to build the file name to include the message type, sending partner etc... in the target directory and filename.
Is there a way to wildcard nodes in the variable substitution? For example:
<i>Currently</i>
payload:WMMBID01,1,IDOC,1,EDI_DC40,1,RCVPRN,1
<i>Desired</i>
payload:*,1,IDOC,1,EDI_DC40,1,RCVPRN,1
where * is any wildcard.
Reason is that we have multiple IDOC types and I want to avoid having to create multiple communication channels.
Help appreciate and rewarded. Many thanks, Duncan.

Hi Duncan !
You can create the desired target filename and target directory by using dynamic configuration via java UDF in mapping. This allows you to create a target filename and/or directory based on a string..then you could use only one comm channel.
to access info:
// access dynamic configuration
      DynamicConfiguration conf = (DynamicConfiguration) param.get(
          StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","<b>FileName</b>");
      // read value
      String Filename = conf.get(KEY_FILENAME);
// to write value:
conf.put(KEY_FILENAME, "MyNewFileName");
Regards,
Matias

Similar Messages

  • Communication channel - Variable Substitution error,.

    Hi,
    I am having the following mesage type used in messag emapping as a target structure
    mt_data
       -> Variable1
    I am having a validation on mt_data node in message mapping for generating it, if condition is satisfied mt_data will be generetaed. Under mt_data i am having a variable. This variable is getting populated with some data using normal source to target mapping.
    I am using this variable in my communication channel as a variable substitution, and is used to replace file name.
    The issue I am facing is, when the mt_data fails to get generated (valid reason, since validation to generate it failed), communciation channel in RWB fails saying variable for substitution not found.
    Kindly advice.
    Thanks,
    Mudita

    The issue I am facing is, when the mt_data fails to get generated (valid reason, since validation to generate it failed), communciation channel in RWB fails saying variable for substitution not found.
    1) make a check on the variable in receiver determination itself...so that if fails then the message stops in Receiver determination itself....why to take it forward till channel and then fail.
    2) Make use of some constant term to fill the variable in the mapping if the validation fails.....this will help to put value in the variable even when the validation fails and the message does not fail in channel...filename created.
    You need to check with the functional people on how they want the message prcessing to occur when the variable cannot be created by the mapping logic.
    Regards,
    Abhishek.

  • Variable substitution using attribute

    hi,
    i want to use an attribute of an elemnet in variable substitution.
    i know how to use element in variable substitution and i know that i can use message header attributes
    in variable substitution, but if i create an element with an attribute how do i use it
    (or is there a simple way to map a value in message mapping to  message header attributes)?
    Thanks
    Tomer

    Hi
    Attribute is not supported for variable substitution.
    You can try setting values for the Dynamic configuration and use it
    SAP NetWeaver XI: Variable Substitution with Adapter-Specific Message Attributes via DynamicConfigurationBean
    Thanks
    Gaurav

  • 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 with variable substitution..

    Hi
    I am getting following error message for variable substitution
    *Message processing failed. 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: date_stamp: 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_stamp
      <?xml version="1.0" encoding="UTF-8" ?>
    - <I813_EModMCS_IB_MT>
    - <Records>
      <ModMod>111</ModMod>
      <DesModdcr>222</DesModdcr>
    - <Date_Stamp>
      <Date_Stamp>20080338</Date_Stamp>
      </Date_Stamp>
      </Records>
      </I813_EModMCS_IB_MT>
    date_stamp             payload:I813_EModMCS_IB_MT,1,Records,2,Date_Stamp,3,Date_Stamp,1
    Would appriciate if you can correct the variable substitution...
    Regards

    To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2
    The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (u201CExample Valueu201D) is set as the value for a specified variable.
    <?xml version="1.0" encoding="UTF-8" ?>
    <root>
      <dummy>
         <e1>
            <e2>Data_1</e2>
            <f/>
            <g attr="abc">text</g>
            <e2>Data_2</e2>
         </e1>
      </dummy>
      <e1>
         <e2>illegal/value</e2>
         <f/>
         <g attr="abc">text</g>
         <e2 attr="fghij">Example Value</e2>
      </e1>
    </root>
    Edited by: Progirl Progirl on Jul 17, 2008 8:04 AM

  • Issue with Variable Substitution

    Hi,
    We have a scenario where we need to use the data from Payload for further processcing of the messeges.The payload looks like the one given below.
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns1:MT_NOTIFICATION xmlns:ns1="http://WM_ERRHAND"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <PROXYRESPONSE>
      <STATUS>YES</STATUS>
      <NAMESPACE>WM_INVOICE</NAMESPACE>
      <INTERFACENAME>MI_INVOICE_MOORE_ACK_IN</INTERFACENAME>
      <PROXYNAME>ZXIII_MI_INVOICE_MOORE_ACK_IN</PROXYNAME>
      </PROXYRESPONSE>
      </ns1:MT_NOTIFICATION>
    In adapter, for variable substitution we have specified as below:
    payload:MT_NOTIFICATION,1,PROXYRESPONSE,1,NAMESPACE,1
    but getting an error "Message processing failed: Error during variable substitution: java.text.ParseException: Variable 'namespace' not found in variable substitution table"
    Is the variable that we have declared is right or is there anything we have missed out. Any helpful answers will be rewarded
    Thanks and regards,
    Ram.

    Hi Ram,
    The substitution looks fine.
    Did you read this,
    <i>To disable the check the adapter performs for the element data, set the Disable Security Checks indicator.
    Otherwise, the adapter checks whether the element data contains characters that could lead to security risks in the file system environment. The check includes the characters “/“, “\“, and “..“.</i>
    Try seleting this option and checking the same.
    Regards,
    Bhavesh

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

  • Which comm. channel is configured with a certain ftp server?

    Hi,
    i wold like to have a list of all comm.channels which are using a certain ftp server. How can i get this list

    i dont think we have any shortes way to find..by checking manually then only we can differentiate else if your company follwoing proper naming standards then they will create individual bussiness component for every FTP.
    Regards,
    Raj

  • Variable substitution in receiver comm channel idoc - file

    Hello all,
    I have a error message in mys sytem XI for creating a file because I would like a file name create dynamically and use an info in this idoc providing system SAP.
    And this variable substitution I put file name schema %var1% and variable substitution
    var1 payload:ZBBPIV01,1,IDOC,1,E1BIVHD,1,IV_ID,1 and I have this message error
    and I set Disable security checks in my communication channel
    <b><?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.MessagingException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1: 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: var1</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error></b>
    Thanks for your help

    Hi,
    <b>ZBBPIV01,1,IDOC,1,E1BIVHD,1,IV_ID,1</b>
    Check if the target XML Contains a Field called <b>IV_ID</b> and does it have any value?.
    Btter option is to use Adapter Specific Attributes and the code excert in this link,
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Regards
    Bhavesh

  • 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

  • Variable Substitution - How do I use a segment atribute ?

    Hi all, I'm facing a problem with variable substitution in receiver comunication channel.
    I got the follow message:
    <?xml version="1.0" encoding="UTF-8"?>
    <lote nro="000262007">
        <etc>...</etc>
    </lote>
    I want to get atribute <b>nro</b> from segment lote to use in variable substitution, how can I do it?

    Variable sucstitution doesnt allow a way to achieve this.
    There could be some workarounds
    1. Use some dummy element in ur xml message with same value as tht of the attribute.
    2. Use adapter specific message attributes or dynamic file name functionality
    Regards,
    Prateek

  • Variable Substitution in Communication Channel

    Hi,
    When doing variable substitution in the communication channel do I use my source or target message to create the reference?
    Thanks,
    Liesel

    always in the target...u can check with <a href="http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm</a>
    Message was edited by:
            Prabhu  S

  • Error while using the variable name "VARIABLE" in variable substitution

    Hi Experts,
      I am using variable substitution to have my output filename set as a payload field value. It is working fine when I am using the variable name as fname, subs etc but channel goes in error when I am using the variable name as "VARIABLE". This is probably a reserved word but i would like to know where i can find a detailed documentation on this. Say things to note / restrictions while using variable substitution.
    This is the error in the channel:
    Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: java.text.ParseException: Variable 'variable' not found in variable substitution table: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: java.text.ParseException: Variable 'variable' not found in variable substitution table
    Thanks,
    Diya

    Hi Zevik,
    Thanks for the reply. The output file is created correctly by merely changing the variable name to something else and hence the doubt.
    Below is the configuration:
    Variable Substituition
    VARIABLE    payload:interface_dummy,1,Recordset,1,Header,1,field1,1
    Filename schema : TEST_%VARIABLE%.txt
    Output xml structure:
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns:interface_dummy xmlns:ns="http://training.eu.unilever.com">
    - <ns:Recordset xmlns:ns="http://training.eu.unilever.com">
    - <Header>
      <identifier>HDR</identifier>
      <field1>001</field1>
      <field2>001</field2>
      <field3>R</field3>
      </Header>
    - <Detail>
      <identifier>A</identifier>
      <field1>000000002</field1>
      <field2 />
      <field3>Doretha.Walker</field3>
      </Detail>
    I thimk my configuration is correct as it is working correctly with the variable name change, However, maybe i missed something !

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

  • 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

Maybe you are looking for

  • Rotten at the Core

    Hi all, I think I've messed with some files, so my computer now is without my desktop image (instead it is of a full grey), and it is without menubar icons (such as wifi, bt, eject, spotlight etc). Probably Core Services are not being launched? Is th

  • Does movie download normally take a long time?

    Trying to download a movie but it take a long time (been 8 hours), not sure if it the wifi speed. Any insight?

  • Lightroom 2.1 & PSE 5 / batch conversion greyed out

    Hi, I'm running Windows XP Prof and have licensed LR2 and installed RC 2.1 on top of it. In PSE 5 the batch conversion entry in the file menu is now greyed out and even a de-/install of PSE 5 didn't help. I searched in LR & PSE forum and couldn't fin

  • Dynamic vlans

    can someone explain to me how dynamic vlans function on a stack of 3750s? i currently have dell equipment and the vlan assignments time out after 5 minutes and default to native setting. supposedly, the switch will see activity when a computer is in

  • ABEND RSBOLAP (000): error in class SAPMSSY1 method - after report move Pro

    Hi Guys, We recently moved a report to production and got the following error (500 Internal Error) when executing from Query designer ABEND RSBOLAP (000): Program error in class SAPMSSY1 method : UNCAUGHT_EXCEPTION   MSGV1: SAPMSSY1   MSGV3: UNCAUGHT