How to check duplicate entries in internal table??

Dear Friends,
How to check duplicate entries in internal table??
Exp: In my internal table if I am having the same records more then ones then I need to print the error message, here I am using steploop for selecting the values from screen, and the values are coming into my internal table if user enter the same value more then ones I need to print the error message.
Thanks,
Sridhar

Hi,
After storing the data into internal table say ITAb, move the data into another internal table.
t_dup[] = itab[].
LOOP AT itab.
    count1 = count1 + 1.
    itab-count1 = count1.
    MODIFY itab.
ENDLOOP.
LOOP AT t_dup.
    count2 = count2 + 1.
    t_dup-count2 = count2.
    MODIFY t_dup.
ENDLOOP.
  DELETE ADJACENT DUPLICATES FROM itab.
  LOOP AT t_dup.
    record_dup = 'N'.
    READ TABLE itab WITH KEY count1 = t_dup-count2.
    IF sy-subrc = 0.
      record_dup = 'Y'.
    ENDIF.
    IF record_dup NE 'Y'.
      t_dup-message = 'DUPLICATE ENTRY'.
      t_dup-flag = 1.
      MODIFY t_dup.
    ENDIF.
  ENDLOOP.
Use this sample code.
Reward pts if it is helpfull.
Regards
Srimanta

