How to get records into two internal tables from 1 internal table?

VERME                                                                     LGPLA
252.000  EA  300     0149A                                  410     0149
276.000  EA  300     0149A                                  410     0107
516.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
I have above records in my one internal table ITAB.
I want to divide these records in to two internal tables ITAB1 and ITAB2. and this is based on LGPLA and VERME.
If there is same LGPLA (last column) and different VERME (1st column) available, then it should append ITAB1
Otherwise it should append ITAB2.
ITAB1 should contain ,
516.000  EA  300     0149A                                  400     3013
ITAB2 should contain ,
252.000  EA  300     0149A                                  410     0149
276.000  EA  300     0149A                                  410     0107
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
528.000  EA  300     0149A                                  400     3013
I have tried with this code
Loop at itab….
IF lv_prev_lgpla = wa-lgpla and lv_prev_verme <> wa-verme.
      APPEND wa TO itab1.
else.
      APPEND wa TO itab2.
endif.
lv_prev_lgpla = wa-vlpla.
lv_prev_verme = wa-anfme.
Endloop.
But it contains,
516.000  EA  300     0149A                                  400     3013
in table ITAB2 which I don’t want.
Points rewarded soon.
Regards,
Ronn

Dear Ronny,
i am gining the solution below.But would request you to change your ITAB STRUCTURE LIKE THIS BEFORE USING THE CODE
VERME LGPLA
252.000 EA 300 0149A  0149 410
276.000 EA 300 0149A  0107 410
516.000 EA 300 0149A  3013 400
528.000 EA 300 0149A  3013 400
528.000 EA 300 0149A  3013 400
528.000 EA 300 0149A  3013 400
528.000 EA 300 0149A  3013 400
528.000 EA 300 0149A  3013 400
528.000 EA 300 0149A  3013 400
then do as follows.
SORT ITAB BY LGPLA VERME.
LOOP AT ITAB INTO WITAB.
W_INDEX = SY-TABIX.
here take all the abOve fields in temp fieds.
LW_VERME = WITAB-VERME..AND SO ON.
  AT END OF LGPLA.
   MOVE: all LW fields to work area of ITAB1
   APPEND work area of ITAB1 TO ITAB1.
   DELETE ITAB INDEX W_INDEX
  ENDAT.
ENDLOOP.
Basically what u r doing here is thet u r using processing event.
So whenerv VERME changes this event will be triggered.
Just try this out...something like this only will be he logic.
Please let me know further

