Assigning a Jython variable value to an ODI variable

I have to implement database cursor functionality in ODI.
For storing the returned values from database, I am using a Jython list.
The next functionality that I have to implement is as follows:
(i) For each value in the Jython list, I have to pass that value as a variable to an interface and then execute the interface
(ii) Return back to the Jython list to get the next value in it
(iii) Execute the interface for the new value from Jython list
(iv) Have to execute the interface for as many values as in the list and stop when list is over.

Hi,
Thanks for your replies.
I tried your method of using source as a query in procedure and using ODI startScen in the Target of the same procedure. But the scenario runs only once, and then stops even though the Source query returns 4 rows.
Do we have to write Source and Target in separate steps of the procedure?
Does ODI store the many records returned into some internal variables?
I need to implement a cursor functionality so what is the best approach?
Can i pass array variable value to some odi variables and do a loop?
I used a workaround....it works but dont know if that's a good way of doing things:
I retrieved all the different values that I need in a string by appending the values(this was done using Java loop).
In my next step in the procedure I call a scenario(package which has some variables and my interface), which passes this long variable from Java as <@...@>
Then in the package I use an iteration variable which is used to find out the SubString position so that I can extract the correct string to use for my Interface in the next step of the Package.
It is working fine as of now.....but things could be made simpler if I could call the scenario in the Java loop, then I wouldn't need the iteration variable etc.

