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

Similar Messages

  • Environment or system variables in PI Communication channel parameters

    Is it possible to use any of the system/environment variables in the PI Communication channel parameters ? Please point me to the documentation. I know I had seen it on SDN sometime but can't seem to be able to find the link.
    I am not interested in ASMA or variable substitution.
    Thank you,
    Sridhar

    I don't know anything other than Asma, DynamicConf, VariableSubs, etc...
    There're some system variables like "%f" or "%F" usable in FileAdapter channel (OS command box)

  • Config-time substitution of Communication Channel values

    I apologize in advance if this is explained elsewhere (or it's so blindingly obvious that nobody has asked). I promise I looked.
    NW04 SP17
    Is there a way to do parameter substitution on values defined in a communication channel template, based on the business system that the channel is going to be assigned to at config time?
    In case I got the terminology wrong, here's what I want to do. I have some CC templates defined for some SOAP services. In the template definition, I can add Target URL and SOAP Action attributes and assign a value to them that will be available on the config side later on. I want to use this template against a number of technical systems, each of which is going to have a different host portion of the Target URL.
    What I would like to have is a way for the CC template to have a 'generic' hostname that is substituted for at config time by the actual hostname of the business system that the channel is going to connect to.
    Is there a way to do that? Or is that a stupid question?

    Hi Michael,
    I think there is a way to do this, depending on the XI SP level.
    You might reference the following weblog, which uses the HTTP adapter as an example:
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    Then, in SAP Help, for JMS receiver config:
    http://help.sap.com/saphelp_nw04/helpdata/en/29/5bd93f130f9215e10000000a155106/frameset.htm
    Look under "Adapter-Specific Message Attributes" for JMS-specific parameters. 
    Regards,
    Bill

  • Variable Substitution at communicaiton channel

    Hi,
    Currently my file schema is
    TO%xi_output%.txt
    where xi_output refers to transfer order field.
    My client wants additionally warehouse number to be mentioned.
    should my file schema be like this
    TO%xi_whse%%xi_output%.txt
    or
    TO%xi_whse xi_output%.txt
    Please advise me in this regard where xi_whse refers to warehouse number
    Regards,
    B.Anandh

    Hi,
    see if this hlep:
    File Access Parameters
    &#9679;      Specify the Target Directory in which the documents are to be saved.
    You can enter variables for the target directory. The variables must be enclosed by % characters.
    c:/temp/local/%var1%
    If the adapter is to create the target directory if it does not already exist, select Create Target Directory.
    If the indicator is not set and the target directory does not already exist, the adapter returns an error.
    Specify the File Name Scheme that the system is to use to save the first incoming document.
    You can enter variables for the file name scheme. The variables must be enclosed by % characters.
    Regards
    Vijaya

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

  • 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

  • Using a variable in communication channel

    Hi,
    I have a lot of Communication Channels looking for files in the same directory. This directory's path will be changed soon and so I assume I'll have to change all my Communication Channels.
    I was wondering whether there was a means of using a variable for the Source Directory in order to just have to change its value where it is defined and not every where it is used...
    Regards
    Yann

    Hi,
    Is this a sender file adapter? or a receiver file adapter?
    You can make a change / make the receiver file adapter's directory dynamic by setting the value during runtime in the mapping.
    Use  this blog and the code in the blog to acheive this,
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Sender File adapter, I dont think this is possible.
    Regards,
    Bhavesh

  • Variable file name through Receiver mail Communication channel

    I need to send a file through receiver communication channel   with the following name ( YYMMDD schema)  . The YYMMDD is current date .  I know how to create these file names throug FCC ( file communication channel) , I tried in the same manner to create this file through Receiver Mail CC , but it did not work  .  If you have any ideas , can you please share with me ?
    ABC_MMYYDD.TXT
    Thanks.
    Ritvik

    Hi Ritvik,
    Also, Please look at this link and see if it helps you. It is generating variable file name through a UDF
    Re: Problem in dynamically file name generation procedure
    Best Regards

  • Variable Substitution in Receiver File Channel

    Hi All,
    Could you kindly help me with this?
    Mine is File to File Scenario. ECC drops a XML file in AL11 directory and i send that file using FTP to a third party system. There is no mapping involved and i use ICO. I need to get a value from the payload dynamically for using it in my file name.
    When i tried to use Variable Substitution Method i get this error : VariableDataSourceException: Caught SAXException while parsing XML payload: Content is not allowed in prolog.
    This is the reference i have given in my variable substitution : payload:customerelement,1,customer,1,sender,1,dealercode,1
    and my XML structure is as below and i am trying to access the dealercode field in the XML.
    <?xml version="1.0" encoding="UTF-8"?>
    -<ns0:CustomerElement xmlns:ns0="http://www.xxxxxx.com/customer">
    <recordCount>34</recordCount>
    <Customer>
    <Sender>
    <transmitDate>ddmmyy</transmitDate>
    <dealerCode>N050</dealerCode>
    <DMSSystem>ABC</DMSSystem>
    <DMSReleaseNumber>1.0</DMSReleaseNumber>
    </Sender>

    Hi Amit,
    Yeah that is correct. But in my case the XML structure was not properly formed and i hwas frequently getting this error " Content is not allowed in Prolog" for which i tried all the solutions in SDN and nothing worked out. So i had no other option and had to go for adapter module.
    Now the issue is solved and the interface is working as expected with the adapter module.
    Thanks for your valuable inputs.
    Regards,
    Prabhu V

  • 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 for Dynamic filename

    Hi All,
    my Scenario is Proxy to file. and the receiver file should be a zip file of extension .dat.gz.
    In mapping I tried as below. In signature I used one sender and two receiver messages.
    SENDER:                         RECEIVER:(2messages)
    MT_Product                       MT_Product
    -----Row                              ---------Row
    ---------field1                         -----------field1
    ---------field2                         -----------field2
    ---------field3                         -----------field3
                                             MT_Poduct_1
                                               --------field5  
    for field5 I mapped current date and I am trying to use it in Reciver file communication channel. will that be correct to use?
    In receiver communication channel the file name is Product_%field5%.zip I used
    and I used Module Configuration for content conversion and Zipping the file.
    In variable substitution I used field5 for dynamic date.
    field5-----------
    payload:Messages,1,Message2,1,MT_Product_1,1,field5,1
    Module Confuguration:
    Guys! am on right path????? will this be possible????

    Hello,
    Why you are using multimapping? Just for defining target file name using var substitution - BTW, that too is incorrect. You cannot use Messages/Message 1 nodes in variable substitution.
    Secondly, if I am not wrong the approach of defining dynamic zip file name using variable substitution won’t work because variable substitution will be executed once all the modules before standard call sap adapter gets executed. So during runtime, at var substitution step, ur file will actually be a text file instead of XML as a result u will get an exception.
    So, if there is no specific objective of using multimapping then simply use DC.
    Thanks
    Amit Srivastava

  • Variable being overwritten in the Variable Substitution (File Adapter)

    In the File adapter Receiver Communication Channel, I am using variable substitution.
    The problem is that the first variable I use (userid) is being overwritten by the second variable (filenumber). How can I fix this problem?
    File Name Scheme: %userid%_%filenumber%.xls
    Target XML:
    ============
    <?xml version="1.0" encoding="UTF-8"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
    <Worksheet ss:Name="FileName">
    <Table x:FullColumns="1" x:FullRows="1">
      <Row>
        <Cell><Data ss:Type="String">0209519</Data></Cell>
        <Cell><Data ss:Type="String">32226v2 v1.1</Data></Cell>
      </Row>
    Variable Substitution:
    =======================
    userid          payload:Workbook,1,Worksheet,1,Table,1,Row,1,Cell,1,Data,1
    filenumber    payload:Workbook,1,Worksheet,1,Table,1,Row,1,Cell,2,Data,1
    Expected Output:
    ==============
    0209519_32226v2 v1.1
    Actual Output:
    ============
    32226v2 v1.1_32226v2 v1.1
    Thanks for your help.

    Thank you for all your suggestions. I decided to modify my target XML and concantinate all the fields into one string so I don't have to worry about the variables being overwritten in the variable substitution.
    Target XML:
    ============
    <?xml version="1.0" encoding="UTF-8"?>
    <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">
    <Worksheet ss:Name="FileName">
    <Table x:FullColumns="1" x:FullRows="1">
    <Row>
    <Cell><Data ss:Type="String">0209519_32226v2 v1.1</Data></Cell>
    </Row>
    Variable Substitution:
    =======================
    filename payload:Workbook,1,Worksheet,1,Table,1,Row,1,Cell,1,Data,1
    Expected Output:
    ==============
    0209519_32226v2 v1.1
    Actual Output:
    ============
    0209519_32226v2 v1.1

  • Variable substitution in reciever file adapter

    will any one please help me in sloving this problem ,
    i have designed my reciever structure as shown in the below
    <RECORDSET>
          <HEADER>
               <NAME1/>
             <ADDRESS1/>
             <ADDRESS2/>
             <ADDRESS3/>
             <ADDRESS4/>
          </HEADER>
             <LINE>
             <QTY/>
             <UOM/>
             <UNIT_AMT/>
             </LINE>
       </RECORDSET>
       <FILENAME/>
    an i am using variable substitution
    variable name as filename
    reference         payload:MT_exxxxx_RECV,1,Filename,1
    i am getting a error in my message monitoring
    will anyone there to give me syntax for this

    Hi !
    I suggest to use Dynamic Configuration to assign the receiver filename using an UDF in graphical mapping. This little UDF can receive as input parameter the contents of the NAME field and write it to the specific tag in the header of the message, so the adapter will use that value as filename when writting the file on the receiver system, instead of variable sustitution.
    /people/sravya.talanki2/blog/2006/12/27/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-iii
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    Regards,
    Matias
    ps:please award points if helpful.

  • Sender_interface_name in Variable Substitution in Receiver File Adapter CC

    Hi,
    as per this page : http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/frameset.htm
    it says:
    Variable Substitution (Target Directory/File Name Scheme)
    If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.
    ●      Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.
    The variables can refer to attributes of the message header or elements of the message payload.
    ○       If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:
    sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace, message_id, message_id_hex
    Can we not access sender_interface_name and sender_interface_namespace are not mentioned in above list of variables.
    Is it not possible to access sender_interface_name or sender_interface_namespace as variable substitute parameters from within Receiver File Adapter Communication channel.
    thanks.

    >Shabarish Vijayakumar wrote:
    >>the sender interface details will always remain a constant
    >>so you can hard code the value, isnt it?
    Yes, i can hardcode, thats not a bad idea, i need to create then 3 different Reciever File Communication Channel objects, as I am dealing with 3 scenarios for which sender system and sender interface is different.
    >Shabarish Vijayakumar wrote:
    >>if you look at the mapping runtime constants, those are also for the receiver since the sender interface will always remain constant for any particular CC.
    >>http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/content.htm
    yes in this link you provided i can see..
    INTERFACE     Interface
    INTERFACE_NAMESPACE     InterfaceNamespace
    SENDER_SERVICE     SenderService
    RECEIVER_SERVICE ReceiverService
    RECEIVER_NAME     ReceiverName
    RECEIVER_NAMESPACE     ReceiverNamespace
    it seems both INTERFACE (,INTERFACE_NAMESPACE) and RECEIVER_NAME(,RECEIVER_NAMESPACE) are present, may be one is for sender, and another is for receiver.. may be if i use dynamic configuration, possibly my issue would be addressed.. correct me if i am wrong.
    thanks.

Maybe you are looking for