Similar Messages

  • Split records into two files based on lookup table

    Hi,
    I'm new to ODI and want to know on how I could split records into two files based on a value in one of the columns in the table.
    Example:
    Table:
    my columns are
    account name country
    100 USA
    200 USA
    300 UK
    200 AUS
    So from the 4 records I maintain list of countries in a lookup file and split the records into 2 different files based on values in the file...
    Say I have records AUS and UK in my lookup file...
    So my ODI routine should send all records with country into file1 and rest to file2.
    So from above records
    File1:
    300 UK
    200 AUS
    File2:
    100 USA
    200 USA
    Can you help me how to achieve this?
    Thanks,
    Sam

    1. where and how do i create filter to restrict countries? In source or target? Should I include some kind of filter operator in interface.
    You need to have the Filter on the Source side so that we can filter records accordingly the capture the same in the File. To have a Filter . In the source data store click and drag the column outside the data store and you will have Cone shaped icon and now you can click and type the Filter.
    Please look into this link for ODI Documentation -http://www.oracle.com/technetwork/middleware/data-integrator/documentation/index.html
    Also look into this Getting started guide - http://download.oracle.com/docs/cd/E15985_01/doc.10136/getstart/GSETL.pdf . You can find information as how to create Filter in this guide.
    2. If I have include multipe countries like (USA,CANADA,UK) to go to one file and rest to another file; Can I use some kind of lookup file...? Instead of modifying filter inside interface...Can i Update entries in the file?
    there are two ways of handling your situation.
    Solution 1.
    1. Create Variable Country_Variable
    2. Create a Filter in the Source datastore in the First Interface ( SOURCE.COLUMN = #Country_Variable)
    3. Create a new Package Country File Unload
    4. Call the Variable in Country_Variable in Set Mode and provide the Country (USA )
    5. Next call the First Interface
    6. Next call the Second Interface where the Filter condition will be ( SOURCE.COLUMN ! = #Country_Variable )
    7. Now run the package .
    Solution 2.
    If you need a solution to handle through Filer.
    1. Use this Method (http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value ) to call the File where you wish to create store the country name into the variable Country_Variable
    2. Pretty much the same Create a Filter in the Source datastore in the First Interface ( SOURCE.COLUMN = #Country_Variable)
    3.Create a new Package Country File Unload
    4.Next call the Second Interface where the Filter condition will be ( SOURCE.COLUMN ! = #Country_Variable )
    5. Now run the package .
    Now through this way using File you can control the File.
    Please try and let us know , if you need any other help.

  • How to insert records with LONG RAW columns from one table to another

    Does anybody know how to use subquery to insert records with columns of LONG RAW datatype from one table to another? Can I add a WHERE clause in the subquery statement? Thanks.

    Insert into ... Select statements are not supported for long or long raw. You will have to either use PL/SQL or convert your long raw to blobs.

  • How to get metadata option list values derived from a table/view using SOAP

    I am writing an ASP.NET application that replicates some of the features of the SCS search interface. I have looked at the GET_DOC_METADATA_INFO service and its SOAP output. It has a few missing pieces of information, like the option list values for a field if that fields values are derived from a separate table/view. Some of the fields I am dealing with also make use of Dynamic Control Lists (DCL). Is there a way to get the DCL info using SOAP? I did notice that the dOptionListKey element contains the name of the view from which the option list values will be derived. However, I cannot find a service that takes the view name as a parameter to return the option list values. I have looked in the services reference manual, but I have not had any luck finding what I am looking for.
    TIA
    - Tyson
    Message was edited by: Add the word 'get' to the subject.
    Tyson

    Hello,
    What error you are getting? You code seems to be ok. I have tested below code and working fine
    XPathNavigator rTable = MainDataSource.CreateNavigator();
    String ddlSectionSelectedValue = Convert.ToString(rTable.SelectSingleNode("/my:myFields/my:ddlSection", NamespaceManager).Value);
    One think you can check that keep dropdown value display name and id same.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • How to get Row = 2 Details in report from JDT1 Table

    Dear Experts,
    SELECT T0.TransId, T0.Account, T1.[AcctName]Row1, T0.Debit, T0.Credit, T0.RefDate, T0.BaseRef,  T0.Closed, T0.Ref1, T0.Ref2, T0.Ref3Line, T0.RelType
    FROM JDT1 T0  INNER JOIN OACT T1 ON T0.Account = T1.AcctCode
    WHERE T1.[AcctName] = [%0]
    in above query i  want ROW2 Detail from JDT1Table.
    Any Help?
    Regards,
    Rahul
    Edited by: RAVI_JHA_SAP on Mar 3, 2011 8:27 AM

    Hi Ravi.......
    Try this.....
    SELECT T0.TransId, T0.Account, T1.AcctName, T0.Debit, T0.Credit, T0.RefDate, T0.BaseRef, T0.Closed, T0.Ref1, T0.Ref2, T0.Ref3Line, T0.RelType
    FROM JDT1 T0 INNER JOIN OACT T1 ON T0.Account = T1.AcctCode
    WHERE (T1.AcctName = '[%0]' or '[%0]'='') and T0.[Line_ID]=2
    Regards,
    Rahul

  • How to split  the records into two parts

    Hi experts,
    I have a field with 75 char length, this field have records also, Now i want to split the field into two differnt fields. That means upto first 40 char goes to one field, from 41st char to 70 char goes to another field, for that how to split record into two parts.
    Plz advice this,
    Mohana

    Hi,
    Do the following:
    f1 = fsource(40).
    f2 = fsource+40(30).
    where fsource is the 70 character original string and target strings are f1 (length 40) and f2 (length 30).
    Cheers,
    Aditya
    Edited by: Aditya Laud on Feb 22, 2008 2:10 AM

  • How to display records into a non table base block..

    Hi,
    Can anybody help me how to display records into a non table base block....
    Find below is my coding but it only display the last record in the first line
    in the block.
    PROCEDURE CREATE_CARTON_QUESTION IS
    CURSOR car_c IS
    select /*+ rule */ question_id, question_description
    from WHOP.QADB_QUESTIONS
    where question_category = 'Carton'
    and question_active_flag = 'Y';
    v_found VARCHAR2(10);
    v_status boolean;
    v_error      varchar2(150);
    v_count number;
    car_r car_c%rowtype;
    begin
    begin
    select count(*) into v_count
    from WHOP.QADB_QUESTIONS
    where question_category = 'Carton'
    and question_active_flag = 'Y';
         exception
         when no_data_found then
         v_count := 0;
    end;
    if v_count > 0 then
    for car_r in car_c loop
    ---populating carton questions
    :la_carton.carton_question_id     := car_r.question_id;
    :la_carton.carton_question_answer     := 'N';
    :la_carton.carton_error_details     := null;
    :la_carton.attribute2          := car_r.question_description;
    end loop;
    end if;
    end;
    Thanks in advance.
    Regards,
    Jun

    Hi SNatapov,
    Thanks for you reply but still I get this error...
    FRM-40737 Illegal restricted procedure GO_BLOCK in WHEN-VALIDATE-ITEM trigger.
    Please note that I call that program unit in the last field of my control block inside when-validate-item trigger the questions should be display in la_carton block which is my non-base table block.
    Find below is the code....
    begin
    go_block('la_carton');
    first_record;
    for car_r in car_c loop
    ---populating carton questions
    :la_carton.carton_question_id := car_r.question_id;
    :la_carton.carton_question_answer := 'N';
    :la_carton.carton_error_details := null;
    :la_carton.attribute2 := car_r.question_description;
    next_record;
    end loop;
    end;
    Hoping you can help me this problem...
    Thanks in advance.
    Regards,
    Jun

  • How to get space between two values in a single cell of a table.

    hello,
            how to get space between two values in a single cell of a table.
    thanks a lot.
    kailash.

    sorry i got the answer.

  • How to insert data into two tables linke with foreign key..

    I have two tables
    1)EMP(emp_ID,username,emp_type_code)
    emp_ID is primary key, emp_type_code is a foreign key references emptype table.
    2)emptype(emp_type_code,emp_type_descripton)
    emp_type_code is primary key
    Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..

    CREATE TABLE "CATDB"."DWDIMUSER"
    "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_ID" NUMBER(10,0),
    "FULLNAME" VARCHAR2(20 BYTE),
    "FNAME" VARCHAR2(20 BYTE),
    "LNAME" VARCHAR2(20 BYTE),
    "USER_SUBTYPE" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE,
    CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
    CREATE TABLE "CATDB"."DIMSPECIALTY"
    "SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_NAME" VARCHAR2(100 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
    SELECT DISTINCT
    Engineer AS FullName,
    regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
    regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
    'Engineer'
    FROM EMPLOYEELOOKUP;
    INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
    SELECT DISTINCT SPECIALITY
    FROM EMPLOYEELOOKUP;
    COMMIT;
    CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
    CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
    "EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
    "ENGINEER" VARCHAR2(25 BYTE),
    "SPECIALTY" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CATDB" ENABLE
    DATA IN EMPLOYEELOOKUP
    Engineer, Specialty,
    John, Dow, Electronis,
    Dow, Jons, Technician
    Stan Smithers Sales
    Mark, Richards Marketing
    Jenny, Lane Marketing
    John, Lee Sales
    I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
    BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY.

  • How to get record control in sony ericsson p1i.

    How to get record control in sony ericsson p1i....
    does jsr234 helps??

    I'm not sure it is possible to get the PL/SQL record type through JDBC. Please try to access this procedure through JDBC to see if it is possible.
    You may need to convert the record type, to an object-type, i.e. wrap the procedure in another procedure that converts the record type. You could also just wrap the procedure in another that expands the record values into individual output parameters.

  • How to get audio into Adobe Premiere Elements 12?

    How to get audio into Adobe Premiere Elements 12?
    I have filmed an air show with a very good camera JVC pro
    And when I pick up the clips in Adobe Premiere Elements 12, it works too, but only without sound.
    I think I tried everything for 4 days now.
    Sound in my computer works perfectly
    I go to where the video files are located and try to run them in VLC or in Nero Kwik so it works fine with both audio and video.
    I have checked the sound card.
    Yes, I have tried everything so now I'm so tired of this lousy so I'm ready to throw this program at the dump.
    It's not normal if you will keep on producing audio for over 4 days at Adobe
    The old Elements 9 worked fine. Offer some of would consider developing it again. I do not know how I should do.
    My name is Thore Hult
    live in Karlshamn in Sweden

    Thore Hult
    On what computer operating system is your Premiere Elements 12 working on? Have you updated it from 12 to 12.1 Update using an opened project's Help Menu/Update. If not, please do so.
    For your immediate problem.
    What is the model/settings for the JVC camera that recorded you video. I want to get at the properties of your source video including the file extension.
    Since you are getting video, but no audio, please download and install the free codec utility named GSpot to see what is shows
    for your Audio Name and Status.
    http://www.headbands.com/gspot/
    The other properties of the file there would also be of interest.
    When you import your source file into the project, do you see any "conforming" activity going in a progress bar at the bottom right corner of the workspace?
    If so, do you wait for it to complete before you move forward in the project?
    Can you get sound in any of your Premiere Elements projects with this current JVC file or other?
    Can we assume that your troubleshooting has included checking
    a. Volume control within the project
    b. Edit Menu/Preferences/Audio Hardware ASIO
    Let us start here and then we can decide what next if necessary.
    Thanks.
    ATR

  • How do I get sdo_point into C host variables from OTT structures?

    How do I get sdo_point info into C host variables from structures generated by OTT?
    Databse Version 10.1.0
    I am using OTT to generate C structures for the Oracle Spatial datatype sdo_geometry. The file is generated as
    #ifndef GEOMETRY_ORACLE
    # define GEOMETRY_ORACLE
    #ifndef OCI_ORACLE
    # include <oci.h>
    #endif
    typedef OCIRef sdo_geometry_ref;
    typedef OCIRef sdo_point_type_ref;
    typedef OCIArray sdo_elem_info_array;
    typedef OCIArray sdo_ordinate_array;
    struct sdo_point_type
    OCINumber x;
    OCINumber y;
    OCINumber z;
    typedef struct sdo_point_type sdo_point_type;
    struct sdo_point_type_ind
    OCIInd _atomic;
    OCIInd x;
    OCIInd y;
    OCIInd z;
    typedef struct sdo_point_type_ind sdo_point_type_ind;
    struct sdo_geometry
    OCINumber sdo_gtype;
    OCINumber sdo_srid;
    struct sdo_point_type sdo_point;
    sdo_elem_info_array * sdo_elem_info;
    sdo_ordinate_array * sdo_ordinates;
    typedef struct sdo_geometry sdo_geometry;
    struct sdo_geometry_ind
    OCIInd _atomic;
    OCIInd sdo_gtype;
    OCIInd sdo_srid;
    struct sdo_point_type_ind sdo_point;
    OCIInd sdo_elem_info;
    OCIInd sdo_ordinates;
    typedef struct sdo_geometry_ind sdo_geometry_ind;
    #endif
    I can successfully access the sdo_gtype and sdo_ordinates using the following ProC code
    exec sql begin declare section;
    int sptype;
    double coord[100000];
    sdo_geometry *spgeom;
    sdo_ordinate_array *spcoords;
    exec sql end declare section;
    /* allocate memory for the geometry host variable */
    exec sql allocate :spgeom;
    select bounds into :spgeom from boundary;
    /* retrieve the geometry type from the geometry host variable into a host variable */
    exec sql object get sdo_gtype from :spgeom into :sptype;
    /* allocate memory for the sdo_ordinate_array host variable */
    exec sql allocate :spcoords;
    /* move the coordinates from the geometry host variable into the sdo_ordinate_array host variable */
    exec sql object get sdo_ordinates from :spgeom into :spcoords;
    /* determine the number of coordinates */
    exec sql collection describe :spcoords get size into :numord;
    /* move the coordinates from the sdo_ordinate_array host variable into a host array */
    exec sql for :numord collection get :spcoords into :coord;
    I cannot, however, figure out how to get point data out of the host variable spgeom. If I prepare code analagous to the other types in the geometry structure, I get an error. I can see that sdo_point is different because it is a struct within the geometry definiton of typedef OCIRef but my knowledge of C is sufficeintly weak that I cannot figure out how to get sdo_point into C host variables. Some sample code for getting the sdo_point data would be greatly appeciated.
    Thanks, Chris

    To get point data from geometry column use following
    select a.location.sdo_point.x, a.geometrycolumn.sdo_point.y
    from tablename a;
    Do not forget to alias the table.

  • How to get list of block identifiers in a empty table and an empty index

    We have an application that has issue with ITL waits: this application is running many INSERT statements on a table that has 2 NUMBER columns and one primary key index. The application is designed to run INSERT statements but they are never committed (this is a software package).
    To check what are the really allocated ITL slots, I know that I can dump data block but I don't know how to get the block identifiers/numbers for an "empty" table and an "empty" index. Does someone knows how to do that ?
    PS: I already had a look to the Metalink notes and I have a Metalink SR for that but maybe OTN forum is faster ?

    You should be able to find the first data/index block with the following, even on an empty table/index.
    select header_file, header_block +1
    from dba_segments
    where segment_name = '<index or table name>';

  • How to get the object class field value in CDHDR table for vendor

    hi
    how to get the object class field value in CDHDR table for vendor

    Try KRED/KRED_N as object class in CDHDR for Vendor.

  • How to get the current logged in username from windows and put it into an AS var

    Hello,
    I was hopeing someone would know how to get the current logged in username from windows and put it into a var, so I can create a dynamic text box to display it.
    Thanks in advance
    Michael

    Just for everyone’s info, this is the script I have used to get the logged in windows username into flash ---- not and air app.
    In the html page that publishes with the .swf file under the <head> section:-
    <script language="JavaScript" type="text/javascript">
    function findUserName() {
         var wshell=new ActiveXObject ("wscript.shell");
         var username=wshell.ExpandEnvironmentStrings("%username%");
         return username;
    </script>
    The ActionScript:-
    import flash.external.ExternalInterface;
    var username:String = ExternalInterface.call ("findUserName");
    trace (username); // a quick test to see it in output

Maybe you are looking for

  • Footer display without space in all page (in footer place)

    Hi  All wish  you merry cristmas. in my layout my customer wants  all pages contains the record upto last  . if i will dispaly upto last  in main window , then where i will make the footer . when i am making the footer in first page all the pages foo

  • Can't open *.swf files in pc.

    It dint cross my mind, when i installed win 7 ultimate x86 2 weeks ago and installed adobe cs4 master suite, to check whether i can open swf files or not. I just like always, downloaded ADM, and installed Flash player 10.1. The web videos were all wo

  • Ipad FaceTime, person I'm calling can't hear me

    iPad 2, in FaceTime, person I'm calling can hear me but I can't hear them. Help,

  • Physical Inventory -PIAC Status active

    Hi All, I am facing the below error after deleting a item in physical inventory document. Can any one let me know how to remove this and what is EQU. I know something is to be done in BS22. System Status PIAC is active (EQU 2172506) Regards, Umesh

  • Time Machine does not complete backup to Time Capsule

    Within the past few days my iMac will not complete a backup to my Time Capsule.   The two other computers connected to the Time Capsule appear to be backing up but they size of the backup is smaller.   The Time Machine starts but then stops after 10