Variable-like object in OWB

Hi all,
I am creating a mapping from which I want to use the values contained in an external file, which looks like follows:
2701
2702
2703
2704
I need to compare a field from each record introduced in the mapping and see if it starts with any of the values stated in the external file mentioned above.
What I did was loading the file in a staging table, and creating a function in which, for every record in the mapping I try to match one of its fields with any of the values in the external file, using a cursor. The problem is, input files have around 50 million subscribers, and with this solution I am fetching the values in the external file 50 million times, and overall performance is hugely affected.
Is there any way of storing those values stated above in a variable/array/something in order to not to use a cursor to query the database as many times as records the input files have?
Thanks in advance
G.
Edited by: [email protected] on Nov 4, 2009 3:28 PM

No, the values can vary but there is a maximum of 11 characters.I think the fastest way is to autogenerate "lookup" function before each mapping run,
the source code of this function should be like
create or replace function func_lookup(P_FIELD IN VARCHAR2) return VARCHAR2 is
begin
  if P_FIELD like '2701%' then return '2701';
  elsif P_FIELD like '2702%' then return '2702';
  elsif P_FIELD like '2703%' then return '2703';
  // code for rest rows from from external table
  end if;
  return NULL;
end;For generating "lookup" function you can use other stored PL/SQL procedure, for example
create or replace function proc_gen_lookup is
  v_source_code VARCHAR2(32000);
