Syntax of redundant data.

data :Begin of I_data
      data1,
      data2,
      data3,
      end of i_data
I have a internal table I_dat filled with
   data1  data2  data3
1)    x     y       z
2)    x     y       z
3)    x     y       i
4)    c     n       o
5)    c     n       o
6)    n     p       l
7)    j     k       o
8)    b     l       n
9)    b     l       n
10)   j     k       y
I would like to have only lines which are repeating I would like to have lines 1,2,4,5,8,9.
Any idea how could I do.
Best Regards,
Mark

Here is one way to keep the duplicates.
report zrich_0001.
data :begin of i_data occurs 0,
      data1,
      data2,
      data3,
      end of i_data.
data :begin of i_data2 occurs 0,
      data1,
      data2,
      data3,
      end of i_data2.
data: counter type i.
i_data = 'xyz'.  append i_data.
i_data = 'xyz'.  append i_data.
i_data = 'xyi'.  append i_data.
i_data = 'cno'.  append i_data.
i_data = 'cno'.  append i_data.
i_data = 'npl'.  append i_data.
i_data = 'jko'.  append i_data.
i_data = 'bln'.  append i_data.
i_data = 'bln'.  append i_data.
i_data = 'jky'.  append i_data.
i_data2[] = i_data[].
sort i_data2 ascending by data1 data2 data3.
delete adjacent duplicates from i_data2 comparing data1 data2 data3.
loop at i_data2.
  clear counter.
  loop at i_data where data1 = i_data2-data1
                   and data2 = i_data2-data2
                   and data3 = i_data2-data3.
    counter = counter + 1.
  endloop.
  if counter = 1.
    delete i_data2.
  endif.
endloop.
loop at i_data2.
  write:/ i_data2-data1, i_data2-data2, i_data2-data3.
endloop.
Regards,
Rich Heilman

