Use variable in mapping

Hi!
How to use Variable in mapping ? I've tried #PROJECT_CODE.VARIABLE_NAME but execution ends with an error "Illegal character"
With regards,
PsmakR

There is no need to use package name if variable is locate in the same package with the interace. Else (according with documentation):
Referring to variable MY_VAR in your objects should be done as follows:
• #MY_VAR: With this syntax, the variable must be in the same project as the object referring to it. Its value will be substituted. To avoid ambiguity, consider using fully qualified syntax by prefixing the variable name with the project code.
• #MY_PROJECT_CODE.MY_VAR: Using this syntax allows you to use variables across projects. It prevents ambiguity when 2 variables in different projects have the same name. The value of the variable will be substituted at runtime.
• #GLOBAL.MY_VAR: This syntax allows you to refer to a global variable. Its value will be substituted in your code. Refer to section Global Objects for details.
• Using “:” instead of “#”: You can use the variable as a SQL bind variable by prefixing it with a colon rather than a hash. However this syntax is subject to restrictions as it only applies to SQL DML statements.
And make sure you declare it in the package as was suggested in the previous post.

Similar Messages

  • 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

  • How to use Variable in interface for Mapping in ODI 11g

    Hi,
    I want to use Variable 'Year' in interface mapping. how i can do that? I define a variable YEAR1 = '2001' and in interface i put #YEAR1 but it didn't work for me. is there any other way?
    Example.
    I m using 'Year' column in mapping and it is having different 3 constant values so i was think to define 3 variable Year1= '2001' & Year2= '2005' & Year3= '2010'.
    In interface i just want to put variable name insted giving fix value.
    regards
    Sher

    Thank u
    I m trying with all the options & when i create Variable i and set Default value to ''2001'
    '#YEAR'
    #YEAR
    '#PROJECT_NAME.YEAR'
    #PROJECT_NAM.YEAR
    #PROJECT_NAME.'YEAR'
    and setting to Stagging Area
    But still it is not working out.
    I m suing ODI11.1.1.3
    is it any issue?

  • How to use Variable in message mapping

    Hi Experts,
    I have some problem using variable in message mapping.
    In one message mapping, since a block of logic is repeated for several fields, then i tried to use a variable instead.
    the repeated logic is: first if condition, then use a udf to form a queue which will be suppressed by its father node.
    i tried to assign the result queue to a variable after the UDF execution. (this variable is created after the father node)
    I am wondering is there any restriction of using variable?
    Can we assign the whole queue to a variable?
    Can we use UDF during the process of assigning value to variable?
    thanks in advance.

    I dont think you can assign a queue to a variable,I am not 100% sure, . and there is no restriction to useing a Zvariable, only u can use it after you declare at some parent level.
    Yes you can use a UDF in the process of assigning to a Zvariable.
    Check out this link and read the comments of the blog.
    SAP PI 7.1 Mapping Enhancements Series: Using Graphical Variable
    /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
    Edited by: Saiyog Gonsalves on Nov 6, 2010 6:40 PM

  • 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

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

  • 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

  • Problem with Multimapping using Variable Susbtitution

    Hi,
    I have done a Multi-Mapping where I have used variable substitution in the mapping
    The problem I am facing is that when my target message generates multiple messages the files are creating successfully on the FTP server but if only a
    single message generates on the target side then my message is successfully processed in IS but in adapter engine the message status is in "Waiting" state.
    When i see the audit log i found the following details:
    Time Stamp Status Description
    2007-09-18 06:10:24 Success The message was successfully received by the messaging system. Profile: XI URL: https://dx1-60.ra.rockwell.com:56001/MessagingSystem/receive/AFW/XI
    2007-09-18 06:10:24 Success Using connection AFW. Trying to put the message into the receive queue.
    2007-09-18 06:10:24 Success Message successfully put into the queue.
    2007-09-18 06:10:24 Success The message was successfully retrieved from the receive queue.
    2007-09-18 06:10:24 Success The message status set to DLNG.
    2007-09-18 06:10:24 Error Unable to find channel ID
    2007-09-18 06:10:24 Error Delivery of the message to the application using connection AFW failed, due to: Couldn't find delivery channel for message: 46ee0b73-f266-3794-e100-000082974e17.
    2007-09-18 06:10:24 Success The asynchronous message was successfully scheduled to be delivered at Tue Sep 18 06:15:24 GMT 2007.
    2007-09-18 06:10:24 Success The message status set to WAIT.
    2007-09-18 06:15:24 Success Retrying to deliver message to the application. Retry: 1
    Iam using SP14
    Can anyone help me to solve the above problem

    DATA: l_tabname TYPE tabname .
    DATA : gi_mara TYPE TABLE OF mara ,
           gi_makt TYPE TABLE OF makt .
    l_tabname = 'MARA' .
    DATA         : l_dref TYPE REF TO data.
    FIELD-SYMBOLS: <li_itab> TYPE ANY TABLE.
    CREATE DATA l_dref TYPE TABLE OF (l_tabname).
    ASSIGN l_dref->* TO <li_itab>  .
    *Define another field symbol and asign it to right internal table
    *here naming of internal table is important
    FIELD-SYMBOLS : <fs_tab> TYPE ANY TABLE .
    CONCATENATE 'GI_' l_tabname INTO l_tabname .
    ASSIGN (l_tabname) TO <fs_tab>.
    <fs_tab> = <li_itab> .

  • SAP PI: Using Variable Header  Binding in Receiver Mail Adapter

    Hello,
    I try to use Variable Header Bindings in the Receiver Mail Adapter. Therefore I wrote the following User-Defined-Function in a mapping:
    Java Function Start -
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/Mail",
        "XHeaderName1");
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/Mail",
        "XHeaderName2");
    DynamicConfigurationKey key3 = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/Mail",
        "XHeaderName3");
    conf.put(key1, new String("Test1"));
    conf.put(key2, new String("Test2"));
    conf.put(key3, new String("Test3"));
    Java Function End -
    As expected I see the Attributes and Parameters in the Dynamic Configuration in the SAP XI Monitor:
    Dynamic Configuration Informattion Start -
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Mapping der Request-Message
      -->
    - <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="XHeaderName3">Test3</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="XHeaderName2">Test2</SAP:Record>
      <SAP:Record namespace="http://sap.com/xi/XI/System/Mail" name="XHeaderName1">Test1</SAP:Record>
      </SAP:DynamicConfiguration>
    Dynamic Configuration Informattion End -
    Now I configure my Receiver eMail Communication Channel and set the Variable Header Fields as follows:
       Adapter Specific Attributes: Checked
       Variable Transport Binding: Checked
       Variable Header (XHeaderName1): TSender
       Variable Header (XHeaderName2): TReceiver
       Variable Header (XHeaderName3): TOther
    With this configuration I would have expected three new Header fields in the Header of the eMail, the reicever gets. But they are not there.
    When I set standard attributes like THeaderTO, THeaderSubject a.s.o this works fine and the values are also set accordingly. Where it the mistake here?
    The PI version we are working with is PI 7.0 SP10.
    Your help will be highly appreciated.
    Thank you,
    Steffen

    Hi Luciana,
    Honestly, I cant really remember how or if it was resolved and I was just helping out on the issue, but another consultant continued with it, so unfortunately I cant be any help on this.
    Good luck!
    Cheers,
    Brad

  • 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

  • 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

  • Using Variable in Web.xml/ Override value in web.xml

    Environment : JBOSS 4.2 / Web application in java/jsp
    *==============================================================*
    Iam using a servelet in application, and paremeters is configured in web.xml at run time I need to change the value. A variable
    see web.xml
    {color:#ff0000}<param-value>C:/FILE_ATTACHMENTS{color}</param-value>
    Instead of using a static folder name I need to use a variable, this veriable either i define in config.properties or ineed to pass through application
    Web.Xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="[http://java.sun.com/xml/ns/j2ee]" xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance]" xsi:schemaLocation="[http://java.sun.com/xml/ns/j2ee] [http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd]">
    <display-name>VyasaWeb</display-name>
    <servlet>
    <servlet-name>VyasaServlet</servlet-name>
    <servlet-class>com.jsos.download.VyasaServlet</servlet-class>
    <init-param>
    <param-name>dir</param-name>
    param-value>C:/FILE_ATTACHMENTS</param-value>
    </init-param>
    </servlet>
    <servlet-mapping>
    <servlet-name>VyasaServlet</servlet-name>
    <url-pattern>/servlet/VyasaServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    Is any way to use variable in web.xml or override the value ?
    Please help
    Vince
    Edited by: VINCEJOHNSON on Jul 30, 2010 3:30 PM

    If nothing else, why not just have your servlet load a configuration file on startup?

  • BPS ERROR I CREATE A NEW Manual Planning when a use variable in lead column

    Dear
    when a create a new manual planning have a message.
    Frist
    I create two variable one is Controlling Area other is Cost Element
    in planning area.
    next
    I a create a manual planning to make a report form.i create a
    manual planning layout category is key Figures and make Controlling
    Area and Cost Element as lead column in next continue setup lead
    columns tab.i set key figure and set Controlling Area and Cost Element
    to use variable above.and finish other tab.
    next
    i double click manual planning system give me a message
    The environment has changed; the layout can no longer be executed
    notes: i can insure Controlling Area and Cost Element is a single value
    and make sure both can mapping in cube
    by the way when i use fixed value this form will be run.
    Edited by: frank ju on Aug 6, 2009 11:13 AM

    Hi Everybody:
    I summarize the last post: In RoboHelp 7 for Word, the problem is that when I try to create a winhelp2000 project importing from a .hlp file of origin created previuosly, the import process makes error because it want to extract images that not exist on the .hlp file of origin. Thanks in advance for all the help that you can give me.
    Ismael.

  • Did Anybody Use The Graphics Map?

    Hi,
    I want to use the graphics map but the page test_gis_with_event.htm in GRAPH_BSP_TEST standard demo bsp application doesn't show anything. You can see the screen shots following URL.
    [http://img228.imageshack.us/i/graphicsmapbsp.jpg/|http://img228.imageshack.us/i/graphicsmapbsp.jpg/]
    Did anybody use the graphics map?
    Can somebody help me please?
    Thanks.

    Hi,
    this is an configuration error. Set an breakpoint in class cl_igs_data, method send at the funtion module
    PIGFARMDATA. The variable msg_text willc ontain something like 'ListenerRfc: unknown interpreter'.
    The IGS Connection has been not setup no or not in right way. let it check by your basis.
    Best regards, Stefan

  • Using variables to insert data in the table

    I want to insert datas in the table. I use constants,
    all the constants are stored properly in the table. But,
    when I use variables I get the error message
    "Too few parameters. expected 6".
    (I declared all the fields of the table as text only.)
    My program is "newt.jsp"
    <%@ page language="java" import="java.sql.*" %>
    <html>
    <head>
    <title>storing customer information in the database</title>
    </head>
    <body>
    <%
    String cno1 = request.getParameter("cno");
    String n1 = request.getParameter("n");
    String add11 = request.getParameter("add1");
    String add21 = request.getParameter("add2");
    String phone1 = request.getParameter("phone");
    String email1 = request.getParameter("email");
    Connection con = null;
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:customer"," "," ");
    Statement statement1 = con.createStatement();
    Statement statement2 = con.createStatement();
    statement2.executeUpdate("create table cust1 (cno varchar(20),n varchar(20),add1 varchar(20),add2 varchar(20),phone varchar(20),email varchar(20))");
    statement1.executeUpdate("insert into cust1 (cno,n,add1,add2,phone,email) values(cno1,n1,add11,add21,phone1,email1)");
    catch(SQLException sqle) {
    System.err.println(sqle.getMessage());
    catch(ClassNotFoundException cnfe) {
    System.err.println(cnfe.getMessage());
    catch(Exception e) {
    System.err.println(e.getMessage());
    finally {
         try {
         if(con!=null) {
              con.close();
    catch(SQLException sqle) {
    System.err.println(sqle.getMessage());
    %>
    <br><br>
    Mr./Ms. <%=n1 %> <br>
    Your datas have been stored.<br>
    </body>
    </html>
    Those who know answer please reply.
    My thanks in advance.

    I would expect your insert statement to be this:
    statement1.executeUpdate("insert into cust1 (cno,n,add1,add2,phone,email) values('"+cno1+"','"+n1+"','"+add11+"','"+add21+"','"+phone1+"','"+email1+"')");
    If you just create a string, it's not going to fill in variables into the string by magic.

Maybe you are looking for

  • Can i install a software in two imac?

    Hi All, I recently purchased a software FCE4 and I want to install it into 2 imac. For the first imac installation is no problem but I found that it can not be install in second imac. Is it possible to install a software into 2 imac? Please advance t

  • Grouping in main window

    Hi experts.. I am working on SCRIPTS. I am looping my internal table in main window to print fields of main window. my main window fields are-- box_id   pack_id  sales order  duty_code   box_wt. but one more field is there..ie DEST_CODE, its CHAR typ

  • To set up SS Native client

    Hi, I'm to set up Sql server 2008 Native client on Win 2012 server, but I did get this PS C:\Users\Administrator> choco install sql2008r2.nativeclient choco : The term 'choco' is not recognized as the name of a cmdlet, function, script file, or opera

  • To add order mgmnt in oracle crm ondemand

    is it possible to add order management in oracle crm ondemand? if it's could u pl tell me the steps involved mailid: [email protected] Edited by: user9005557 on Jan 19, 2010 4:31 AM

  • Problems with MicroPh

    I have went through support knowledgeBase several times but nothing has worked. First the problem was that the mp3 player stopped connecting to the computer. It happened several times before but it would usually start working again. Then it didn't. I