Nested substitution methods

Hello ,
Does anybody know what the problem might be:
This code is used to refresh a variable
--When i run this :
select
'<%=odiRef.getFlexFieldValue("1010", "300" , "USER_EMAIL" )%>' || ' - ' ||
'<%=odiRef.getUser( "I_USER" )%>'
from dual
--it works fine and the variable gets the value: [email protected] - 1010
--but when I run :
select
'<%=odiRef.getFlexFieldValue("odiRef.getUser( "I_USER" )", "300" , "USER_EMAIL" )%>'
from dual
-- i get :
BeanShell script error: Parse error at line 2, column 10. Encountered: ( BSF info: user_info at line: 0 column: columnNo
out.print("select \n'") ;
out.print(odiRef.getFlexFieldValue("odiRef.getUser( "I_USER" )", "300" , "USER_EMAIL" )) ;
out.print("' \nfrom dual") ;
****** ORIGINAL TEXT ******
select
'<%=odiRef.getFlexFieldValue("odiRef.getUser( "I_USER" )", "300" , "USER_EMAIL" )%>'
from dual
--or when I run:
select
'<%=odiRef.getFlexFieldValue(odiRef.getUser( "I_USER" ), "300" , "USER_EMAIL" )%>'
from dual
--I get:
The application script threw an exception: java.lang.NumberFormatException: For input string: "1010" BSF info: user_info at line: 0 column: columnNo
out.print("select \n'") ;
out.print(odiRef.getFlexFieldValue(odiRef.getUser( "I_USER" ), "300" , "USER_EMAIL" )) ;
out.print("' \nfrom dual") ;
****** ORIGINAL TEXT ******
select
'<%=odiRef.getFlexFieldValue(odiRef.getUser( "I_USER" ), "300" , "USER_EMAIL" )%>'
from dual
Does anybody know what is the correct syntax to use ?
Thanks
Eyal

Hello Gurusank,
Thanks for your reply.
What i'm tring to do is to send an email to the user that executs a scenario.
To do that I have created a flexfield for the object user. For each user this flexfields holds the user email.
First i tried :
*{color:#99cc00}&lt;%=odiRef.getFlexFieldValue("1010", "300" , "USER_EMAIL" )%&gt;{color}*
for user ID "1010" and it worked fine (I get the correct email)
the i tried:
*{color:#99cc00}&lt;%=odiRef.getUser( "I_USER" )%&gt;{color}*
This also works fine and return 1010 (which is the object ID of the current user)
But i wasnt able to combine the expressions
{color:#ff0000}*&lt;%=odiRef.getFlexFieldValue("odiRef.getUser( "I_USER" )", "300" , "USER_EMAIL" )%&gt;*{color}
Hope it helps to undestand my question
Eyal

Similar Messages

  • FileName using Variable Substitution Method

    Hi SAP experts,
    I need some advise regarding this.
    I have here sample structure of message,
    DT_Root  --> root node
      Tree  --> occurence is 1 to unbounded
        SubTree1
        SubTree2
        SubTree3
    What will be my File Content Conversion parameters to be set in Variable Substitution Method in order for me to get the value of SubTree3 and make it as my filename?
    Also, the value of SubTree3 must not be present on my actual payload..
    var1:payload,1,SLI,1   ---?? what if it is unbounded?
    Kindly advise.
    Thank you very much.

    Hi Raj,
    I cannot open the link.
    Anyway, is it ok if you will advise me regarding my question a while ago?
    I have here sample message structure,
    CSV --> Message Type
    SLI  --> 1 .. unbounded (occurence)
      subSLI1
      subSLI2
      subSLI3
    FileNode --> 1..1 (occurence)
      FileName --> 1..1
    Here's my parameters in Variable Substituion method,
    FileName Scheme: %var1%.csv
    var1   --  payload:CSV,1,FileNode,1,FileName,1
    File Content Conversion Parameters:
    Recordset Structure: SLI,FileNode
    SLI.addHeaderLine: 3
    SLI.headerLine: PERIO;EAN;ILN,....
    SLI.fieldFixedLengths: 8;10;13;...
    SLI.fixedLengthTooShortHandling: Cut
    SLI.fieldSeparator: ;
    SLI.endSeparator: 'nl'
    FileNode.fieldFixedLengths: 0
    FileNode.fixedLengthTooShortHandling: Cut
    I must the output flatfile with a value of the filename in the FileName field.
    And the content of the flatfile must look like this,'
    PERIO;EAN;ILN;SALES;TURNO;PERFL;SUBSFL;SALUN;%CURRENCY%;STOCK;STOUN;ARTNR;ARKTX
    20071020;737052020198 ;4333342000008;         1;        9.95;W;X;ST ;EUR;0000000000;ST ;                                  
    20071020;737052056852 ;4333342000008;         1;       14.50;W;X;ST ;EUR;0000000000;ST ;                                  
    20071020;737052073552 ;4333342000008;         1;       12.95;W;X;ST ;EUR;0000000000;ST ;                                  
    *each field has a fixed field length.
    Kindly advise if my set parameters are correct.
    Thank you very much!

  • Variable Substitution Method

    Hi,
    When Im going through the variable substitution method with respect to the target directory:
    with the help of the blog
    An interesting usage of Variable Substitution in XI
    I dint understand what is the SID here. SID of different systems like DEV system, PRD system and etc. What exactly is an SID?
    If we take SID as a variable in the variable substitution method, then the value to VAR will be getting from the header i.e, Receiver_Service.
    From where does the Receiver_Service gets the SID? whenever the system is changed from DEV to PRD or to someother.
    Kindly let me know if i can get any such other blogs on this scenario.
    Thanks in Advance,
    Divya

    Hi ,
    As said above Message header contains the following informations
    sender_party
    sender_service
    receiver_party
    receiver_service
    interface_name
    interface_namespace
    message_id
    message_id_hex
    SID stands for System ID and is a three character unique name for a SAP system. It will be different for different systems like for Dev system it may be XXX and for quality system say YYY and similarly for production system say ZZZ. Message header values are accessed dynamically.
    Thanks!

  • Substitution Method to get hostname(ODIServer)

    Any quick substitution method I can use to get the hostname of the server the Agent is running on? Im looking for the least impact possible, could set up a variable etc. but that would mean a lot of changes in my enviroment
    If I can do so with substitution method I can swipe the repos tables in one hit.
    Many thanks
    Alastair

    Hi,
    hoping to help you could use this workaround
    -create a flexfield on pysical agent
    -create a userfunction that decodes your agent name to its internal id
    -use in your interface
    <%=odiRef.getFlexFieldValue(myFunction(odiRef.getSession("AGENT_NAME"),"<AGENT_TYPE>","FLEX_HOSTNAME")%>
    I know it's quite twisted...

  • Substitution method ODI Username

    I'd like to know if there is a substitution method that retrieves the ODI User name?

    Please find the link for all substitutuin method which are available in odi.
    http://www.oracle.com/technology/products/oracle-data-integrator/10.1.3/htdocs/documentation/oracledi_api_reference.pdf
    Thanks
    Rajeev

  • Substitution method to get work rep name

    Hi all,
    what is the substitution method I need to use to get the work rep name.
    Thank you,
    K

    Hi Guru,
    Thank you for the reply.
    we can use the method <%=odiRef.getPrevStepLog("INSERT_COUNT")%> to get row count only for the previous step. I have a package here with almost 20 steps in it. I want to make sure none of these 20 steps have downloaded any records. Hence, I declared a variable and did a sum(NB_INS) from SNP_STEP_LOG for that particular session. And, I then evaluated if this variable is > 0. Any other better way of doing this? Thank you
    Regards,
    K

  • How to get Interface's Internal ID using substitution methods

    Do anyone have any idea, how can I get an Interface's internal ID. Is there any substitution method that I can use to get the ID.
    I want to use this ID in the steps of Knowledge Module (KM).

    But querying SNP_POP to get the ID in a refresh variable will force me to create a package. I can't afford to do that because my KM will be used in several interfaces and packages. So, I have to find all such packages and add this variable in all of them which is a tedious task.
    Anyways, thanks for your response!
    Edited by: Sheku08 on Apr 6, 2012 2:10 AM

  • Use substitution methods in variable

    Hi All,
    How do I use substitution methods in variable? For example, I am trying to get a session number in to a variable.
    I defined a variable and wrote the followign querry
    select <%=odiRef.getSession("SESS_NO")%> from dual.
    When I click on tick mark to check the syntax, it is throwing an error message saying missing expression. Please help me out. THank you!

    Put quotes around the substitution method:
    select '<%=odiRef.getSession("SESS_NO")%>' from dual
    You will not be able to "test" this, you can execute it, and see what the result comes back.

  • Additional condition check in the Substitution method...

    Hi All,
    We are using Substitution method to replace offsetting entry FRE with custom transaction key ZFR for all Finished goods for Purchase account active company codes.
    But our requirement is to replace FRE only when it is an off setting entry for FR1 (Freight cost). Could somebody help me in including this additional condition in the Substitution method?
    Thanks,
    Vamshi

    Hi
    can you let us know how you managed to replace FER with ZFR... This will help us in replying back to you
    br, Ajay M

  • Additional condition check in using Substitution method...

    Hi All,
    We are using Substitution method to replace offsetting entry FRE with custom transaction key ZFR for all Finished goods for Purchase account active company codes.
    But our requirement is to replace FRE only when it is an off setting entry for FR1 (Freight cost). Could somebody help me in including this additional condition in the Substitution method?
    Thanks,
    Vamshi

    Hi
    can you let us know how you managed to replace FER with ZFR... This will help us in replying back to you
    br, Ajay M

  • Panic.. with substitution method

    Hi all, I would like use substitution method to do a dynamic check, but I really don't know how to do that. This is my first serious approach with substitution method.
    What I want to do is the following:
    I would like to do an insert into a fixed table reading source numeric fields only aggregating those. my English is so bad, so i believe is better explain with an example.
    the fixed table is something like :
    CREATE TABLE te001_se_chk (
    d_ela DATE NOT NULL, -- elaboration date
    n_seq NUMBER NOT NULL, -- source table id
    n_src_row NUMBER(9,0) NULL,
    n_trg_row NUMBER(9,0) NULL,
    n_src_val_1 NUMBER(19,4) NULL,
    n_trg_val_1 NUMBER(19,4) NULL,
    n_src_val_2 NUMBER(19,4) NULL,
    n_trg_val_2 NUMBER(19,4) NULL,
    n_src_val_3 NUMBER(19,4) NULL,
    n_trg_val_3 NUMBER(19,4) NULL,
    c_res VARCHAR2(2) NULL,
    n_prg_se_chk NUMBER(5,0) NOT NULL
    I have to read source table (as400 file), find the first 3 numeric fields of the source table and valorize n_src_val_1 ,n_src_val_2 ,n_src_val_3 fields with a sum() aggregation, the n_src_row field will be filled with the count(*) of the source table.
    If source table has the following record inside:
    1,2,'a',3
    2,4,'b',6
    3,6,'c',9
    the n_src_row will be 3
    the n_src_val_1 will be 6
    the n_src_val_2 will be 12
    the n_src_val_1 will be 18
    If the source table as only 1 numeric fields I would like to fill n_src_val_1 field and n_src_row only.
    Is it possible to do that with procedure or customized KM? If yes, how can I do that ?
    Thanks

    With the example you gave, I thought- 1st, 2nd & 4th fields are the numeric fields.
    Is it possible that the numeric fields in a record could be scattered?
    To check numeric ness, you can use SQL Functions directly/indirectly, depending on- Which database engine you're using.
    For instance-
    if you're using SQL Server, you may use- IsNumeric. ISNUMERIC returns 1 when the input expression evaluates to a valid numeric data type; otherwise it returns 0.
    if you're using Oracle, select length(translate(trim(column_name),' +-.0123456789',' ')) from dual. This gives you a 0 if it's a numeric or >0 for non-numeric(actually gives the count of non numeric characters)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Substitution method to change the posting date in FB50

    Guys,
               My client requires the posting date to be blank in FB50. I used substitution method to do so, but its validating only after FB50 comes into picture. I want the posting date to be blank as soon as the transaction is entered. Did any one come acorss such situvation?
    Thanks in advance,
    Isaac

    Hi Smart,
    When your user is on FB50 screen, ask him to empty the posting date field and from the menu choose System -> User Profile -> Set Data (yes, you read it right, it is Data, not date - and date is also data!!!). That will save blank posting date in user parameters (SU3). Exit FB50 and re-enter. You will see that Posting Date is blank, but is also greyed out. Don't worry, enter Doc. Date and press 'Enter' key. It will open up Posting Date field as initial and your user can enter any date he wants, provided the posting period is open.

  • ODI substitution method in procedure

    Hi Gurus,
    I want to create an ODI procedure which will execute the code like
    delete from target_table where target_table.column in ( select some_other_table.column from some_other_table where some_condition )
    I want to use ODI substitution method for replacing target_table ,target_table.column ,some_other_table.column .
    Tried with getTable() Method , but it seems (to me) that it works only on KM and not on procedure .
    the following code returns error /exception "invalid table name specified "
    delete from <%=odiRef.getTargetTable("RES_NAME")%>
    By the way my source/target technology is Oracle.
    Where am I going wrong ?
    --Pujan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    can any one help me in this ?
    Observer the following
    In ODI package OdiOutFile , if I specify this command
    SELECT COUNT(1) FROM <%=odiRef.getObjectName("L","EMP","LOG_SRC","D")%>
    In the out file I get the correct command as SELECT COUNT(1) FROM SCOTT.EMP
    But if I specify the same command in a procedure then it is ruturning the following
    Description Tab : select count(1) from < % = odiRef.getObjectName("L","EMP","LOG_SRC","D") % >
    Execution Tab: 903 : 42000 : java.sql.SQLException: ORA-00903: invalid table name
    java.sql.SQLException: ORA-00903: invalid table name
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:503)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:535)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    --Pujan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • OdiRef Substitution Methods Documentation in ODI11G

    Hi
    I cannot find any explanation on OdiRef Substitution Methods in ODI11G documentation. Where I can find such help ? (I stiil use ODI10 documentation for substitution methods).
    Thans for your help

    Hope this helps you . http://download.oracle.com/docs/cd/E14571_01/integrate.1111/e12645/odiref_reference.htm#CIAJCAAB

  • Can substitution methods other than the Global be used in a procedure ?

    Hi All,
    I am very much new to ODI .Apologies if the question seems silly.
    As part of an exercise I am working with ODI variables and substitution methods.
    My question is substitution methods like odiRef.getColList,odiRef.getFrom,getTargetColList() used in KM's for Code Generation while executing an interface,
    can they be used in a ODI procedure giving the necessary parameters as they require .
    Eg : Command on source :
    select     
         <%=odiRef.getColList("", "[COL_NAME]", ",\n\t", "", "")%>
    from <%=odiRef.getObjectName( "TABLE_NAME" )%>
    Command on target :
    insert into <%=odiRef.getTable("L", "TABLE_NAME", "D")%>
         <%=odiRef.getColList("", "[CX_COL_NAME]", ",\n\t", "","")%>
    values
         <%=odiRef.getColList("", ":[CX_COL_NAME]", ",\n\t", "","")%>
    Ofcourse ,this is what an interface does but my requirement is to pass table name as variables and run this code iteratively to load targets,which again will be passed as variable.
    Will this run as a ODI procedure ?I tried and am getting exception errors.The getobjectName being global works fine with the proper table name generated in the code,but the getCollist does not work .Hence wanted to know if this standalone procedure is possible or will this code run only as part of KM over a interface?
    Thanks,

    Hi ,
    I had gone through this document,and from other sources also got a same answer that it cant be used.But is there a way it can be done?
    Actually we have many number of the small tables with just 10 records to be brought into the warehouse.The idea is to instead of doing it via an interface , why not try with a control table with an just the relevant entries and a procedure as above posted code.
    Some ideas would help.
    Thanks,

Maybe you are looking for

  • Older music/TV shows & videos purchased from iTunes store no longer work on PC (iTunes only)

    Hi, I am having trouble with iTunes on my Win PC and would like some help.  It clearly appears to be a software or configuration issue.  Essentially all my older music videos and TV shows all purchase from the iTunes store (anything older than 2012)

  • Created  a exe file, what do i need for it to run oanother computer

    I have made a exe file from a my java class, (don't know if it works cos it said something about not finding same file or another, but i ran ok). So I have the exe file, run exe, build exe. Do I need both of these?

  • How can I get rid of my work computer

    My home, laptop and work are all synced up to each other, but I am leaving my job and need to delete all things related to my personal .mac/isync account. I have already removed the computer from the syncing panel, but my other computers are still th

  • Sharing object with READ_COMMITED?

    Hi to all, I'm working on my first project using EJB 3.0 and I'm facing some difficulties. Long story short, I basically want to share an object across several (stateless and mdb) bean instances; the object is costly to build and for this reason I wo

  • Ipad3's ibook's pdf aren't synced to ipod touch 4g

    Hello there, I have the iPad 3 and I have the iCloud enabled. Everything in the first page of the iCloud control panel is checked So are Storage & Backup > Manage Storage > My iPad >  Backup Options >> iBooks all turned ON Same thing with my iPod Tou