Similar Messages

  • View is giving redundant data

    Dear Friends,
    I have created one view, the data base creation statement is like the below. My main intertion is get the SO no, Delivery No, shipment no in one row.
    CREATE VIEW "ZSD_LIPS_VTTK"
        ("DELIVERY_NO","SHIPMENT_NO","MBL_NO","SHIPMENT_DT","ZZMBLISSUEDATE","SO_NUM")
      AS SELECT
         T1."VBELN",T2."TKNUM",T2."EXTI1",T1."WADAT_IST",T2."ZZMBLISSUEDATE",T4."VGBEL"
      FROM  "LIKP" T1,"VTTK" T2,"VTTP" T3,"LIPS" T4
      WHERE
         T2."TKNUM" = T3."TKNUM" AND
         T1."VBELN" = T3."VBELN" AND
         T4."VBELN" = T1."VBELN"
    As SO is in the LIPS table, I am joining LIPS with LIKP. So I am getting redundant data for one perticular delivery no. you can see the below output......
    DELIVERY_NO SHIPMENT_NO   MBL_NO    SHIPMENT_DT ZZMBLISSUEDATE  SO_NUM
    0080000447      0000001162        526485552  20080908         20080915        0000003643
    0080000447      0000001162        526485552  20080908         20080915        0000003643
    0080000447      0000001162        526485552  20080908         20080915        0000003643
    0080000447      0000001162        526485552  20080908         20080915        0000003643
    Now tell me how could i generate this view so that, I can get one row
    0080000447      0000001162        526485552  20080908         20080915        0000003643
    Please guide me how to do that.
    Rgds
    Farhad

    HI,
    I have added  T4."POSNR" ='000010' to reduce the redundant data, but the reality is that sometimes the no 10 line item data can be deleted from the delivery. In this case i need to have the unique value of the desire fields.
    Rgds
    Farhad

  • Delete redundancy data in a table

    please , i want to delete redundancy data in a table like emp as follow
    id name
    1 aaa
    1 bbb
    1 ccc
    i want a delete statment to delete the last two rows and left the first one

    delete from temp_emp b where rowid > (select min(rowid) from temp_emp a where a.emp_code = b.emp_code);
    use this to retain the initially created row
    delete from temp_emp b where rowid< (select max(rowid) from temp_emp a where a.emp_code = b.emp_code);
    use this to retian the lastly created row

  • Clear down redundant data

    Hi,
    I know we can clear down the PSA data by scheduling the daily jobs.
    I would like to know if there are any other areas containing redundant data, and how to clear down them.
    Many Thanks
    Jonathan

    Hi ,
    Master data used to have redundant data
    and some times ur cubes have redundant data
    u can avoid these by deleting the old req for the master data
    and by loading the data without data transfer for cubes
    Pls assign points if answer help full
    Regards
    Subash Balakrishnan

  • Syntax/Delimeter for Data param in Sql Query?

    Hello,
    I have an ADODB recordset which return too many rows from an Oracle Table. I am trying to limit the rows by using a date field in the table as criteria. Here is what I tried that did not work:
    RS.Open "Select * From Tbl1 Where Datefld > #1/1/2002#", conn I get an "Invalid Qualifier" error.
    Any help greatly appreciated on the correct syntax/delimeter for this query.
    Thanks in advance,
    Rich

    Nevermind. I used single quotes for the delimeter. That did the trick.
    Rich

  • Question in ABAP syntax, read & insert data from internal table, while loop

    Hi, SDN Fellow.
    I am from Java background and learnt ABAP, I don't usually write much ABAP code.
    I am trying to implement the following logic in a RFC now.
    I have one z-custom database table, the structure as the following:
    It has two columns, with these sample data.
    Says datable table is ZEMPMGRTAB.
    EmployeeID,ManagerID
    user10,user1
    user9,user1
    user8,user1
    user7,user2
    user6,user2
    user5,user2
    user4,user2
    user2,user1
    The logic is this:
    I have a input parameter, userid. I am using this parameter to have a select statement to query the record into export table,EXPTAB 'LIKE' table ZEMPMGRTAB.
    SELECT * FROM  ZEMPMGRTAB
      into table EXPTAB
       WHERE  EMPLOYEEID  = USERID.
    Say, my parameter value, USERID ='USER4'.
    Referring to the sample data above, I can get the record of this in my EXPTAB,
    EmployeeID,ManagerID
    user4,user2
    Now, I want to iterately use the EXPTABLE-ManagerID
    as the USERID input in SELECT statement, until it has no return result. Then, insert the new records in
    EXPTAB.
    In above new loop case, we will get this table content in EXPTAB,
    EmployeeID,ManagerID
    user4,user2
    user2,user1
    I kind of think of the pseudocode logic as below:
    (These may not be a valid ABAP code, so I need help to convert/correct them)
    DATA:
    IWA TYEP ZZEMPMGRTAB,
    ITAB
    HASHED TABLE OF ZZEMPMGRTAB
    WITH UNIQUE KEY EMPLOYEEID.
    SELECT * FROM  ZEMPMGRTAB
      into table ITAB
       WHERE  EMPLOYEEID  = USERID.
    *Question 1: I cannot insert a internal table to export table, it is *incompatible type, what is the alternative way fo this?
    *Question 2: How can I access thedata of the internal table like this,ITAB-MANAGERID? As if I can, I would do this:
    * IWA-EMPLOYEEE = ITAB-EMPLOYEEID. IWA-MANAGERID = IWA-MANAGERID. INSERT IWA INTO TABLE EXPTAB.
    * Question 3: Is the 'NE NULL' - 'not equal to NULL' is right syntax?
    IF ITAB NE NULL.
    INSERT ITAB INTO EXPTAB.
    ENDIF
    * Question 4: Is my WHILE loop setup right here? And are the syntax right?
    WHILE ITAB NE NULL.
    SELECT * FROM  ZEMPMGRTAB
      into table ITAB
       WHERE  EMPLOYEEID  = ITAB-MANAGERID.
    IF ITAB NE NULL.
    INSERT ITAB INTO EXPTAB.
    ENDIF
    REFRESH ITAB.
    ENDWHILE.
    Assume all the syntax and logic are right, I should get this result:
    EmployeeID,ManagerID
    user4,user2
    user2,user1
    If I have a new entry in datable table,ZEMPMGRTAB like this:
    user1,user0
    My pseudocode logic will get this result:
    EmployeeID,ManagerID
    user4,user2
    user2,user1
    user1,user0
    I truly appreciate if you can help me to validate the above syntax and pseudocode logic.
    Thanks in advance.
    KC

    Hi,
    FUNCTION ZGETSOMEINFO3.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(USERID) TYPE  AWTXT
    *"     VALUE(FMTYPEID) TYPE  AWTXT
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRETURN
    *"  TABLES
    *"      APPROVERT STRUCTURE  ZTAB_FMAPPROVER
    *"      ACTOWNERT STRUCTURE  ZTAB_FMACTOWNER
    DATA: T_RESULT TYPE STANDARD TABLE OF ZTAB_FMAPPROVER.
    **Question 1: For this line, I got an error says "Program ''USERID" *not found. Is the syntax right, as the USERID is a parameter for the function.
    perform add_line(USERID).
      ENDFUNCTION.
    form add_line using i_user type ZTAB_FMAPPROVER.EMPLOYEEID
                        changing T_RESULT TYPE ZTAB_FMAPPROVER.
    data: ls_row type ZTAB_FMAPPROVER.
    * Get record for i_user
    select single * into ls_row from ZTAB_FMAPPROVER
    where EmployeeID = i_user.
    if sy-subrc NE 0.
    * Do nothing, there is not manager for this employee
    else.
    * Store result
    QUESTION 2: I am still got stuck on this line of code. It still *says that "T_RESULT" is not an internal table "OCCURS n" *specification is missing. I thought the line: "T_RESULT TYPE *ZTAB_FMAPPROVER" means declare internal table, T_RESULT as type of ZTAB_FMAPPROVER". Am I understand it wrongly?
    append ls_row to t_result.
    * Call recursion
    perform add_line using ls_row-ManagerID
                              changing t_result.
    endif.
    endform.
    Thanks,
    KC

  • Sql* Loader syntax to load data into a partitioned table

    Hi All,
    I was trying to load data from a csv file to a partitioned table.
    The table name is countries_info
    columns :
    country_code ,
    country_name,
    country_language
    The column country_code is list partitioned with partition p1 for values 'EN','DE','IN' etc
    and partition p2 for 'KR','AR','IT' etc.
    I tried to load data into this table, but I was getting some error Message (not mapping to partitioned key).
    I tried syntax
    load data
    infile 'countries.csv'
    append
    into table countries_info
    partition(p1) ,
    partition(p2)
    fields terminated by ','
    country_code ,
    country_name,
    country_language
    What is the correct syntax- I searched a lot but have not been able to find out.

    Peeush_Rediff wrote:
    Hi All,
    I tried to load data into this table, but I was getting some error Message (not mapping to partitioned key).It's not some error message, it's relevant information for resolving problems you encounter while using Oracle.
    In your case, although you didn't specifiy the exact ORA you recived, it sounds like [ORA-14400|http://forums.oracle.com/forums/search.jspa?threadID=&q=ORA-14400&objID=f61&dateRange=all&userID=&numResults=15&rankBy=10001]
    What is the correct syntax- I searched a lot but have not been able to find out.It's not about correct syntax , it's about understanding message that was trying to tell you that something went wrong.
    That message was (i guess) ORA-14400.
    So, refering to that ORA message , you will need to add new partition ,
    where the data from your csv file that currently don't map to any of the specified partition would fit ,
    or add partition that would be able to accept data range in which value/s for which you received that ORA message could fit into.

  • Syntax for retrieving data from a task container

    Hello Workflow Fans !
    I have a Task with the following configuration:
    BASIC DATA - Object Method :
    Object Category: BOR Object Type
    Object Type: ZBusObj1
    Method: 022_Data_Upd
    CONTAINER :
    I have added a second BOR Object in the container called ZBusObj2
    In conclusion, when the task is executed within my WF run, the method ZBusObj1.022_Data_Upd is executed and both business objects (ZBusObj1 and ZBusObj2) should be available in my Task container.
    My question:
    How, in my method 022_Data_Upd, can I retreive (get) the value of the ZBusObj2 key field (Customer No)?
    Here is what I tried... obviously... without any success:
    BEGIN_METHOD O22_Data_Upd CHANGING CONTAINER.
      break-point.
    * Variable declarations
      DATA: lva_Risk_Cat    TYPE ZTCOMP_PDV-CTLPC.
      DATA: lva_Montant_V TYPE ZTCOMP_PDV-MONTANT_V.
      DATA: lva_Custno       TYPE KNA1-KUNNR.
    * Data retreival from the task container 
      SWC_GET_PROPERTY self 'RiskCategory' lva_Risk_Cat.
      SWC_GET_PROPERTY self 'MONTANT_V'    lva_Montant_V.
      SWC_GET_ELEMENT container 'ZBUSOBJ2.Customerno' lva_Custno.
    The last line (SWC_GET_ELEMENT...) is the one I'm strugling with...
    Any help will be appreciated.
    Thanks in advance.
    José

    So, my understading is that you need an instance of the second object OBJ2 inside the method of the first object OBJ1.
    First, if you only need the customer number, I recommend that you only pass the number itself. Here is what you need to do:
    1- Add an "Import" parameter to method 022_DATA_UPD and call it anything (I'll use PARAM): the parameter can be either an object or a field. You specify the type when you define the parameter. Parameters are added by "single" clicking the method name in SWO1 so that the pointer is on the method name then clicking the "Parameters" button.
    2- Inside the method, add the following code
    Case 1: parameter is an object
    DATA: lvo_custobj  TYPE swc_object.
    DATA: lva_custno TYPE KNA1-KUNNR.
    swc_get_element container 'PARAM' lvo_custobj.
    swc_get_property lvo_custobj '<CUSTOMER_NUMBER_PROPERTY_NAME>' customer_number.
    Case 2: parameter is just a field
    DATA: lva_custno TYPE KNA1-KUNNR.
    swc_get_element container 'PARAM' lva_custno.
    As you can see, adding only the customer number is easier to read. The method should work when you test it in SWO1 before you proceed into the next steps.
    3- Make sure the standard task calling the method is updated with the new parameter. Basically open the task in change mode and type an extra space in the description field then hit Enter. The system will ask you if you want to update the list of parameters.
    4- Update the binding of the task in the workflow template to pass either the customer object or customer number.

  • SQL Syntax for hour/date range in Query

    Hi
    I am trying to set up an query for sales order documents procesed in the last 30 minutes to be set as an alert to be run every 30 minutes to the sales manager.  I am having difficulty getting the syntax for the last 30 minutes
    Any suggestions?
    David

    hi,
    I'm not sure query is correct,but u can modify it futher to get correct one.
    SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.DocTotal FROM ORDR T0 WHERE DateDiff(dd, T0.DocDate ,getdate()) = 0 and
    DateDiff(Minute,T0.DocTime,' ') <= 30
    Jeyakanthan

  • How to create primary on a column when redundant data is present

    I am interested to add primary key constraint on a column where repeated data is there without affecting the date how can I immplement this.
    Can any one help me in this regard.
    Thanks
    Sanjay

    If you have duplicated data and going to specify the primary key constraint on that data it's quite against RDBMS concepts and can't be considered as a relevant idea. Nevertheless Oracle provides you with such tricky method, but once again, it's NOT good idea, change your mind:
    SQL> create table t (x int);
    Table created.
    SQL> insert into t values(1);
    1 row created.
    SQL> insert into t values(1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t;
             X
             1
             1
    SQL> create index t_x on t(x);
    Index created.
    SQL> alter table t add primary key (x) novalidate;
    Table altered.
    SQL> insert into t values(1);
    insert into t values(1)
    ERROR at line 1:
    ORA-00001: unique constraint (ORACLE_OCM.SYS_C006647) violated
    SQL> insert into t values(2);
    1 row created.
    SQL> select * from t;
             X
             1
             1
             2In this case you have PK constraint and it affects all new DMLs, but
    in fact you can't rely on PK.
    Rgds.

  • EPMABatchclient - Syntax (to load .dat file HFM)

    Hi Everyone,
    Does anyone know how to execute a .dat flatfile using the batch client? Any suggestions on the syntaxt to execute this a data load?
    Thank you.

    If you are talking about loading a file with an import profile, it is pretty easy. Below iis an example. Oracle has a doc on how to use this that is very helpful as well.
    [HTML Documentation|http://docs.oracle.com/cd/E17236_01/epm.1112/epma_batch_user/launch.html]
    [PDF Documentation|http://docs.oracle.com/cd/E17236_01/epm.1112/epma_batch_user.pdf]
    BATCH FILE - this will copy the error log to a common location and time stamp it, as well as return an error code for use with applications like Control M
    set today=%date:~-4%_%date:~4,2%_%date:~7,2%
    call E:\APPS\Oracle\Middleware\EPMSystem11R1\products\Foundation\BPMA\EPMABatchClient\epma-batch-client.bat -C"E:/DATA/HyperionScripts/Scripts/hier_FinPln.txt" -R"E:/DATA/HyperionScripts/DataFiles/Logs/dimBuild_FinPln_err_%today%.txt"
    exit %errorlevel%
    REM if %errorlevel% neq 0 exit /b %errorlevel%
    zip -m E:\DATA\HyperionScripts\DataFiles\Logs\hier_FinPln_%today%.zip E:\APPS\Oracle\Middleware\EPMSystem11R1\products\Foundation\BPMA\EPMABatchClient\output\*.*
    exit %ReturnCode%
    COMMAND FILE - The file referenced in the above batch file
    //StopOnError
    option StopOnError = true;
    //EchoComments
    option EchoComments = true;
    //LogCommands
    option LogCommands = true;
    set bpmaserverurl=http://servername/hyperion-bpma-server;
    set workspaceurl=http://servername:19000/workspace;
    Login username,userpassword;
    // Import Account
    Execute Import
    Parameters(importtype, profilename , filename , waitforcompletion)
    Values('flatfile', 'AccountsWith2UDAs', 'E:\DATA\HyperionScripts\DataFiles\Inbound\hier_Account.ADS', 'true');
    There are a ton of things you can do with the batch utility, including the automation of deleting members and making property changes. Just about anything you can do in the dim library can be automated.
    Kyle Goodfriend
    http://www.in2hyperion.com
    Please make sure you assign your post as answered when an appropriate answer is provided (or helpful when applicable) so others benefit.

  • Syntax for validating data..

    Hi friends
    I have one internal table with material no.,i want o check wheather that data is there in standard table or not..
    how to check..?
    and after checking if that particular material is not there i have to move the data in other internal table..
    plz give me one example also..

    For material MARA is the master table.
    Check the table before selecting the data.
    whether the material avilable or not?
    tables : mara.
    selection-screen begin................
    parameter p_matnr like mara-matnr.
    selection-screen end of..................
    if p_matnr is not initial.
    at selection-screen on p_matnr.
    select single * from mara into mara where matnr = p_matnr.
    if sy-subrc <> 0.
    Raise the message.
    endif.
    endif.
    Hope it will help you.
    Regards,
    Madan.
    Edited by: Madan kurapati on May 19, 2008 11:36 AM

  • Using XSL to remove redundant data

    I am trying to produce an XML document from information on our 9i database. Using XDK I am able to produce the following XML document very easily:
    <ROWSET>
      <ROW num="1">
        <CUSTOMER_ID>1</CUSTOMER_ID>
        <CUSTOMER_NAME>Cust 1</CUSTOMER_NAME>
        <ORDER_NO>1</ORDER_NO>
        <ORDER_DESC>The first customer's first order</ORDER_DESC>
      </ROW>
      <ROW num="2">
        <CUSTOMER_ID>1</CUSTOMER_ID>
        <CUSTOMER_NAME>Cust 1</CUSTOMER_NAME>
        <ORDER_NO>2</ORDER_NO>
        <ORDER_DESC>The first customer's second order</ORDER_DESC>
      </ROW>
      <ROW num="3">
        <CUSTOMER_ID>2</CUSTOMER_ID>
        <CUSTOMER_NAME>Cust 2</CUSTOMER_NAME>
        <ORDER_NO>3</ORDER_NO>
        <ORDER_DESC>The first customer's third order</ORDER_DESC>
      </ROW>
      <ROW num="4">
        <CUSTOMER_ID>2</CUSTOMER_ID>
        <CUSTOMER_NAME>Cust 2</CUSTOMER_NAME>
        <ORDER_NO>4</ORDER_NO>
        <ORDER_DESC>The second customer's first order</ORDER_DESC>
      </ROW>
      <ROW num="5">
        <CUSTOMER_ID>2</CUSTOMER_ID>
        <CUSTOMER_NAME>Cust 2</CUSTOMER_NAME>
        <ORDER_NO>5</ORDER_NO>
        <ORDER_DESC>The second customer's second order</ORDER_DESC>
      </ROW>
      <ROW num="6">
        <CUSTOMER_ID>3</CUSTOMER_ID>
        <CUSTOMER_NAME>Cust 3</CUSTOMER_NAME>
        <ORDER_NO>6</ORDER_NO>
        <ORDER_DESC>The third customer's only order</ORDER_DESC>
      </ROW>
    </ROWSET>I would like to convert it into the following format:
    <CUSTOMER>
      <ID>1</ID>
      <NAME>Cust 1</NAME>
      <ORDERS>
        <ORDER>
          <NO>1</NO>
          <DESC>The first customer's first order</DESC>
        </ORDER>
        <ORDER>
          <NO>2</NO>
          <DESC>The first customer's second order</DESC>
        </ORDER>
      </ORDERS>
    </CUSTOMER>I presume XSL can do this, but I'm not sure where to start. Could anyone confirm if this is possible, and if so point me in the right direction?
    Thanks in advance,
    Paul.

    Yes, an XSLT can do this. There are a number of free XSL tutorials on the web you can look at to get the basic ideas; when you're ready, I know of no better reference than O'Reilly's XSLT.
    XSL, IIRC, is Turing-complete, so there's very little it can't do. But if you're accustomed to procedural scripting you'll have to rewire a bit of your brain, because it is not procedural. Good luck and have fun!

  • Syntax for embeding data bound values

    This does not work:
    source="@Embed(source='{sourceFile}'))" autoLoad="true"/>
    <mx:String id="sourceFile">file:///C|/FlexWork/flex
    maps/assets/products/Talby.png</mx:String>
    nor does simply @Embed({sourceFile})
    So what does work?

    Also @Embed(source="{sourceFile}) does not work.
    BTW, can one Embed an XML file
    <mx:XML source={whatever} />
    "Yechezkal Gutfreund" <[email protected]> wrote in
    message
    news:eci6o0$juc$[email protected]..
    > This does not work:
    >
    > source="@Embed(source='{sourceFile}'))"
    autoLoad="true"/>
    > <mx:String
    id="sourceFile">file:///C|/FlexWork/flex
    > maps/assets/products/Talby.png</mx:String>
    >
    >
    > nor does simply @Embed({sourceFile})
    >
    > So what does work?
    >
    >
    >

  • Syntax for Data Pump in Oracle Database 11g

    Hi, thanks to all. i myself clarifying many doubts by refering the POSTS in this Forum.
    I need the syntax for the Data Pump in Oracle 11g.
    Could you post the syntax plese.
    Thanks & Regards..

    Hello,
    You may have all the options in Datapump by typing the statements belows:
    expdp help=y
    impdp help=yElse, you'll have much more details and examples in the Utilities book from Oracle 11g documentation on the link below:
    http://www.comp.dit.ie/btierney/Oracle11gDoc/server.111/b28319/part_dp.htm#i436481
    Hope this help.
    Best regards,
    Jean-Valentin
    Edited by: Lubiez Jean-Valentin on Apr 19, 2010 11:07 PM

Maybe you are looking for