begin
  v_source_code := 'create or replace function func_lookup(P_FIELD IN VARCHAR2) return VARCHAR2 is begin ';
  for exttab_rec in (select code from your_extrnal_table order by length(code) desc) LOOP
      // ADD correct code for first iteration - genrate IF instead ELSIF
      v_source_code := v_source_code || ' elsif P_FIELD like '''||exttab_rec.code||'%'' then return '''||exttab_rec.code||'''; ';
  END LOOP;
  v_source_code := v_source_code || ' end if; return NULL; end;';
  EXECUTE IMMEDIATE v_source_code;
end;How many rows in your external table (large number of rows can produce VERY large code for "lookup" procedure which doesn't fit into PL/SQL varchar2 variable)?
Or you can try rewrite your function (with cursor) to select from index organised table (instead of external table).
Regards,
Oleg

Similar Messages

  • Use of global variables like g_cnt_transactions_transferred in the LSMW

    Hi SapAll.
    when i had a look at the some of the LSMW's whic use IDOC as the object of uploading data into SAP from external Files i have found in the coding under the step "Maintain Field Mapping and Conversion Rules" that they use some of the global variables like below
    .if p_trfcpt = yes or sy-saprl >= '46A'.
      EDI_DC40-DOCNUM = g_cnt_transactions_transferred + 1.
    endif.
    .EDI_DC40-CIMTYP = g_cimtyp.
    .EDI_DC40-MESTYP = g_mestyp.
    .EDI_DC40-MESCOD = g_mescod.
    .if p_filept = yes.
      EDI_DC40-SNDPOR = g_fileport.
    elseif p_trfcpt = yes.
      EDI_DC40-SNDPOR = g_trfcport.
    endif.
    my doubt is where i can find these variables 'g_cnt_transactions_transferred ','g_cimtyp','g_mescod','g_fileport','g_trfcport' in the LSMW and what is the use of the variable  'g_cnt_transactions_transferred ' in the LSMW.
    I have treid to find out the above listed variables looking in step 'Maintain Field Mapping and Conversion Rules' under global variabels list and the other lists also but i couldnt found.
    can any one help me in this ?
    regards.
    Seetha.

    Hi Seetha,
               In the LSMW Workbench go to the option user menu.  And check the option display conversion program.
    Now when you execute with the radio button on dislplay conversion program, you ll see the code that got generated in the background while you built your LSMW.
    The global variables that you have mentioned are bound to be there in this program generated in the background..
    You can put a break point here and see for yourself what the value of these global variables are at runtime.
    File port, TRFC port , no. of transactions executed by one run of the LMSW Idoc program , message type are some of the fields that you have asked for .
    Regards,
    Arun

  • Is there any way to get windows environment variables like %USERNAME% with javascript?

    is there any way to get windows environment variables like %USERNAME% with javascript using Adobe 10 pro?

    There is a fair amount of Acrobat JavaScript and Acrobat knowledge need to sort all of this out.
    The identity object holds a lot of sedative information. First, upon installation of Acrobat, only the login name is available in the identity object and the end user of the application needs to complete the "Name", "email" and "Organization Name" in the application's preferences. These are the only fields that are available to Acrobat JavaScript identity object as corporation, email, loginName, and name.
    Using the instructions in The Acrobat JavaScript Console (Your best friend for developing Acrobat JavaScript) you can run the following script in the JS console to see the items of the identity object:
    for(i in identity) {
    console.println(i +": " + identity[i]);
    and the following will appear in the console:
    loginName: georgeK
    name: George Kaiser
    corporation: Example
    email: [email protected]
    true
    The documentation states you need to use a trusted function to access this data, but you can access it at startup of Acrobat/Reader and add the properties of the identity object to an array:
    // application variable to hold the properties of the identity object
    var MyIdentity = new Array();
    // loop through the properties of the identity object
    for (i in identity) {
    // place each property of the identity object into an element of the same name in the Identity array
    MyIdentity[i] = identity[i];
    console.println(i +": " + MyIdentity[i])
    You access the items with:
    var loginUser = MyIdentity[loginName];  // get the loginName property
    In the user application level JavaScript file. See Acrobat Help / User JavaScript Changes for 10.1.1 (Acrobat | Reader) for the location of the application level folder you need to use.
    I would change the name of the array used in this post so an untrusted user cannot get to your data. Some of this data can be used in hacking into a user's system.

  • How use integer variable as object in query

    sir how use integer variable as object in query
    see my code
    Integer currentssgg = new Integer(tt.getValue().toString()); no error
    //yy.setValue(currentss); no error
    //yy.setValue(new Integer(tt.getValue().toString())); no eror
    getSessionBean1().getTripRowSet().setObject(1,currentssgg); giv error
    tripDataProvider.refresh();
    and how use string variable same as method
    please give me idea how use integer variable as object in query
    thank's
    aamir

    >> var mnu = 'menu1';
    this[mnu].onRollOver = function(){
    <<
    Close, but it needs to be like this:
    var mnu = 1;
    this["menu" + mnu].onRollOver = function(){
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How to access the parent class variable or object in java

    Hi Gurus,
    I encounter an issue when try to refer to parent class variable or object instance in java.
    The issue is when the child class reside in different location from the parent class as shown below.
    - ClassA and ClassB are reside in xxx.oracle.apps.inv.mo.server;
    - Derived is reside in xxx.oracle.apps.inv.mo.server.test;
    Let say ClassA and ClassB are the base / seeded class and can not be modified. How can i refer to the variable or object instance of ClassA and ClassB inside Derived class.
    package xxx.oracle.apps.inv.mo.server;
    public class ClassA {
        public int i=10;
    package xxx.oracle.apps.inv.mo.server;
    public class ClassB extends ClassA{
        int i=20;   
    package xxx.oracle.apps.inv.mo.server.test;
    import xxx.oracle.apps.inv.mo.server.ClassA;
    import xxx.oracle.apps.inv.mo.server.ClassB;
    public class Derived extends ClassB {
        int i=30;
        public Derived() {
           System.out.println(this.i);                  // this will print 30
           System.out.println(((ClassB)this).i);  // error, but this will print 20 if Derived class located in the same location as ClassB
           System.out.println(((ClassA)this).i);  // error, but this will print 20 if Derived class located in the same location as ClassA
        public static void main(String[] args) { 
            Derived d = new Derived(); 
    Many thanks in advance,
    Fendy

    Hi ,
    You cannot  access the controller attribute instead create an instance of the controller class and access the attribute in the set method
    OR create a static method X in the controller class and store the value in that method. and you can access the attribute by 
    Call method class=>X
    OR if the attribute is static you can access by classname=>attribute.
    Regards,
    Gangadhar.S
    Edited by: gangadhar rao on Mar 10, 2011 6:56 AM

  • How do I get a variable, or object from ABAP STACK.

    Hey Gurus,
    How do I get a variable, or object from ABAP STACK.
    Example: I start my FM. I can see in the ABAP STACK the variable I need. I can see the object; I could use to get my variable. I need to use it in my FM; however I need to reference it in the run time. How do I do that?
    Is there a method I can use for reading ABAP STACK?
    Do I just use command: get reference of u2026?
    Does anyone have an example code?
    Basis version 7
    Thanks in advance
    Martin

    Ah, you mean you want to access a variable from another program in the call stack, yes?  You can do this using field symbols, but please don't try to change a value while doing this, it could really screw things up. 
    this example, is using two programs, where the second is accessing variables of the first program.  Basically just notice that we are using the program name and the variable name when assigning the field symbol.
    report zrich_0006 .
    tables: mara.
    parameters: p_matnr type mara-matnr..
    data: matnr type mara-matnr.
    data: imarc type table of marc with header line.
    matnr = p_matnr.
    select * from marc into table imarc up to 10 rows
                   where matnr = p_matnr.
    perform in in program zrich_0007.
    report zrich_0007 .
    *       FORM in                                                       *
    form in.
      data: field(50).
      data: xmarc type marc.
      field-symbols: <matnr>.
      field-symbols: <imarc> type marc_upl_tt.
    * Assign an individual variable
      field = '(ZRICH_0006)matnr'.
      assign (field) to <matnr>.
    * Assign an internal table
      field = '(ZRICH_0006)IMARC[]'.
      assign (field) to <imarc>.
    * Write out your data
      write <matnr>.
      loop at <imarc> into xmarc.
        write: / xmarc-werks.
      endloop.
    endform.
    Regards,
    Rich Heilman

  • Invalid variable declaration:  object 'TIMESTAMP' must be a type or subtype

    Message 1: ORA-06550: line 91, column 14:
    PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-488: invalid variable declaration: object 'TIMESTAMP' must be a type or subtype
    ORA-06550: line 89, column 1:
    PL/SQL: SQL Statement ignored
    I'm getting above error message when i'm trying to define one cursor from a table which has a column with data timestamp(3) in a cursor i'm not even using a column with data type timestamp .( this tables i created by importing sybase tables into oracle )
    SELECT to_char(sysdate) -- trunc(act.date_posted)
    INTO v__Data
    from cedb.cr_ar_debit_activity act
    where rownum < 2 ;
    for testing purpose i even removed the cursor and make it shor to above query then also it dosent work and gave the above error . if you know the solution then please let me know . i think i've to do/change database settings but i'm not sure .

    the above code is not working but the following code is working if i open cursor from assiging select to variable , why this is happening .
    DECLARE
         v_A_REPORT_DT VARCHAR2(100);
    ls_sel VARCHAR2(900);
    i INTEGER := 1;
    TYPE dynamic_cur IS REF CURSOR;
    tb_test_cur dynamic_cur ;
    TYPE array_date_type IS TABLE OF DATE INDEX BY PLS_INTEGER;
    v1 array_date_type ;
    BEGIN
         v_A_REPORT_DT := '01-01-2007'/* VARCHAR2(2000) */;
    -- this one is not working
    SELECT to_char(sysdate) -- trunc(act.date_posted)
    INTO v_A_REPORT_DT
    from cedb.cr_ar_debit_activity act
    where rownum < 2 ;
    ls_sel := 'SELECT trunc(act.date_posted)
    from cedb.cr_ar_debit_activity act
    where rownum < 3 ' ;
    OPEN tb_test_cur FOR ls_sel;
    LOOP
    FETCH tb_test_cur INTO v1(i) ;
    EXIT WHEN tb_test_cur%notfound;
    dbms_output.put_line(to_char(v1(i)));
    i := i + 1 ;
    END LOOP;
    CLOSE tb_test_cur;
    END;

  • Object Variable vs Object

    I am very confused on this "Object Variable vs Object" thing.
    Pls refer to the code below:
    class Test
           static void show()
              System.out.println("Show method in Test class");
    public class Q2 extends Test
          static void show()
              System.out.println("Show method in Q2 class");
          public static void main(String[] args)
               Test t = new Test();
               t.show();
               Q2 q = new Q2();
               q.show();
               t = q;
               t.show();
               q = t; // line 25
               q.show();
      }The code above should encounter error at line 25, because of incompatible type. The solution is to cast it to type Q2. But, I do not know why should I cast it. I thought:
    t = q; // assign object of type Q2 to variable of type Test, so now
    t is object of type Q2.
    so,
    q = t; // when I assign object of type Q2 to variable of type Q2, I
    thought that is acceptable, but it is not. WHY?
    Thanks!

    Thanks!
    However, there is another question!
    Can I say, after t = q, it is actually becomes
    Test t = new Q2(); ??
    if so, then why when
    q = t; // error?? Isn't this statement indirectly means Q2 q = new Q2()? Is so, why must we cast?
    Thanks again!

  • Environment variables like classpath,JAVA_HOME,path

    Sir,
    I work as a java developer in a software company.I had more problems when executing servlets."could not create the java vitual machine" error comes when i try to compile java servlet file.also I do not know that how to set environment variables like classpath,path and JAVA_HOME.Also I want to know them with proper examples.
    Thanking you.
    KRamesh

    Hi Teches
    I am facing few problem in starting eclipse 3.0 ; I had gone trogh forum , 1 of the persone suggest me to upgrade the java version.For this
    I had installed java 1.5 and set the following variable
    JAVA_HOME ---> to the home dir of JAVA
    PATH ---><home dir>/bin
    CLASSPATH --><jre>/lib
    But when ever i m giving "java -version" command on console , the result is as follows:
    C:\>java -version
    java version "1.3.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
    Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)
    suggestion are welcome Plz.
    ;

  • OLAP AWM 10.2 Variable names: Object view

    In the AWM we see a number of variables in object view e.g. below. Where can we find additional documentation or information about what these various objects represent eg.._PRT_TOPVAR represents cube. Please advise.
    <cubename>PRTTOPVAR
    <cubename>_COMPOSITE
    <cubename>PRTMEASDIM
    <cubename>PRTTOPFRML

    <cubename>PRTTOPVAR -> This is partition top variable which holds data.
    <cubename>_COMPOSITE
    <cubename>PRTMEASDIM -> This is a dimension object which hold the name of the measures you have in your cube. If you limit this to a particular measure and report on PRTTOPVAR then you will get value for only one measure instead of all.
    <cubename>PRTTOPFRML -> This is partition top formula which is used while reporting. If you want that the cube should use a custom aggmap then you have to change the PRTTOPFRM to point to the custom aggmap.
    Thanks
    Brijesh

  • When the combobox is rendered all the values displayed look like [object Object].

    I wasn't sure where to post this so please forgive me.
    I am trying to populate a combobox with a series of values
    returned from a Coldfusion method that retrives a resault froma
    database. Basically all the data from a table of staff.
    <cffunction name="getUsers" access="remote"
    returntype="array">
    <cfquery name="q" datasource="#datasource#">
    SELECT *
    FROM STAFF_CHARTS_STAFF_TEMP
    </cfquery>
    <cfset aRecordset= querytoarray(q)>
    <cfset flash.result=aRecordset>
    <cfreturn flash.result>
    </cffunction>
    <cffunction name="querytoarray" returntype="array"
    output="No">
    <cfargument name="q" required="Yes" type="query">
    <cfset var aTmp = arraynew(1)>
    <cfif q.recordcount>
    <cfloop query="q">
    <cfset stTmp = structNew()>
    <cfloop list="#lcase(q.columnlist)#" index="col">
    <cfset stTmp[col] = q[col][currentRow]>
    </cfloop>
    <cfset arrayAppend(aTmp,stTmp)>
    </cfloop>
    <cfelse>
    <cfset stTmp = structNew()>
    <cfloop list="#lcase(q.columnlist)#" index="col">
    <cfset stTmp[col] = "">
    </cfloop>
    <cfset arrayAppend(aTmp,stTmp)>
    </cfif>
    <cfreturn aTmp>
    </cffunction>
    The result from a call of CF method getUsers is set as the
    data provider to ComboBox with id = "cb"
    <mx:RemoteObject
    id="myService"
    destination="ColdFusion"
    source="staff_ratings.staff_Ratings-debug.staff"
    showBusyCursor="true">
    <mx:method name="getUsers" result="handleResult(event)"
    fault="Alert.show(event.fault.message)"/>
    </mx:RemoteObject>
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import mx.controls.Alert;
    [Bindable]
    public var sResult:Array;
    public function handleResult(event:ResultEvent):void{
    sResult=event.result as Array;
    cb.dataProvider=sResult;
    ]]>
    </mx:Script>
    However when the combobox is rendered all the values
    displayed look like [object Object].
    I think the problem is that the result is a array of arrays
    so I need to find away to ectract a particular colun of data into
    the combobox
    How do I fix this?

    This is what I did for a single field.
    If you were wanting the to have muliple fields in the
    dropdown, I would concatenate them in the query.
    something like
    select fname + ' ' + lname + ' ' + anotherfield as tech from
    dbo.table
    <cffunction name="getTech" output="no" access="remote"
    returntype="query">
    <cfset var qTech="">
    <cfquery name="qTech" datasource="datasource">
    select tech
    from dbo.table
    group by tech
    order by tech
    </cfquery>
    <cfreturn qTech>
    </cffunction>
    <mx:RemoteObject
    id="dataManager"
    showBusyCursor="true"
    destination="ColdFusion"
    source="cust.components.cfgenerated.Records">
    <mx:method name="getMasterQuery"
    result="getMasterQuery_result(event)" fault="server_fault(event)"
    />
    <mx:method name="deleteItem"
    result="deleteItem_result(event)" fault="server_fault(event)" />
    </mx:RemoteObject>
    <mx:ComboBox id="TECH"
    dataProvider="{dataManager.getTech.lastResult}" labelField="tech"
    />

  • Code example of shining star like objects needed.

    How is it possible to make shining star like object like in
    the screensaver "Cosmic voyage"? Check out the screensaver here
    http://www.voodoofiles.com/9503
    and then tell me how this could be implemented. I need some code example.
    Also check out my 3D site:
    www.psyanimations.com

    There are a few discussions of this effect if you search back in this forum. Basically, the glowing light effect is created by drawing an alphablended picture of a glowing light and then orienting it towards the user using an OrientedShape3D type of thing. If you need it to affect nearby objects you will want to put a lightsource with it.

  • Difference between reference variable and object ?

    I am getting confused with reference variable and object ?
    1. int a; // is a variable
    2. Car c = new Car(); // is a object of car type
    Suggest me what are the difference between the two.....

    jverd wrote:
    Shelby wrote:
    Something about an interned string literal?_
    I remember something from class about the way Java treats strings that contain the same data. yawmark
    posted a link for me that cleared up my confusion. thanks yawmark.
    >>
    Can you actually point back to the original reference?Not clear what you're asking here. Nothing points to references. References point to objects.
    Goodness, correct wording is as important as getting the syntax right, isn't it? ;-} What I was trying to ask is if it is possible to point back to the same String once you change the pointer on the variable?
    And you answered my question succintly with the rest of your post. thanks jverd
    >
    String str = "abc";
    str = null;'At this point, we've lost the reference to the original String object. However, at runtime, the VM will still be maintaining it in the constant pool. For any non-constant-pooled object, as we're writing our code, we'd have no way to refer to that object again. In this case, we are able to refer to the same object later in our code by simply using the same string literal. "abc" elsewhere in our code will cause the VM to give us a reference to that same pooled String. Same goes for Integer, etc. in the range -128..127.
    However, it's not good design to rely on this. If your design requires you to later point to "the same object" (as opposed to any object of a compatible type and holding the same contents), then you should explicitly maintain a reference to it. In the case of Strings, you really shouldn't care whether it's the same object or not. All you care about is the character sequence that defines the String's state.

  • Source is not a permitted variable data objects

    Hi SCN,
    So we transported queries. Collected in manually and gouped by necessary objects. We're having a problem with our variables that holds a replacement path setting for clearing date, net due date and posting date.
    Replacement path for key using 0DPM_AV1.
    When we're trying to run the queries in QAS this is the error we're getting: 'Source is not a permitted variable for (infoobject date)."
    Are we missing a step on how are we collecting our queries for transport. Any suggestion so we can overcome this problem?
    Thanks.

    Hi Karl,
    Assumed as query/target related info objects transport to qua without any issues.
    Even at Qua, target level, try to see the loaded requests, Whether they have reporting symbol or not.
    Can you try to run your query at dev system and check it.
    if there is no error from dev then again collect your query into transport from RSA1-->transport connection.
    Use grouping option as only necessary.
    Once you drag query from middle pane to right pane at RSA1-->transport connection, Expand the query which you collected into right pane.
    Below you may see all related objects of your query like CKF,RKF,Variables..etc.
    Select them all and collect into transport.
    Release and import Qua system.
    Later try to run query at Qua and see the results.
    Thanks

  • Values of Variables as Object names

    Hi!
    Can a value of a variable be an object name, and how?
    For example:
    String test = "myname";
    JLabel myname = new JLabel();
    Is it possible to set the object name for the Label from the value of the String test (here: myname) without explicit typing the name of the Label in the code??
    thanks
    P.S. excuse my bad english - I hope you understand my question.

    how can you dynamically create for example Labels? "new Label(text)" will dynamically create a new Label for you.
    I have a database connection and I want to put let's say every value of a column into a new Label.Okay, so you put "new Label(text)" inside the loop that's reading the database. I expect you want to display these labels, so you'd want to add them to some GUI container. Like this: "container.add(new Label(text))".
    how do I declare dynamically names for Labels?In the scenario where you just want to display the labels, you don't need to have "names" for them. But if you have some other scenario, like you need to get at the labels and change the text based on something else happening, then you use a Hashtable to store the Labels. You'd use a String as the key (that's your "name") and use the Label as the value. Then you can retrieve the Label from the Hashtable by using its get(key) method.

Maybe you are looking for