Similar Messages

  • Checking the entries in internal table with Ztable

    Hi ,
      Please go through the below requirement and please give me the code.
    I am having an internal table ITAB with 5 entries and also having a Ztable with 10 entries. I should check weather any of the entry in the internal table ITAB  is present in the Ztable or not?
    Please give me the code
    Thanks in advance,
    Ajay

    Select f1 f2 f3 from ztable into itab1 "say ur ztab entries
    *now say ur itab contents are in itab2.
    sort itab2 by f1 " set the primary key in both .
    delete adjacent duplicates from itab2 comparing f1.
    Loop at itab2.
    read table itab1 with key f1 =  itab2-f1.
    if sy-subrc eq 0 .
    write:/ 'Entry exists '.
    endif.
    endloop.
    On every sy-subrc hit i.e eq 0 write statement tells u a hit and no of times = number of the entries.
    Vijay.

  • How to delete the entries in internal table

    Hi Experts,
    I have 2 internal tables ,
    if i find any same entries of 2 internal tables,  i have to delete that entries in first internal table.
    Regards,
    Srinivasu

    hi check this..
    report .
    data:begin of itab occurs 0,
         f1 type c ,
         f2 type i,
         end of itab .
    data:begin of itab1 occurs 0,
         f1 type c ,
         end of itab1 .
         itab-f1 = 'A'.
         itab-f2 = 12.
         append itab .
         itab-f1 = 'b'.
         itab-f2 = 12.
         append itab .
         itab-f1 = 'c'.
         itab-f2 = 12.
         append itab .
         itab1-f1 = 'A'.
         append itab1 .
    loop at itab1 .
    read table itab with key f1 = itab1-f1 .
    if sy-subrc  = 0.
    delete itab where  f1 = itab1-f1 .
    endif .
    endloop.
    loop at itab.
    write:/ itab-f1,itab-f2.
    endloop.

  • Duplicate Entries in Internal table

    Hi All,
    As per my requirement
    1. The internal table is the input.
    2. I need the duplicate records of the internal table with the combination of 2 key fields.
    3. I should not use SORT because i need the index number in order as per in the table .
    EX : Take Table MSEG.
    Take key fields as MBLNR and WERKS.
    I want the duplicate records of the combination of these 2 key fields.
    The *Index Number * should not to be changed as per the table entry. ( So i avoided sorting the internal table)
    Kindly give some solutions.
    Thanks,
    Pradeep.
    Moderator message : Duplicate post locked,follow forum Rules of Engagement. Thread locked.
    Edited by: Vinod Kumar on Mar 1, 2012 4:59 PM

    Hi Pradeep,
    Try this...
    first you copy your internal table to another temporary table of same type.
    itab_temp[] = itab[].
    sort itab_temp[].
    DELETE ADJACENT DUPLICATES FROM ITAB COMPARING MBLNR WERKS.
    LOOP AT ITAB_TEMP INTO WA_ITAB1.
    DO.
        READ TABLE ITAB INTO WA_ITAB2 WITH KEY MBLNR = WA_ITAB1-MBLNR AND  WERKS = WA_ITAB1-WERKS.
        IF SY-SUBRC EQ 0.
             APPEND WA_ITAB2 TO ITAB_NEW.
        ELSE.
             EXIT.
        ENDIF.
    ENDDO.
    ENDLOOP.
    you may get the duplicate records in itab_new.

  • Duplicate Entries in Internal Tables

    Hallo Friends,
    It Would be nice if some one let me know, if there is a way in ABAP to select the duplicates records in an internal tables.
    Lets say I have two internal tabels, itabA have following structure:
    BNAME  |          WORKAREA   |   ROLES
    abc |             wa1 |          ro1
    cde  |            wa1 |          ro1
    cde  |      wa3 |          rol..
    abc  |      wa2 |          rol2
    xyz |       wa1 |          rol3
    xyz  |      wa3  |         rol2..
    the itabB have the following structure:
    WORKAREA |      ROLES|  
    wa1   |         rol1
    wa2  |        rol1
    wa3  |          rol1
    wa4  |          rol1
    Now problem is, I need to select the common WorkAreas from itabA ( which is commom in all BNAME ) in above example it will be workarea wa1. as it is commom in all i.e ( abc ,cde and xyz). I need to select this commom workarea, and then mark it with some flage in itabB ( to display that this workarea is common among the users...)
    Would be nice if some one let me know, is there any way I can select the duplicate rows in an internal table or I have to go one by one and then do some kind of comparision.
    Many thanks,
    Thx in advance....
    Haider

    Hi marek,
    below information might help you.
    The first criterion for comparing internal tables is the number of lines they contain. The more lines an internal table contains, the larger it is. If two internal tables contain the same number of lines, they are compared line by line, component by component. If components of the table lines are themselves internal tables, they are compared recursively. If you are testing internal tables for anything other than equality, the comparison stops when it reaches the first pair of components that are unequal, and returns the corresponding result.
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA: ITAB LIKE TABLE OF LINE,
    JTAB LIKE TABLE OF LINE.
    DO 3 TIMES.
    LINE-COL1 = SY-INDEX.
    LINE-COL2 = SY-INDEX ** 2.
      APPEND LINE TO ITAB.
    ENDDO.
    MOVE ITAB TO JTAB.
    LINE-COL1 = 10. LINE-COL2 = 20.
    APPEND LINE TO ITAB.
    IF ITAB GT JTAB.
    WRITE / 'ITAB GT JTAB'.
    ENDIF.
    APPEND LINE TO JTAB.
    IF ITAB EQ JTAB.
    WRITE / 'ITAB EQ JTAB'.
    ENDIF.
    LINE-COL1 = 30. LINE-COL2 = 80.
    APPEND LINE TO ITAB.
    IF JTAB LE ITAB.
    WRITE / 'JTAB LE ITAB'.
    ENDIF.
    LINE-COL1 = 50. LINE-COL2 = 60.
    APPEND LINE TO JTAB.
    IF ITAB NE JTAB.
    WRITE / 'ITAB NE JTAB'.
    ENDIF.
    IF ITAB LT JTAB.
    WRITE / 'ITAB LT JTAB'.
    ENDIF.
    The output is:
    ITAB GT JTAB
    ITAB EQ JTAB
    JTAB LE ITAB
    ITAB NE JTAB
    ITAB LT JTAB
    This example creates two standard tables, ITAB and JTAB. ITAB is filled with 3 lines and copied to JTAB. Then, another line is appended to ITAB and the first logical expression tests whether ITAB is greater than JTAB. After appending the same line to JTAB, the second logical expression tests whether both tables are equal. Then, another line is appended to ITAB and the third logical expressions tests whether JTAB is less than or equal to ITAB. Next, another line is appended to JTAB. Its contents are unequal to the contents of the last line of ITAB. The next logical expressions test whether ITAB is not equal to JTAB. The first table field whose contents are different in ITAB and JTAB is COL1 in the last line of the table: 30 in ITAB and 50 in JTAB. Therefore, in the last logical expression, ITAB is less than JTAB.
    reward with points and close the thread if your question is solved
    regards,
    venu.

  • Checking every entry into internal table

    hii i have taken material from lips in first internal table and material from vepo in second internal table
    now i want only those entries in second table which r present in first table.
    one delivery can have multiple materials in it.
    please provide logic.. <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Feb 12, 2008 2:45 PM

    LOOP AT itab2.
    lv_index = sy-index.
        READ TABLE itab1 WITH KEY matnr = itab2-matnr.
        IF sy-subrc NE 0.
          DELETE itab2 AT INDEX lv_index.
         ENDI.
    ENDLOOP.
    At the end of loop itab2 will have only entries available in itab1.
    Regards
    Sudhir Atluru

  • How to check duplicate in a very large table

    How  to  check duplicate  value (say mobile number) in a table  having 50 million records

    I need  to  know whether  the data(Mobile Number)  is  already  there  in  the  table whenever a new  row  is  inserted
    You can also use the MERGE statement and the WHEN NOT MATCHED clause to insert rows only if that value is not there.
    But if you are just checking the one column then a unique index would do it.
    Does that column allow a NULL value?
    Do you care about existing duplicate values?
    If you only want to check NEW inserts then create a UNIQUE constraint and use the ENABLE NOVALIDATE clause:
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/clauses002.htm
      ENABLE NOVALIDATE ensures that all new DML operations on the constrained data comply with the constraint. This clause does not ensure that existing data in the table complies with the constraint.
    That will check new data but leave the old data alone - no performance hit for the old data.

  • Capturing check box value into internal table

    Hi all,
    I am displaying the output including check box through following internal table.
    The checkbox is displayed before every record.
      <b>LOOP AT it_qals.
        WRITE:/  it_qals-t_val  AS CHECKBOX,
               5 it_qals-werk,
              12 it_qals-prueflos,
              30 it_qals-matnr,
              50 it_qals-charg,
              62 it_qals-lagortchrg.
        hide: it_qals .
      ENDLOOP.</b>
    I selected some of the records through check the checkboxes. when i click the <b>PUSHBUTTON TRANSFER</b>, those selected records only should transfer. i don't know how to modify the internal table with latest checkbox values. Initially checkbox values are blank.
    Is there any solution except Function Module.
    i would appreciate an earlier reply.
    Regards
    Prabhu

    Hello,
    Create one more table and transfer your entries into new table.
    I have attached my code for you.
    Regards,
    Naimesh
    REPORT ZTEST_NP NO STANDARD PAGE HEADING.
    TABLES: MARA, MAKT.
    DATA: BEGIN OF IT_MARA OCCURS 0,
          MATNR LIKE MARA-MATNR,
          MAKTX LIKE MAKT-MAKTX,
          SEL,
          END   OF IT_MARA.
    DATA: IT_MARA1 LIKE IT_MARA OCCURS 0 WITH HEADER LINE.
    START-OF-SELECTION.
      SET PF-STATUS 'ZTEST'.
      PERFORM GET_DATA.
      PERFORM WRITE_DATA.
    TOP-OF-PAGE.
      PERFORM HEADER.
    AT USER-COMMAND.
      CASE SY-UCOMM.
      WHEN 'SELECT'.
        PERFORM GET_DATA_SELECTED.
        PERFORM WRITE_DATA_SELE.
      WHEN 'SELALL'.
        PERFORM SELECT_ALL.
        SY-LSIND = 0.
        PERFORM HEADER.
        PERFORM WRITE_DATA.
      WHEN 'DESEL'.
        PERFORM DESELECT_ALL.
        SY-LSIND = 0.
        PERFORM HEADER.
        PERFORM WRITE_DATA.
      ENDCASE.
    *&      Form  GET_DATA
    FORM GET_DATA.
      SELECT MATNR
             INTO TABLE IT_MARA
             FROM MARA
             WHERE MATNR LIKE 'IN10020%'.
      LOOP AT IT_MARA.
        SELECT SINGLE MAKTX
               INTO   IT_MARA-MAKTX
               FROM   MAKT
               WHERE  MATNR = IT_MARA-MATNR
               AND    SPRAS = SY-LANGU.
        MODIFY IT_MARA.
        CLEAR  IT_MARA.
      ENDLOOP.
    ENDFORM.                    " GET_DATA
    *&      Form  WRITE_DATA
    FORM WRITE_DATA.
      ULINE /(50).
      LOOP AT IT_MARA.
        WRITE: / '|' NO-GAP,   IT_MARA-SEL AS CHECKBOX NO-GAP,
                 '|' NO-GAP, (10) IT_MARA-MATNR NO-GAP,
                 '|' NO-GAP, (35) IT_MARA-MAKTX NO-GAP,
                 '|' NO-GAP.
      ENDLOOP.
      ULINE /(50).
    ENDFORM.                    " WRITE_DATA
    *&      Form  HEADER
    FORM HEADER.
      ULINE /(50).
      WRITE: / '|' NO-GAP, (1) ' ' NO-GAP,
               '|' NO-GAP, (10) 'Material'    NO-GAP,
               '|' NO-GAP, (35) 'Description' NO-GAP,
               '|' NO-GAP.
    ENDFORM.                    " HEADER
    *&      Form  GET_DATA_SELECTED
    FORM GET_DATA_SELECTED.
      DATA:  L_CNT TYPE I.
      DO.
        L_CNT = L_CNT + 1.
        READ LINE L_CNT FIELD VALUE IT_MARA-MATNR INTO IT_MARA1-MATNR
                                    IT_MARA-MAKTX INTO IT_MARA1-MAKTX
                                    IT_MARA-SEL   INTO IT_MARA1-SEL.
        IF SY-SUBRC = 0.
          IF IT_MARA1-SEL = 'X'.
            APPEND IT_MARA1.
            CLEAR  IT_MARA1.
          ENDIF.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.                    " GET_DATA_SELECTED
    *&      Form  WRITE_DATA_SELE
    FORM WRITE_DATA_SELE.
      PERFORM HEADER.
      ULINE /(50).
      LOOP AT IT_MARA1.
        WRITE: / '|' NO-GAP,   IT_MARA1-SEL AS CHECKBOX,
                 '|' NO-GAP, (10) IT_MARA1-MATNR NO-GAP,
                 '|' NO-GAP, (35) IT_MARA1-MAKTX NO-GAP,
                 '|' NO-GAP.
      ENDLOOP.
      ULINE /(50).
    ENDFORM.                    " WRITE_DATA_SELE
    *&      Form  SELECT_ALL
    FORM SELECT_ALL.
      LOOP AT IT_MARA.
        IT_MARA-SEL = 'X'.
        MODIFY IT_MARA.
        CLEAR  IT_MARA.
      ENDLOOP.
    ENDFORM.                    " SELECT_ALL
    *&      Form  DESELECT_ALL
    FORM DESELECT_ALL.
      LOOP AT IT_MARA.
        IT_MARA-SEL = ' '.
        MODIFY IT_MARA.
        CLEAR  IT_MARA.
      ENDLOOP.
    ENDFORM.                    " DESELECT_ALL

  • Deleting entry from internal table

    Hi Experts,
    i have the following internal table:
    data :    it_result1            TYPE   crmt_object_guid_tab
    and work area
    data : wa_result1 type crmt_object_guid.
    i have to delete a guid from internal table based on some condition.
    loop at it_resul1 into wa_result1
    if lv_priority eq priority.
    delete     this entry from internal table.
    endif.
    endloop..
    i tried using  delete table it_result with table key CRMT_OBJECT_GUID = wa_result. but this is giving syntax error.
    what should be done to delete the entry?
    Thanks and regards
    Shilpi

    Hi
    Check Syntax for DELETE operator on pressing F1
    1. DELETE itab.
    2. DELETE TABLE itab WITH TABLE KEY k1 = v1 ... kn = vn.
    3. DELETE TABLE itab [FROM wa].
    4. DELETE itab INDEX idx.
    5. DELETE itab FROM idx1 TO idx2.
    6. DELETE itab WHERE logexp.
    7. DELETE ADJACENT DUPLICATES FROM itab.
    delete table it_result with table key CRMT_OBJECT_GUID = wa_result
    this is wrong
    delete  it_result where CRMT_OBJECT_GUID = wa_result
    Edited by: Lavanya K on Apr 22, 2009 10:20 AM

  • How to Download XML File to internal table

    Hi Friends,
    This is my urgent requirement. How to download XML File to Internal table.
    regards
    pauldharma

    Hai,
    Please check this Link
    http://www.sap-img.com/abap/upload-direct-excel.htm
    PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
                begcol TYPE i DEFAULT 1 NO-DISPLAY,
                begrow TYPE i DEFAULT 1 NO-DISPLAY,
                endcol TYPE i DEFAULT 100 NO-DISPLAY,
                endrow TYPE i DEFAULT 32000 NO-DISPLAY.
    * Tick don't append header
    PARAMETERS: kzheader AS CHECKBOX.
    DATA: BEGIN OF intern OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern.
    DATA: BEGIN OF intern1 OCCURS 0.
            INCLUDE STRUCTURE  alsmex_tabline.
    DATA: END OF intern1.
    DATA: BEGIN OF t_col OCCURS 0,
           col LIKE alsmex_tabline-col,
           size TYPE i.
    DATA: END OF t_col.
    DATA: zwlen TYPE i,
          zwlines TYPE i.
    DATA: BEGIN OF fieldnames OCCURS 3,
            title(60),
            table(6),
            field(10),
            kz(1),
          END OF fieldnames.
    * No of columns
    DATA: BEGIN OF data_tab OCCURS 0,
           value_0001(50),
           value_0002(50),
           value_0003(50),
           value_0004(50),
           value_0005(50),
           value_0006(50),
           value_0007(50),
           value_0008(50),
           value_0009(50),
           value_0010(50),
           value_0011(50),
           value_0012(50),
           value_0013(50),
           value_0014(50),
           value_0015(50),
           value_0016(50),
           value_0017(50),
           value_0018(50),
           value_0019(50),
           value_0020(50),
           value_0021(50),
           value_0022(50),
           value_0023(50),
           value_0024(50),
           value_0025(50),
           value_0026(50),
           value_0027(50),
           value_0028(50),
           value_0029(50),
           value_0030(50),
           value_0031(50),
           value_0032(50),
           value_0033(50),
           value_0034(50),
           value_0035(50),
           value_0036(50),
           value_0037(50),
           value_0038(50),
           value_0039(50),
           value_0040(50),
           value_0041(50),
           value_0042(50),
           value_0043(50),
           value_0044(50),
           value_0045(50),
           value_0046(50),
           value_0047(50),
           value_0048(50),
           value_0049(50),
           value_0050(50),
           value_0051(50),
           value_0052(50),
           value_0053(50),
           value_0054(50),
           value_0055(50),
           value_0056(50),
           value_0057(50),
           value_0058(50),
           value_0059(50),
           value_0060(50),
           value_0061(50),
           value_0062(50),
           value_0063(50),
           value_0064(50),
           value_0065(50),
           value_0066(50),
           value_0067(50),
           value_0068(50),
           value_0069(50),
           value_0070(50),
           value_0071(50),
           value_0072(50),
           value_0073(50),
           value_0074(50),
           value_0075(50),
           value_0076(50),
           value_0077(50),
           value_0078(50),
           value_0079(50),
           value_0080(50),
           value_0081(50),
           value_0082(50),
           value_0083(50),
           value_0084(50),
           value_0085(50),
           value_0086(50),
           value_0087(50),
           value_0088(50),
           value_0089(50),
           value_0090(50),
           value_0091(50),
           value_0092(50),
           value_0093(50),
           value_0094(50),
           value_0095(50),
           value_0096(50),
           value_0097(50),
           value_0098(50),
           value_0099(50),
           value_0100(50).
    DATA: END OF data_tab.
    DATA: tind(4) TYPE n.
    DATA: zwfeld(19).
    FIELD-SYMBOLS: <fs1>.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                mask      = '*.xls'
                static    = 'X'
           CHANGING
                file_name = filename.
    START-OF-SELECTION.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = filename
                i_begin_col             = begcol
                i_begin_row             = begrow
                i_end_col               = endcol
                i_end_row               = endrow
           TABLES
                intern                  = intern
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc <> 0.
        WRITE:/ 'Upload Error ', SY-SUBRC.
      ENDIF.
    END-OF-SELECTION.
      LOOP AT intern.
        intern1 = intern.
        CLEAR intern1-row.
        APPEND intern1.
      ENDLOOP.
      SORT intern1 BY col.
      LOOP AT intern1.
        AT NEW col.
          t_col-col = intern1-col.
          APPEND t_col.
        ENDAT.
        zwlen = strlen( intern1-value ).
        READ TABLE t_col WITH KEY col = intern1-col.
        IF sy-subrc EQ 0.
          IF zwlen > t_col-size.
            t_col-size = zwlen.
    *                          Internal Table, Current Row Index
            MODIFY t_col INDEX sy-tabix.
          ENDIF.
        ENDIF.
      ENDLOOP.
      DESCRIBE TABLE t_col LINES zwlines.
      SORT intern BY row col.
      IF kzheader = 'X'.
        LOOP AT intern.
          fieldnames-title = intern-value.
          APPEND fieldnames.
          AT END OF row.
            EXIT.
          ENDAT.
        ENDLOOP.
      ELSE.
        DO zwlines TIMES.
          WRITE sy-index TO fieldnames-title.
          APPEND fieldnames.
        ENDDO.
      ENDIF.
      SORT intern BY row col.
      LOOP AT intern.
        IF kzheader = 'X'
        AND intern-row = 1.
          CONTINUE.
        ENDIF.
        tind = intern-col.
        CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
        ASSIGN (zwfeld) TO <fs1>.
        <fs1> = intern-value.
        AT END OF row.
          APPEND data_tab.
          CLEAR data_tab.
        ENDAT.
      ENDLOOP.
      CALL FUNCTION 'DISPLAY_BASIC_LIST'
           EXPORTING
                file_name     = filename
           TABLES
                data_tab      = data_tab
                fieldname_tab = fieldnames.
    *-- End of Program
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/excel-file-download-to-an-internal-table-in-sap-crm-1719453#
    tables: zinv_release,
    zpo_release.
    ** decleration of data
    DATA: BEGIN OF my_tab OCCURS 0.
    INCLUDE STRUCTURE zinv_release.
    DATA: END OF my_tab.
    *DATA: hex_tab TYPE x VALUE '09'.
    DATA: rec(200)."'/usr/test.dat'.
    DATA:
    zhours(20) TYPE c,
    MINS(20) type c. "decimals.
    data: coma.
    coma = ','.
    SELECTION-SCREEN BEGIN OF BLOCK txt
    WITH FRAME TITLE text-001.
    PARAMETERS: dsn(60) DEFAULT '\\sapdev01\prod\'.
    SELECTION-SCREEN END
    OF BLOCK txt.
    *using a dataset to get text
    OPEN DATASET dsn FOR INPUT IN TEXT MODE.
    IF sy-subrc = 0.
    DO.
    READ DATASET dsn INTO rec.
    IF sy-subrc <> 0.
    EXIT.
    ENDIF.
    split rec at coma into
    zpo_release-REL_GRP
    zpo_release-REL_CODE
    zpo_release-RESPREL
    zpo_release-ALTREL
    zpo_release-MANAGER
    ZHOURS
    MINS
    zpo_release-FROMTIME
    zpo_release-TOTIME
    zpo_release-EXCLWKENDS.
    move zpo_release-REL_GRP to my_tab-REL_GRP.
    move zpo_release-REL_CODE to my_tab-REL_CODE.
    move zpo_release-RESPREL to my_tab-RESPREL.
    move zpo_release-ALTREL to my_tab-ALTREL.
    move zpo_release-MANAGER to my_tab-MANAGER.
    move ZHOURS to my_tab-ZHOURS.
    move MINS to my_tab-mins.
    move zpo_release-FROMTIME to my_tab-fromtime.
    move zpo_release-TOTIME to my_tab-totime.
    move zpo_release-EXCLWKENDS to my_tab-exclwkends.
    APPEND my_tab.
    ENDDO.
    INSERT zpo_release FROM TABLE my_tab ACCEPTING DUPLICATE KEYS.
    ** DELETE zmm_ppa_cc FROM TABLE tab.
    ** INSERT zzzak_emp FROM TABLE my_tab ACCEPTING DUPLICATE KEYS.
    IF sy-subrc = 0.
    MESSAGE i000(zv) WITH 'File Successful stored in DB.' '' '' ''.
    ** ELSE.
    MESSAGE i000(zv) WITH 'File already stored in DB.' '' '' ''.
    endif.
    ENDIF.
    reward if helpful
    raam

  • How to find latest entry in the table according to time

    how to find latest entry in the table according to the time
    is there any function module to do so
    \[removed by moderator\]
    Regards
    Shashi
    Edited by: Jan Stallkamp on Aug 25, 2008 4:39 PM

    Hi,
    If you want to read the entry from an internal table,
    sort the internal table in the descending order by the time and
    delete adjacent duplicates by comparing the fields other than time and the internal table will have the latest record.
    Suggestion: instead of only time try to have one more field called date with the time combination
    Regards,
    Ramesh

  • How to move data from 2 internal table to 1 internal table

    Can any body send me code that how to move data from 2 internal table into one internal table.
    Moderator message : Read ABAP documentation. Thread locked.
    Edited by: Vinod Kumar on Jun 13, 2011 11:45 AM

    Hi Mohdarif92;
    I don't know your full needs. But general method should be as below code.
    Please check exam below code.
    Best regards.
    data : begin of gt_result.
                ... like mkpf-...
                ... like mkpf-...
                ... like mseg-...
                ... like mseg-...
              end of gt_result
    select *
    into table gt_mkpf
    from mkpf where ...
    select *
    into table mseg
    from mseg where ...
    loop at gt_mkpf.
         loop at gt_mseg where ... = mkpf-...
            move-corresponding gt_mkpf to gt_result.
            move-corresponding gt_mseg to gt_result.
            append gt_result
         endloop.
    endloop.

  • Short dumop in J2I5 (provide duplicate entry in Standard table)

    Hello Expert ,
                              We have a problem in  T.Code J2I5  ( Excise Register Extraction) input entry is lelect Excise group 20 . and a date   from 04.08.09 onwards. and select the register RG23D . it shows the run time error  ( Eg The ABAP/4 Open SQL array insert results in duplicate database record ) .  but in the standard Tcode is there possible to provide duplicate entry in Standard table
    Thaks & regards
    Aditya Kr Tripathi

    Runtime Errors         SAPSQL_ARRAY_INSERT_DUPREC
    Except.                CX_SY_OPEN_SQL_DB
    Date and Time          29.01.2010 10:57:09
    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
    problem occurs in this code :
       assign I_RG23D_TAB-I_RG23D_TYP to <x_rg23dtyp> casting.
       <x_extrctdata> = <x_rg23dtyp>.
        class CL_ABAP_CONTAINER_UTILITIES definition load.
        call method CL_ABAP_CONTAINER_UTILITIES=>FILL_CONTAINER_C
          EXPORTING
            IM_VALUE               = i_rg23d_tab-i_rg23d_typ
          IMPORTING
            EX_CONTAINER           = i_report_tab-extrctdata
          EXCEPTIONS
            ILLEGAL_PARAMETER_TYPE = 1
            others                 = 2.
       I_REPORT_TAB-EXTRCTDATA = I_RG23D_TAB-I_RG23D_TYP.
        COMPUTE I_REPORT_TAB-EXTRCTLNGT = STRLEN( I_REPORT_TAB-EXTRCTDATA ).
        APPEND I_REPORT_TAB.
      ENDLOOP.
      IF M_EXTRACTED = 'X'.
        LOOP AT I_RG23D_KEY.
          DELETE
          FROM  J_2IEXTRCT
          WHERE BUDAT    = I_RG23D_KEY-BUDAT
          AND   SERIALNO = I_RG23D_KEY-SERIALNO
          AND   REGISTER = I_RG23D_KEY-REGISTER
          AND   EXGRP    = I_RG23D_KEY-EXGRP.
        ENDLOOP.
      ENDIF.
    Control table check here for data Extraction
      INSERT J_2IEXTRCT FROM TABLE I_REPORT_TAB.
    If the insertion of the extract table is successfull then the table
    for Extraction is Inserted
      IF SY-SUBRC EQ 0.
        PERFORM FILL_EXTDT USING C_RG23D M_EXTRACTED.
      ENDIF.
    ENDFORM.                                                    " RG23D
    *&      Form  RG23CPART1
    Purpose : RG23C Part I extraction logic
    FORM RG23CPART1.
      DATA: $PART1      TYPE PART1_TYP,
            $LINCNT     LIKE SY-LINCT,
            M_EXTRACTED VALUE '',
            $RC         LIKE SY-SUBRC.
    *********************************************************************************************8

  • Removing duplicates in the Internal Table

    Dear friends,
      Could any one of you kindly help me with a code to delete the duplicates in the internal table, but each duplicate should be counted, how many times that appeared and should be displayed again as a report with the messages and no of times that message appeared.
    Thank you,
    Best Regards,
    subramanyeshwer

    You can try something like this.
    report zrich_0001.
    data: begin of itab1 occurs 0,
          fld1 type c,
          fld2 type c,
          fld3 type c,
          end of itab1.
    data: begin of itab2 occurs 0,
          fld1 type c,
          fld2 type c,
          fld3 type c,
          end of itab2.
    data: counter type i.
    itab1 = 'ABC'.  append itab1.
    itab1 = 'DEF'.  append itab1.
    itab1 = 'GHI'.  append itab1.
    itab1 = 'DEF'.  append itab1.
    itab1 = 'GHI'.  append itab1.
    itab1 = 'DEF'.  append itab1.
    itab2[] = itab1[].
    sort itab1 ascending.
    delete adjacent duplicates from itab1.
    loop at itab1.
    clear counter.
      loop at itab2 where fld1 = itab1-fld1
                     and  fld2 = itab1-fld2
                     and  fld3 = itab1-fld3.
        counter = counter + 1.
      endloop.
    write:/ itab1-fld1, itab1-fld2, itab1-fld3,
             'Number of occurances:', counter.
    endloop.
    Regards,
    Rich Heilman

  • How do we pass values and Internal tables to Sub-routines

    how do we pass values and Internal tables to Sub-routines

    Hi,
    You can use the USING..or TABLES..or Changing addition..
    Check this example.
    DATA: T_MARA TYPE STANDARD TABLE OF MARA.
    PERFORM DISPLAY USING T_MARA.
    FORM DISPLAY USING LT_MARA LIKE T_MARA.
    DATA: WA TYPE MARA.
    LOOP AT LT_MARA INTO WA.
      WRITE: / WA-MATNR.
    ENDLOOP.
    ENDFORM.
    Thanks
    Naren

Maybe you are looking for

  • Binding an XML file into LiveCycle

    Currently we are using a .dat file to populate a .docx file, but we are having issues with layout and formatting and I want to switch it to using a PDF. I have found lots of information on adding an XML Data Connection to a PDF, but nothing to do wit

  • Music via MIDI ... anyone?

    I've created a number of MIDI projects in Java. These are fun music education games that kids really like to play. I want to rewrite them in Flash or Flex (obviously because Java's Swing interface is pretty bland, and because Flash, Flex and ActionSc

  • I have two albums that are on my itunes but i cant get them on my ipod

    i have just uploaded my cds onto my itunes two albums cant be named so ive done it by hand and when i uploaded it all on to my ipod touch these two albums are not there. how can i put them on?

  • Mac Mail:  Space limitations for work - Reminders / Notes

    Hey there Mac Folks, I'm using Mac Mail to access my work mail but we have significant space limitations on us. I've cleaned up a lot of my mailboxes into my work account but I see all of emails from my current mailboxes listed under Reminders ==> No

  • Hello!!!!!!!!!!!!!!!!!!!! can any one answer me pleaseeeeeeeee

    hello guys can any one answer my questions.......please regards Venkat