Similar Messages

  • Assign a Javascript variable value to a ABAP variable

    Hi,
       I wish to assign a javascript variable value to  a ABAP variable. Any ideas how to do that?
        Many thanks.
    Rgds,
    Bernice

    Here's another suggestion for you.
    BSP Application: SBSPEXT_HTMLB
    Check out the radionbuttongroup.bsp
    So then instead of using a standard HTML radio buttons you can use the HTMLB element with the parameter for onClick set then in your DO_HANDLE_EVENT you can read the value.
    VIEW
    <htmlb:radioButtonGroup id="radio">
      <htmlb:radioButton id="id_link"
                       text="Link"
                    onClick="myClickHandler"/>
      <htmlb:radioButton id="id_unlink"
                       text="Unlink"
                    onClick="myClickHandler"/>
    </htmlb:radioButtonGroup>
    DO_HANDLE_EVENT
      DATA:   lt_event        TYPE REF TO if_htmlb_data.
      lt_event = cl_htmlb_manager=>get_event_ex( request ).
      if lt_event IS NOT INITIAL.
        if  lt_event->event_name = htmlb_events=>radiobutton.
           case lt_event->event_id.
            when 'control_id_link'.
              schalter = ' '..
            when 'control_id_unlink'.
              schalter = '1'.
           endcase.
        endif.
      endif.
    There is an example of how to use it and read it in the DO_HANDLE_EVENT you then just have to pass the variable around (in this example the variable name is schalter and is defined as char1 in the class)

  • How to assign list of default value for select-option variable???

    Hi every one
    This is Deepak,
    I want to know how to assign list of default value to select-option variable ? please any body tel me solution
    for example
    select-option matnr for mara-matnr default ..............and here i want to give more than 1 values that will be default value and use can choose any one at the time of input .
    Thank you in advance
    Deepak

    Hi.
    Check the following sample code.
    REPORT ztn_test.
    " It is example for list populating.
    TABLES:knvp.
    data: BEGIN OF itab OCCURS 10,
          kunnr like knvp-kunnr,
          END OF itab.
    data: wa_itab like itab.
    TYPE-POOLS: vrm.
    DATA: name TYPE vrm_id,
    list TYPE vrm_values,
    value LIKE LINE OF list.
    PARAMETERS: s_kunnr(20) type c  as LISTBOX VISIBLE LENGTH 40 .
    AT SELECTION-SCREEN OUTPUT.
    SELECT kunnr from knvp  into  CORRESPONDING FIELDS OF TABLE itab WHERE parvw = 'SP'. " SP for ur requirement
    " I have used loop to populate some values from table
    loop at itab into wa_itab.
      name = 'S_KUNNR'.
      value-key = sy-tabix.
      value-text = wa_itab-kunnr.
      append value to list.
      clear wa_itab.
    endloop.
    " If u want individaully assign the values change the code as
    name = 'S_KUNNR'." Select option name
      value-key = 1." Index
      value-text = 'VAL1'.
      append value to list.
    name = 'S_KUNNR'." Select option name
      value-key = 2." Index
      value-text = 'VAL2'.
      append value to list.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING id = name
    values = list.
    Edited by: tahir naqqash on Feb 21, 2009 4:38 PM

  • How to assign ODI Proc out parameter value to an ODI variable

    hi,
    Can someone kindly help me on assigning ODI Procedure's output parametr to an ODI variable.
    My ODI Proc is:
    proc p_name (e_code varchar2(100), o_num number(50))
    is
    type tab_e is table of xxx%rowtype index by varchar2(100);
    l_tab_type tab_e;
    begin
    select e_no into o_num from xxx where e_name=e_code;
    next 2 steps to populate table type variable
    Step1
    step28/
    end;
    i want to store the value of o_num in an ODI variable so that I can use that in a ODi package to evaluate its value and change the flow.
    Now i tried to include the above code in ODi proc , but its showing error while executing it .
    'Invalid SQL statement'.
    Kindly advice or help on this issue.
    Thanks,
    Hema

    Hellow,
    I am new to ODI.
    I ahve a data base query which returns more than one rows. Each row has more than one column.I wanted to assign these values to a variable . Finally this varibale values i wanted to write into a file in a package. What steps i need to follow to achieve this.
    Regards,
    Ranjan
    Edited by: user12112389 on Jul 16, 2012 2:55 PM

  • Adding a Variable Value to the cpQuizInfoPointsScored Variable

    I have a variable that I am using to track incorrect responses (clicking incorrect buttons while completing a process) and I want to add the value of the the variable to the value of cpQuizInfoScored. I can create an expression to add the two but I can't select cpQuizInfoePointsScored to receive the total.
    Any help would be appreciated.

    Jimmy.  This might be that you are misunderstanding how the Interactive Master widget works with partial scoring.  Basically you need to specify the score that will be allocated to a slave object using the Scoring section in the Master Widget properties interface.  That's the score that will be reported to the Quiz instead of the default score you've assigned to the interactive widget via the Properties > Report Score section in Captivate.
    Using the preference settings you select, the Master Widget is going to try and work out whether or not the Variable Slave is in a Success or Failure condition, and THEN it will report whatever score you've assigned for that circumstance.
    What you're trying to do is a little different.  You want to have ONE variable slave that can have a score anywhere between 60 to zero.  My suggestion is that you consider using setting up different user variables for each of the interactive objects on the slide that you are tracking and then add each of these variables into the Master widget as Variable Slaves, assigning each one a Success or Failure score in the Scoring screen. 
    For example, if you ahve a number of click boxes on a slide and you are tracking whether or not the user clicks the right ones, you need to set up a user variable with a default value of 0 for each click box and assign that variable a value of 1 if the click box gets clicked.
    The Master Widget will be able to determine for each of these slaves whether they are in a Success or Fail condition based on whether the variable is set to 0 or 1 and then add up the relevant scores allocated for each variable.  This aggregated score is what can be reported to the quiz score, over riding the default score assigned to the widget.

  • Restrict variable values based on another variable in the bex query...

    I am struggling to restrict the variable values from other varaible in the selection criteria. I have a variable which restricts he organisation(0ORGUNIT) and another to restrict employees.
    When the user selects any organisation unit form the hierarchy, I want only those employees related to that organsation in the varaible selection options.
    Is there any way I can make a variable values dependant on the another variable value in variable selection screen?
    Thanks,
    Your help in this matter will be much appreciated.
    Edited by: Kthapa on Nov 25, 2010 11:08 PM

    Hi Kthapa,
    Did u try using cmod?
    i_step = 1? Used to provide default values for the selection screen variables and
    i_step = 2 for filling up the variables after selection screen.
    Try using based on ur requirement.
    Hope this helps. Revert back for any queries.

  • Run Variable values out of the "variable values window" in a excel workbook

    Dear experts,
    I am working on BI 7.10.
    Our workbooks are made of several data providers based on the same query and require many different variable values, which give us a long and unconvenient (for the users) "select values for variables" window (ex : we have a Profit and Loss report to run on different consolidation versions, fiscal years etc...)
    So I wonder if there is another way to enter these values, out of this window...(macro?)
    Many thanks for your help.
    Armelle

    my variables are global for all data providers since I use the same query for my data providers.
    It's just the values (some of them : ex: conso version) that differ from one data provider to another.
    ex : here for 2 diff Data providers based on the same query i need to enter the following values for mandatory variables
    Different versions / different years but same conso group / data entry year/ posting period.
    i would like to have the possibility to enter these values out of the "select values for variable" window (not convenient when we have 7 or 8 DP...), but directly in the workbook.
    But maybe this is not possible...
    In DP1                 
    conso version = A_PL                         
    conso group = FR01
    data entry year = 9999
    fiscal year = 2010
    Posting period = 12
    In DP2
    Conso version = P4_MAG
    Conso group = FR01
    Data entry year = 9999
    fiscal year =2011
    Posting period = 12

  • Store User given value in an Odi Variable

    Hi,
    I want to store the recent user given value(at execution time) in a .txt file using shell script.So I want to pass the user given value to the shell script.So in package,I put the the variable in refresh mode as first step and then the odioscommand link by ok.When I try execute this package it fails(*ODI-1246:* The Logical Schema has not been set for Input_Variable).
    FYI:-
    I just create a simple variable of numeric type.Select the LATEST VALUE for it and schema is undefined.Default value is 0.
    After this problem occurred I select oracle schema,memory engine schema etc. and execute the package/scenario again But it result the same.
    Please Advice
    Thanks
    Papai
    NB
    Here is the problem details:-
    ODI-1246: The Logical Schema has not been set for Input_Variable.
    at com.sunopsis.dwg.dbobj.SnpSessTask.getDefaultDwgConnectConnection(SnpSessTask.java:508)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.getExecutor(SnpSessTaskSqlV.java:428)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.processTask(SnpSessTaskSqlV.java:405)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
    at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.treatTask(SnpSessTaskSqlV.java:240)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
    at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
    at java.lang.Thread.run(Thread.java:662)

    If you are using it as a refresh variable then you should have one refresh query and the logical schema selected inside it.
    If you are using it in set mode then just assign the default value. (No use of refresh query and logical schema.)
    If you are using it in declare mode then provide the value in run time. (No use of refresh query and logical schema.)

  • How to pass a Variable value into an ODI Scenario from ODI Package

    I have created an Interface that uses the variable #ENTITY_ID for retrieving entity data from the DWH; now I have generated a Scenario from the interface and placed the Scenario in an ODI Package; am not sure how to pass the #ENTITY_ID variable to the ODI Scenario?
    Any help is greately appreciated.
    Best Regards
    Bee

    Hi Sutrtha,
    Yeah I got the pop up asking to select the variables used, I have selected ENTITY_ID that was used by the interfaces, but on execution of the package the Scenario did not work as the passeed variable #ENTITY_ID is set to 0 instead of the value I am passing.
    Am I missing something?
    Regards
    B

  • Can we assign jython variable value into ODI variable?

    Hi Team,
    We are trying to save jython variable value into ODI variable so that ODI variable can use in later steps.
    we are facing failure regards same.
    Please suggest us so that we can use ODI variable value in later steps.
    Thanks
    Ankush.

    See if this post help you :- How to assign value for a ODI variable from Jython Script
    Doc id 424579.1 on metalink should help.

  • Assign value to ODI variable from Jython

    Hello Experts,
    I have a procedure where I'm using Jython code. I want to assign a value to an ODI project variable from a Jython function:
    Example:
    #COUNTER = len(v_jythonList) ---> being #COUNTER the ODI project variable and len() the jython function
    Now, i noticed that using ODI variables adds # sign which is use for comments in Jython code. Is there a way to assign values to ODI variables from Jython script?
    Please help!.
    Thanks.
    Pablo.

    Hi,
    Does this post help you :- How to assign value for a ODI variable from Jython Script
    Doc id 424579.1 on metalink should help.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to assign a value to ODI Variable using ODI Procedure

    Hi ,
    Is it possible to assign a value to a ODI Variable using ODI Procedure ?
    If it is possible how we can do that.
    BEGIN
    IF #Counter=1
    Then
    #Next_Increment:=#Counter+1;
    End if;
    END;
    In my example I have 2 ODI Variables #counter and #Next_increment.
    I am trying to assign VALUE TO A ODI VARIABLE #next_increment from another ODI Variable #counter.
    thanks
    prasanna

    Prasanna,
    I have a similar requirement where I need to assign values to ODI variables within a procedure. How do we make use of an ODI package to accomplish this ?
    Actually, I have a sequence of ODI steps, and there is a call to a procedure 'LOG ERROR' from every step which gets called in case error occurs in any step. I just need to identify from which step the error came.
    Please help.

  • How use return value of JavaBeanShell ODI prodecure in Interface Mapping

    My source data is in Complex FIle and Target data is in Oracle.
    I have written ODI procedure using JavaBeanShell technology
    The "command on Source" is below (actual implementation is much more complex):
    /---------------For Example-----------------------
    <@
    import java.sql.*;
    public class JBTest
         public static String test() throws Exception
              conn=odiRef.getJDBCConnection("SRC");
              Statement stmt=conn.createStatement();
              String result="";
              ResultSet rs=stmt.executeQuery("select SNPSLOADDATE from ROOT_ELEMENT");
              while(rs.next()){
                   result = rs.getString(1);
              return result;
    @>
    Is it possible to use this "result"(return val of function test) in Interface mapping implementation.
    If yes how?
    Or any way to assign this return value to an ODI variable.

    Hi,
    I have done using PL/SQL or a simple select from dual statement under oracle tech in function/procedure which can used anywhere.
    I tried using return in java bean shell , didn't worked.
    Unfortunately there is little / no document about how to use java bean shell in ODI. Alternatively you can try jython.

  • How to call PL/SQL function and pass parameter to ODI variable?

    Can I call PL/SQL function and assign a return value to an ODI variable? Also can I assign ODI variable to IN paramter and assign OUT parameter to ODI variable? What ODI doc has that information?
    Thanks

    Hi,
    Refer this http://odiexperts.com/how-to-use-plsql-procedures-and-functions-in-odi
    Thanks,
    Sutirtha

  • Getting result of a PLSQL in ODI Variable

    Hi experts
    I created a PLSQL Block in ODI Under the procedure.
    I have a variable which will get the result of a query/procedure inside my PL/Sql Block
    I need to assign this value to an odi Variable. Is this possible if so how...
    Please explain
    Any help is really appreciated.

    So, in fact I never experiment the way to define an ODI variable into a procedure,
    but maybe you can just duplicate part of your code which set your PL/SQL variable and put it in the refresh tab of your ODI variable ?
    If it's not possible for performance reason maybe you can try something like this in the repository (the work one I think)
    update snp_var_data
    set var_v = newvalue
    where var_name = scenario.var_name;
    But I never experiment it but it should be something like this.
    Let me know if it works.
    Best regards,
    Brice.

Maybe you are looking for

  • Incomplete Recovery After Drop Tablespace.

    Hi...some technical help required. I was trying a hands-on for incomplete recovery. That is drop a tablespace and then retrieve back until 1 second before drop statement. The Steps were like this... 1) Shutdown Immediate; 2) Copy all *.ctl, *.dbf, lo

  • N97 Mini Bluetooth problems

    Hi:  I have used to have a N86 which worked flawlessly with my 2005 Mitsubishi Outlander Handsfree system.  But when I changed my phone to the N97 mini, it pairs fine but doesn't work properly.  When I call manually from the phone, the handsfree take

  • Element 9 scaling - strange behavior

    I was trying to create a screen cast with elements 9. A short 10 screen images video, where I insert 10 screen images one after the other. I then inserted a png of a mouse pointer, and used animation to show the user how the mouse clicks a certain ar

  • Restart takes more than 2 hours!

    Since a couple of days a restart on my 2008 MacBook Pro 15 inch takes more than 2 hours. Anybody have the same problem?

  • Working with Flash 5.0 in Java?

    Hi All, I need to embed flash 5.0 file in Java Application. I searched in macromedia and all searching sites. Everywhere its telling JMF will support till flash 2.0 only. I am badly in need of working flash 5.0 in java application. So, anybody who kn