Regarding duplicate entries in table control

hi,
   i have created one table control in module pool. while entering values into the table control how can we validate the table control if we enter duplicate values.ie in the first line i entered 200 500 400
again inthe second line i
entered 200 500 400.
validation should tabke place and error msg should be populated. pls help...
i have used the below code.
LOOP AT IT_TC2.
    CHAIN.
      FIELD:ZTC_ATMP-BUKRS,
            ZTC_ATMP-LEGACCNO,
            ZTC_ATMP-ZZDESKCODE,
            ZTC_ATMP-SAKNR.
      MODULE READ_TABLE_CONTROL.
     MODULE check_duplicates ON CHAIN-REQUEST.
    ENDCHAIN.
ENDLOOP.
but here module check_duplicates is not triggering why? any idea..

Hi,
you can try like this...
LOOP AT IT_TC2.
CHAIN.
FIELD ZTC_ATMP-BUKRS module CHK1.
FIELD ZTC_ATMP-LEGACCNO module CHK1.
FIELD ZTC_ATMP-ZZDESKCODE module CHK1.
FIELD ZTC_ATMP-SAKNR module CHK1.
MODULE READ_TABLE_CONTROL.
ENDCHAIN.
ENDLOOP.
Now write the validations for the corresopnding Fields in there Respective Modules.... for example Validation for  ZTC_ATMP-BUKRS  filed in module CHK1 and so on..
Reward if helpful.
Regards,
Syed

Similar Messages

  • Regarding  decimal entry in table control

    Hi,
       i am using one screen which is containing a table control. In that one field is called value(Local Currency value)
      Before that i  have created one table called zuvrate.
    In zuvrate , i have declared 'value'(one field of my table) as dmbtr data type(currency with 13 , 2 ) and
    reference field is t001-waers.
       My problem is, if i enter decimal value in that particular column in my table control, 'please enter numeric value ' error is coming.
      for example if i give 23.34 then error is coming
       elseif i give 23 then ok no error.
      How to enter decimal value in my table control?

    Hi,
    The reference field you have specified i.e. waers has no decimal places. Give the reference field which has the same number of decimal places as you want.
    Hope it helps..
    Lokesh
    pls. reward appropriate points

  • To delete multiple entries in table control in module pool

    Hi,
    Please help me out to know , <b>how to delete multiple entries from table control</b> when multiple lines in table control are selected.
    Regards,
    Irfan Hussain

    hai,
        you can do it inthis way.
    in the PAI event.
    loop at <table control name>
      module del_itab.
    endloop.
    in the nodule,write the folowing code.
    if <tablecontrol>-fieldname = 'X'.
    delete <tablecontrol-itab>
    endif.
    cheers

  • How to insert multiple entries in table control

    Hi All,
    I want to insert multiple entries in table control in BDC program.Can any body help in this regard.
    Thanks,
    Satish.

    Hi,
    Go through the following 2 example programs:
    THis is example to upload the Bank details of the Vendor which has the TC.
    REPORT zprataptable2
           NO STANDARD PAGE HEADING LINE-SIZE 255.
    DATA : BEGIN OF itab OCCURS 0,
            i1 TYPE i,
            lifnr LIKE   rf02k-lifnr,
            bukrs LIKE   rf02k-bukrs,
            ekorg LIKE   rf02k-ekorg,
            ktokk LIKE   rf02k-ktokk,
            anred LIKE lfa1-anred,
            name1 LIKE lfa1-name1,
            sortl LIKE lfa1-sortl,
            land1 LIKE lfa1-land1,
            akont LIKE lfb1-akont,
            fdgrv LIKE lfb1-fdgrv,
             waers LIKE lfm1-waers,
            END OF itab.
    DATA : BEGIN OF jtab OCCURS 0,
            j1 TYPE i,
            banks LIKE lfbk-banks,
            bankl LIKE lfbk-bankl,
            bankn LIKE lfbk-bankn,
             END OF jtab.
    DATA : cnt(4) TYPE n.
    DATA : fdt(20) TYPE c.
    DATA : c TYPE i.
    INCLUDE bdcrecx1.
    START-OF-SELECTION.
      CALL FUNCTION 'WS_UPLOAD'
        EXPORTING
          filename = 'C:\first1.txt'
          filetype = 'DAT'
        TABLES
          data_tab = itab.
      CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         filename                      = 'C:\second.txt'
         filetype                      = 'DAT'
        TABLES
          data_tab                      = jtab.
      LOOP AT itab.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-KTOKK'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'RF02K-LIFNR'
                                      itab-lifnr.
        PERFORM bdc_field       USING 'RF02K-BUKRS'
                                      itab-bukrs.
        PERFORM bdc_field       USING 'RF02K-EKORG'
                                       itab-ekorg.
        PERFORM bdc_field       USING 'RF02K-KTOKK'
                                       itab-ktokk.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0110'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFA1-LAND1'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'LFA1-ANRED'
                                      itab-anred.
        PERFORM bdc_field       USING 'LFA1-NAME1'
                                      itab-name1.
        PERFORM bdc_field       USING 'LFA1-SORTL'
                                      itab-sortl.
        PERFORM bdc_field       USING 'LFA1-LAND1'
                                      itab-land1.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0120'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFA1-KUNNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFBK-BANKN(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        cnt = 0.
        LOOP AT jtab WHERE j1 = itab-i1.
          cnt = cnt + 1.
          CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.
          PERFORM bdc_field  USING fdt jtab-banks.
          CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.
          PERFORM bdc_field USING fdt jtab-bankl.
          CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.
          PERFORM bdc_field   USING fdt jtab-bankn.
          IF cnt = 5.
            cnt = 0.
            PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'LFBK-BANKS(01)'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=P+'.
            PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'LFBK-BANKN(02)'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=ENTR'.
          ENDIF.
        ENDLOOP.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFBK-BANKS(01)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0210'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFB1-FDGRV'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'LFB1-AKONT'
                                      itab-akont.
        PERFORM bdc_field       USING 'LFB1-FDGRV'
                                      itab-fdgrv.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0215'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFB1-ZTERM'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0220'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFB5-MAHNA'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0310'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'LFM1-WAERS'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'LFM1-WAERS'
                                      itab-waers.
        PERFORM bdc_dynpro      USING 'SAPMF02K' '0320'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RF02K-LIFNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM bdc_dynpro      USING 'SAPLSPO1' '0300'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=YES'.
        PERFORM bdc_transaction USING 'XK01'.
      ENDLOOP.
      PERFORM close_group.
    ABAP Name   :   ZMM_PR_UPLOAD_MAT
    Description :   PR Upload BDC Program(With Material)
    Created by  :   Anji Reddy V
    Created on  :   04/11/2004
    Description :   This Program is used to Upload the Purchase
                     Requisition data Using the Transaction ME51N.
      Modification Log:
      Date         Programmer          Correction    Description
      04/11/2004   Anji Reddy          Initial
    REPORT zmm_pr_upload_mat
           NO STANDARD PAGE HEADING
           LINE-SIZE 255.
    Standard Include for Selection Screen
    INCLUDE bdcrecx1.
    Internal Table for Upload Data
    DATA: BEGIN OF i_pr OCCURS 0,
    Header Screen
            sno(3),               " SNo
            bsart(004),           " PR Type
            epstp(001),           " Item Category
            knttp(001),           " Account Assignment
            eeind(010),           " Delivery Date
           lpein(001),          " Category of Del Date
            werks(004),           " Plant
            lgort(004),           " Storage Location
            ekgrp(003),           " Purchasing Group
            matkl(009),           " Material Group
            bednr(010),           " Tracking No
            afnam(012),            " Requisitioner
    Item Details
            matnr(018),           " Material No
            menge(017),           " Quantity
           badat(010),
           frgdt(010),
            preis(014),           " Valuation Price
           waers(005),           " Currency
           peinh(005),
           wepos(001),
           repos(001),
            sakto(010),           " GL Account
            kostl(010),           " Cost Center
           bnfpo(005),
          END OF i_pr.
    Internal Table for header Data
    DATA: BEGIN OF it_header OCCURS 0,
            sno(3),               " SNo
            bsart(004),           " PR Type
            epstp(001),           " Item Category
            knttp(001),           " Account Assignment
            eeind(010),           " Delivery Date
            werks(004),           " Plant
            lgort(004),           " Storage Location
            ekgrp(003),           " Purchasing Group
            matkl(009),           " Material Group
            bednr(010),           " Tracking No
            afnam(012),            " Requisitioner
          END OF it_header.
    Internal Table for Item Data
    DATA: BEGIN OF it_item OCCURS 0,
            sno(3),               " SNo
            matnr(018),           " Material No
            menge(017),           " Quantity
            preis(014),           " Valuation Price
            sakto(010),           " GL Account
            kostl(010),           " Cost Center
          END OF it_item.
    Data Variables & Constants
    CONSTANTS : c_x             VALUE 'X'.  " Flag
    DATA : v_l(2),                          " Counter
           v_rowno(5),                      " Row No
           v_2(2),                          " Counter
           v_rows LIKE sy-srows,            " Rows in TC
           v_field(45).                     " String
    Parameters
    PARAMETERS: p_file LIKE ibipparms-path.  " Filename
    At selection-screen on Value Request for file Name
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    Get the F4 Values for the File
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
        IMPORTING
          file_name     = p_file.
    Start of Selection
    START-OF-SELECTION.
    Open the BDC Session
      PERFORM open_group.
    Upload the File into internal Table
      CALL FUNCTION 'UPLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'DAT'
        TABLES
          data_tab                = i_pr
        EXCEPTIONS
          conversion_error        = 1
          invalid_table_width     = 2
          invalid_type            = 3
          no_batch                = 4
          unknown_error           = 5
          gui_refuse_filetransfer = 6
          OTHERS                  = 7.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      SORT i_pr BY sno.
      LOOP AT i_pr.
        MOVE-CORRESPONDING i_pr TO it_item.
        APPEND it_item.
        CLEAR it_item.
        AT END OF sno.
          READ TABLE i_pr INDEX sy-tabix.
          MOVE-CORRESPONDING i_pr TO it_header.
          APPEND it_header.
          CLEAR it_header.
        ENDAT.
      ENDLOOP.
      SORT it_header BY sno.
      SORT it_item BY sno.
      v_rows = sy-srows - 6.
    Upload the Data from Internal Table
      LOOP AT it_header.
    Header Data
        PERFORM bdc_dynpro      USING 'SAPMM06B' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'EBAN-BEDNR'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM bdc_field       USING 'EBAN-BSART'
                                      it_header-bsart.
        PERFORM bdc_field       USING 'RM06B-EPSTP'
                                      it_header-epstp.
        PERFORM bdc_field       USING 'EBAN-KNTTP'
                                      it_header-knttp.
        PERFORM bdc_field       USING 'RM06B-EEIND'
                                      it_header-eeind.
       PERFORM bdc_field       USING 'RM06B-LPEIN'
                                     it_header-lpein.
        PERFORM bdc_field       USING 'EBAN-WERKS'
                                      it_header-werks.
        PERFORM bdc_field       USING 'EBAN-LGORT'
                                      it_header-lgort.
        PERFORM bdc_field       USING 'EBAN-EKGRP'
                                      it_header-ekgrp.
        PERFORM bdc_field       USING 'EBAN-MATKL'
                                      it_header-matkl.
        PERFORM bdc_field       USING 'EBAN-BEDNR'
                                      it_header-bednr.
        PERFORM bdc_field       USING 'EBAN-AFNAM'
                                      it_header-afnam.
    Item Details
        v_l = 0.
    To add no. of rows
        v_2 = 0 .
    As the screen is showing 13 rows defaulted to 130
        v_rowno = 130 .
        LOOP AT it_item WHERE sno = it_header-sno.
          v_l = v_l + 1.
          IF v_l = 14 .
            IF v_2 = 12 .
              v_2 = 12 .
              v_l = 2 .
    From second time onwards it is displaying 12 rows only
              v_rowno = v_rowno + 120 .
              PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            'RM06B-BNFPO'.
              PERFORM bdc_field       USING 'RM06B-BNFPO'
                                            v_rowno.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                            '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                '/00'.
            ELSE.
    V_2 initialized to 12 for second screen purpose
              v_2 = 12 .
              v_l = 2 .
              PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
              PERFORM bdc_field       USING 'BDC_CURSOR'
                                            'RM06B-BNFPO'.
              PERFORM bdc_field       USING 'RM06B-BNFPO'
                                            v_rowno .
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                            '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                '/00'.
            ENDIF.
          ENDIF.
          PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          CLEAR v_field.
          CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.
          PERFORM bdc_field   USING v_field it_item-matnr.
          CLEAR v_field.
          CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.
          PERFORM bdc_field   USING v_field it_item-menge.
          PERFORM bdc_dynpro      USING 'SAPMM06B' '0102'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'EBAN-PREIS'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '/00'.
          PERFORM bdc_field       USING 'EBAN-PREIS'
                                      it_item-preis.
          PERFORM bdc_dynpro      USING 'SAPMM06B' '0505'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'EBKN-SAKTO'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
          PERFORM bdc_field       USING 'EBKN-SAKTO'
                                      it_item-sakto.
    Cost Center
          PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        'COBL-KOSTL'.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
          PERFORM bdc_field       USING 'COBL-KOSTL'
                                        it_item-kostl.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ENTE'.
        ENDLOOP.
        PERFORM bdc_dynpro      USING 'SAPMM06B' '0106'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RM06B-BNFPO'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=BU'.
    Call The Transaction
        PERFORM bdc_transaction USING 'ME51'.
      ENDLOOP.
    Close the BDC Session
      PERFORM close_group.
    reward for useful answers.
    Regards,
    Anji

  • Transfer entries in Table Control

    Plz tell me how can i transfter entries made in table control into an inertnal table.
    so that I could save all entries of table control into database.
    Regards....

    hi,
    The cells in table control should have the internal table field name.
    then use,
    modify wi_cust1 index tb-current_line.
            if sy-subrc = 0.
              modify zcust_master2 from table wi_cust1.
    where,
    wi_cust1 is the internal table and zcust_master2 is the database table.
    hope this helps,
    Regards,
    Arunsri

  • Duplicate records in TABLE CONTROL

    Hi folks,
    i am doing a module pool where my internal table (itab) data is comming to table ontrol(ctrl).then i need to select one record in table control & then i press REFRESH push button.
    after putting the refresh button, some new records are comming to that same internal table.then i need to display the modified internal table (some new records are added) data in the table control.
    The modified internal table data is comming to the table control but to the last of table control, some records are repeating.
    before comming to table control, i checked the modified itab. it contains correct data.i.e it contains 15 records.(previously i have 5 records.after REFRESH button 10 more records are added.). but when this table is comming to table control, it contains some 100 record.i should get only 15 record.
    why these records r repeting. how to delete the duplicate records from table control?
    plz suggest me where i am doing mistake.
    correct answer will be rewarded
    Thanks & Regards

    Hi ,
    Thanks for ur help. but i should not refresh the internal table  as some records r already present.after putting the REFRESH button, some new records r appending to this existing table.then i am going to display the previous records & the new records as well.
    i checked the internal table after modification.it contains actual number of records. but after comming to table control , more records r comming.
    is this the problem with scrolling or waht?
    plz suggest where i am doing mistake.i am giving my coding below.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0200.
    module tc_shelf_change_tc_attr.
    loop at object_tab1
           with control tablctrl
           cursor tablctrl-current_line.
        module tc_shelf_get_lines.
      endloop.
    PROCESS AFTER INPUT.
    module set_exit AT EXIT-COMMAND.
       loop at object_tab1.
             chain.
              field: object_tab1-prueflos,
                     object_tab1-matnr.
               module shelf_modify on chain-request.
             endchain.
            field object_tab1-idx
             module shelf_mark on request.
                   endloop.
    module shelf_user_command.
    module user_command_0200.
    ***INCLUDE Y_RQEEAL10_STATUS_0200O01 .
    *&      Module  STATUS_0200  OUTPUT
          text
    MODULE STATUS_0200 OUTPUT.
      SET PF-STATUS 'MAIN'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  tc_shelf_change_tc_attr  OUTPUT
          text
    MODULE tc_shelf_change_tc_attr OUTPUT.
    delete adjacent duplicates from object_tab1 comparing prueflos matnr.
    describe table object_tab1 lines tablctrl-lines.
    ENDMODULE.                 " tc_shelf_change_tc_attr  OUTPUT
    *&      Module  tc_shelf_get_lines  OUTPUT
          text
    MODULE tc_shelf_get_lines OUTPUT.
    data:  g_tc_shelf_lines  like sy-loopc.
    if tablctrl-current_line > tablctrl-lines.
    stop.
    endif.
    g_tc_tablctrl_lines = sy-loopc.
    *refresh control tablctrl from screen 0200.
    ENDMODULE.                 " tc_shelf_get_lines  OUTPUT
    ***INCLUDE Y_RQEEAL10_SHELF_MODIFYI01 .
    *&      Module  shelf_modify  INPUT
          text
    MODULE shelf_modify INPUT.
    modify object_tab1
        index tablctrl-current_line.
    ENDMODULE.                 " shelf_modify  INPUT
    *&      Module  set_exit  INPUT
          text
    module set_exit INPUT.
    leave program.
    endmodule.                 " set_exit  INPUT
    *&      Module  shelf_mark  INPUT
          text
    MODULE shelf_mark INPUT.
    data: g_shelf_wa2 like line of object_tab1.
      if tablctrl-line_sel_mode = 1
      and object_tab1-idx = 'X'.
        loop at object_tab1 into g_shelf_wa2
          where idx = 'X'.
          g_shelf_wa2-idx = ''.
          modify object_tab1
            from g_shelf_wa2
            transporting idx.
        endloop.
      endif.
      modify object_tab1
        index tablctrl-current_line
        transporting idx plnty plnnr plnal.
    ENDMODULE.                 " shelf_mark  INPUT
    *&      Module  shelf_user_command  INPUT
          text
    MODULE shelf_user_command INPUT.
    ok_code = sy-ucomm.
      perform user_ok_tc using    'TABLCTRL'
                                  'OBJECT_TAB1'
                         changing ok_code.
      sy-ucomm = ok_code.
    ENDMODULE.                 " shelf_user_command  INPUT
    *&      Module  user_command_0100  INPUT
          text
    MODULE user_command_0200 INPUT.
    data:v_line(3).
    case OK_CODE.
    when 'LAST'.
    read table object_tab1 with key idx = 'X'.
    if sy-subrc = 0.
    select * from qals
                          where enstehdat <= object_tab1-enstehdat
                          and   plnty ne space
                          and   plnnr ne space
                          and   plnal ne space.
    if sy-dbcnt > 0.
    if qals-enstehdat = object_tab1-enstehdat.
       check qals-entstezeit < object_tab1-entstezeit.
       move-corresponding qals to object_tab2.
       append object_tab2.
       else.
       move-corresponding qals to object_tab2.
       append object_tab2.
       endif.
         endif.
            endselect.
       sort object_tab2 by enstehdat entstezeit descending.
    loop at object_tab2 to 25.
      if not object_tab2-prueflos is initial.
    append object_tab2 to object_tab1.
      endif.
      clear object_tab2.
    endloop.
      endif.
    when 'SAVE'.
    loop at object_tab1 where idx = 'X'.
      if ( not object_tab1-plnty is initial and
                    not object_tab1-plnnr is initial and
                               not object_tab1-plnal is initial ).
       select single * from qals into corresponding fields of wa_qals
       where prueflos = object_tab1-prueflos.
          if sy-subrc = 0.
           wa_qals-plnty = object_tab1-plnty.
           wa_qals-plnnr = object_tab1-plnnr.
           wa_qals-plnal = object_tab1-plnal.
    update qals from wa_qals.
      if sy-subrc <> 0.
    Message E001 with 'plan is not assigned to lot in sap(updation)'.
    else.
    v_line = tablctrl-current_line - ( tablctrl-current_line - 1 ).
    delete object_tab1.
    endif.
       endif.
          endif.
               endloop.
    when 'BACK'.
    leave program.
    when 'NEXT'.
    call screen 300.
    ENDCASE.
    ***INCLUDE Y_RQEEAL10_USER_OK_TCF01 .
    *&      Form  user_ok_tc
          text
         -->P_0078   text
         -->P_0079   text
         <--P_OK_CODE  text
    form user_ok_tc  using    p_tc_name type dynfnam
                              p_table_name
                     changing p_ok_code like sy-ucomm.
       data: l_ok              type sy-ucomm,
             l_offset          type i.
       search p_ok_code for p_tc_name.
       if sy-subrc <> 0.
         exit.
       endif.
       l_offset = strlen( p_tc_name ) + 1.
       l_ok = p_ok_code+l_offset.
       case l_ok.
         when 'P--' or                     "top of list
              'P-'  or                     "previous page
              'P+'  or                     "next page
              'P++'.                       "bottom of list
           perform compute_scrolling_in_tc using p_tc_name
                                                 l_ok.
           clear p_ok_code.
       endcase.
    endform.                    " user_ok_tc
    *&      Form  compute_scrolling_in_tc
          text
         -->P_P_TC_NAME  text
         -->P_L_OK  text
    form compute_scrolling_in_tc using    p_tc_name
                                           p_ok_code.
       data l_tc_new_top_line     type i.
       data l_tc_name             like feld-name.
       data l_tc_lines_name       like feld-name.
       data l_tc_field_name       like feld-name.
       field-symbols <tc>         type cxtab_control.
       field-symbols <lines>      type i.
       assign (p_tc_name) to <tc>.
       concatenate 'G_' p_tc_name '_LINES' into l_tc_lines_name.
       assign (l_tc_lines_name) to <lines>.
       if <tc>-lines = 0.
         l_tc_new_top_line = 1.
       else.
         call function 'SCROLLING_IN_TABLE'
           exporting
             entry_act      = <tc>-top_line
             entry_from     = 1
             entry_to       = <tc>-lines
             last_page_full = 'X'
             loops          = <lines>
             ok_code        = p_ok_code
             overlapping    = 'X'
           importing
             entry_new      = l_tc_new_top_line
           exceptions
             others         = 0.
       endif.
       get cursor field l_tc_field_name
                  area  l_tc_name.
       if syst-subrc = 0.
         if l_tc_name = p_tc_name.
           set cursor field l_tc_field_name line 1.
         endif.
       endif.
       <tc>-top_line = l_tc_new_top_line.
    endform.                              " COMPUTE_SCROLLING_IN_TC
    Thanks

  • Dulicate entries in Table control

    Hiii
    How can I control the duplicate entries in the column in table control.
    Harman

    Harman,
      IF you are passing values to table controls through internal table then
    sort the internal table by key values.
    EX: SORT itab BY matnr.
    DELETE ADJACENT DUPLICATES FROM itab COMPARING matnr.
    Now it will work..
    Don't forget to reward if useful....

  • Add fields to CAT2 data entry area table control

    Hi All,
    I have a requirement where in I need to add a column after every day ( Moday , Tuesday.. ) in CAT2 to enable the user to enter short text description for the time entry accountabiity. For this I will have to add 7 additional columns to the table control of the data entry area one beside each day. The description entered by the user should be updated in the database.
    I am thinking of using screen exit CATS0012. But not very sure how to go about it.
    Pls help.
    Thanks in Advance.
    Regards,
    Joshi

    Thanks Ankush. I am going for the CATS0005 option. I have created a customer project TSHEET within an existing PS package on the system. The system prompted me to obtain a transport number which I guess will attach the new project to the package in future.
    Could you advise further on how to do this in practise? My instructions say 'on the initial project administration screen select the Enhancement components field and choose Change. In fact there appear to be 2 options - either Components or Enhancements assignement. If I choose Enhancements assignment I am prompted to enter the name of an exit. I entered CATS0005 as I have to bring this into the customer project somehow. Within package MY_CATS_INTERFACE appeared however CATS0005 was not recognised within this package. Likewise CI_CATSDB was not recognised.
    Any advise useful
    Thanks
    Rachel

  • How to delete duplicate entries in table for the object DNL_CUST_BASIS2

    Hi All,
    I am trying to download the object DNL_CUST_BASIS2.
    In the SMQ2 the status is SYSFAIL.
    I checked in the ST22 for dumps.It says about the error while accessing the table T006.
    While analysing this,i found some duplicate entries in the related tables of this object.
    Can somebody help me how to delete these duplicate entries?
    Thanks,
    Senthil.

    Delete them directly from the table using se16:
    select the entries in the classic view (not ALV or grid view).
    activate the debugger.
    press the view button. --> you'll enter in the debugger
    press F7
    locate the sy-ucomm variable & change it to "DELE".
    press F8
    delete the entries.
    Trick-shots
    but it works!
    Michael.

  • Trick to remove duplicate entries from tables ?

    hi.
    i have 53tables which are having duplicate entries and names of all 53 tables r listed in top_t table ?
    can any1 provide me solution to show and if possible ask for remove of those duplicates entries from each table if required ?
    daily i am removing duplicates manually ....its too tedious now !
    can any1 help me out ?

    Well, I suppose if the duplication is such that
    SELECT DISTINCT * FROM tablename;gives you the required result, then you could have a procedure that made a copy of the table, deleted/truncated the original, then inserted the distinct values back into it.
    In 10g you could even use flashback to avoid the temp copy - but it also means you can't use TRUNCATE so whether it's any more efficient I'm not sure. But just for fun and since it's urgent:
    CREATE OR REPLACE PROCEDURE dedupe_table
        ( p_table_name user_tables.table_name%TYPE )
    IS
        k_start_timestamp TIMESTAMP := SYSTIMESTAMP;
    BEGIN
        SAVEPOINT start_of_dedupe;
        BEGIN
            EXECUTE IMMEDIATE 'DELETE ' || p_table_name;
        EXCEPTION
            WHEN OTHERS THEN
                ROLLBACK TO start_of_dedupe;
                RAISE_APPLICATION_ERROR
                ( -20000
                , 'Error deleting ' || UPPER(p_table_name) ||
                   CHR(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
                , TRUE );
        END;
        BEGIN
            EXECUTE IMMEDIATE
            'INSERT INTO ' || p_table_name ||
            ' SELECT DISTINCT * FROM ' || p_table_name || ' AS OF TIMESTAMP :b1'
            USING k_start_timestamp;
        EXCEPTION
            WHEN OTHERS THEN
                ROLLBACK TO start_of_dedupe;
                RAISE_APPLICATION_ERROR
                ( -20000
                , 'Error repopulating ' || UPPER(p_table_name) ||
                   CHR(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
                , TRUE );
        END;
    END dedupe_table;
    SQL> select * from wr_test;
          COL1 C C
             1 A B
             1 A B
             2 C D
             2 C D
    4 rows selected.
    SQL> BEGIN
      2      dedupe_table('WR_TEST');
      3  END;
      4  /
    PL/SQL procedure successfully completed.
    SQL> select * from wr_test;
          COL1 C C
             1 A B
             2 C D
    2 rows selected.I make no claims for robustness, efficiency or human safety.
    Edited by: William Robertson on Sep 24, 2009 7:12 PM

  • Duplicate entries in Table T5UGJ - Garnishment notice letters printed twice

    Hi Experts,
    We have a scenario where duplicate entries have been created for an employee in the table T5UGJ. Hence when the notice letters were printed, they printed twice.
    Would there be any specific reason or any master data change in IT 0194 / IT195 which would trigger a duplicate entry in this table?
    Any information is highly appreciated.
    Thanks,
    Dipesh.

    Hi Arti,
    Please find my responses below :
    1. The employee has two different Creditor garnishments, one dated for June and second for July.
    2. The duplicate notice letters are printed for second garnishment
    Thanks,
    Dipesh

  • Remove duplicate entry from table

    Hello all,
    In my one table
    File Stage log (File_Stage_Log_ID int identity(1,1),File ID int ,Quarter_Date nvarchar(50),StageID int )
    have done duplicate entry by mistake on similar quarter_date 
    something like ..
    FILE_ID
    Quarter
    FILE_STAGE_LOG_ID
    STAGE_ID
    22401
    Dec-13
    233091
    450
    22401
    Dec-13
    244116
    420
    22401
    Mar-14
    233095
    450
    22401
    Mar-14
    237478
    405
    22401
    Jun-14
    237479
    405
    22401
    Jun-14
    233099
    450
    22401
    Sep-14
    233102
    450
    22401
    Sep-14
    237480
    405
    22401
    Dec-14
    237481
    405
    22401
    Dec-14
    227275
    420
    there are too many files which have the same duplicacy ..
    now , above you can see that dec -13 quarter coming twice for a single file 
    tell me the way to delete one entry from the table for a files 
    so that i have output at the end like ...
    FILE_ID
    Quarter
    FILE_STAGE_LOG_ID
    STAGE_ID
    22401
    Dec-13
    233091
    450
    22401
    Mar-14
    233095
    450
    22401
    Jun-14
    237479
    405
    22401
    Sep-14
    233102
    450
    22401
    Dec-14
    237481
    405
    Please help me with easiest possible way ..
    Dilip Patil..

    How do you determine which one out of duplicate to be kept? As per output it doesnt follow any pattern
    so it may be this
    --DELETE t
    SELECT *
    FROM
    SELECT ROW_NUMBER() OVER (PARTITION BY FILE_ID,Quarter_Date ORDER BY FILE_ID) AS Rn,*
    FROM FileStageLog
    )t
    WHERE Rn >1
    Run the select above to see records to be removed and once happy uncomment the delete, comment the select * and run the query to do the delete
    If it doesnt give expected records, explain on what basis you want to identify records to be deleted
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Regarding Searh option in table control

    Hello,
    I have one table control in which i have taken only one field of 132 length so that user enter the line wise comments in that table control.
    Now i want a search button for that table control so that user can enter any string to search in the table control.
    How to do that as i haven't seen any thing like this even in standard transaction also.
    Please give me some ideas fro doing that.
    with regards,
    nitin

    Hello,
    Thanx for your reply,
    I code like this.
    I_TXTTAB is my table control internal table.
    MODULE SEARCH. is my module for search
    Codes as follow
      CASE OK_CODE.
        WHEN 'FIND'.
          PERFORM SEARCH.
    TAB_SEARCH-TABNAME = 'TLINE'.
      TAB_SEARCH-VALUE = ROLE_TEXT.
      TAB_SEARCH-FIELDNAME = 'TDLINE'.
      APPEND TAB_SEARCH.
      CALL FUNCTION 'POPUP_GET_VALUES'
        EXPORTING
          POPUP_TITLE     = 'Find Text : Comment'(010)
        IMPORTING
          RETURNCODE      = RETURNCODE
        TABLES
          FIELDS          = TAB_SEARCH
        EXCEPTIONS
          ERROR_IN_FIELDS = 1
          OTHERS          = 2.
      IF RETURNCODE = 'A'. EXIT. ENDIF.
      READ TABLE TAB_SEARCH WITH KEY FIELDNAME = 'TDLINE'.
      ROLE_TEXT = TAB_SEARCH-VALUE.
      CLEAR L_TEXT_INPUT.
      L_TEXT_INPUT = TAB_SEARCH-VALUE.
      IF ROLE_TEXT IS INITIAL .
        EXIT.
      ENDIF.
      IF FILE IS NOT INITIAL AND
         I_TXTTAB IS NOT INITIAL.
        DESCRIBE TABLE I_TXTTAB LINES TXT_LINES.
        L_IND = COMMENT-CURRENT_LINE.
        READ TABLE I_TXTTAB INTO W_TXTTAB INDEX L_IND.
        FIND ALL OCCURRENCES OF L_TEXT_INPUT  IN W_TXTTAB IGNORING CASE RESULTS RESULTS.
        IF SY-SUBRC = 0.
          SET CURSOR FIELD 'W_TXTTAB' LINE L_IND.
          FLAG = 'X'.
        ENDIF.
    This code finds the text string but it is not taking my cursor to that particular line item.
    i write this code like this also, but still not getting to the line item
    PROCESS AFTER INPUT.
      LOOP AT I_TXTTAB.
        CHAIN.
          FIELD W_TXTTAB-TDLINE.
          MODULE G_TEXT_MODIFY ON CHAIN-REQUEST.
        ENDCHAIN.
        MODULE SEARCH.
      ENDLOOP.
    With Regards,
    Nitin Malhotra

  • Decimal Entry in Table control

    Hi,
      I need to insert currency value to my user table thro table control.
    My table name is ZUVRATE.
    Particular field name is
    DMBTR DMBTR  CURR  13  2
    Reference field is T001-waers.
    i have created one table control in screen painter with value column.
    My problem is, i cant enter the decimal value  in the table control.
    If i enter the decimal value, please enter numeric error is coming?
    what is the error?
    Thanks,
    Neptune.M

    Hi,
      Change your system settings
      System>user profile>Own data-->Defaults(tab)
      in that change the decimal Notification .
      The second one is what U want.
      U need to logoff and Logon to the server.
      Don't forget to reward points if helpful.
    Regards,
    GSR.

  • REGARDING  "w/selcolumn" IN table control

    hi experts,
                i m not able to use "w/selcolumn" in table control.
    cud u plz how will i use this to delete the data from database table as per the data showing in the table control.
    plz help me

    Hi,
    <u>Step 1</u>
    In your PAI capture all the seleted rows into an internal table. The following code snippet does that.
    recsel -> value you have given for w/selcolumn
    gt_student_select -> Internal table having the selected rows for deletion
    gt_student
    module select_record input.
    if recsel = 'X'.
    read table gt_student_select with key student_id = gt_student-student_id
    if sy-subrc eq 4.
    gt_student_select-mandt = gt_student-mandt.
    gt_student_select-student_id = gt_student-student_id.
    gt_student_select-student_name = gt_student-student_name.
    gt_student_select-student_address = gt_student-student_address.
    gt_student_select-student_average = gt_student-student_average.
    append gt_student_select.
    endif.
    else.
    delete table gt_student_select from gt_student.
    endif.
    endmodule.
    <u>Step 2</u>
    Perform deletion using the internal table gt_student_select.
    when 'DELETE'.
    clear ok_code.
    "deletes matching record from database table
         DELETE ztrch_stud_kri1 FROM table gt_student_select.
        "deletes the record from the itab
        loop at gt_student_select.
        delete table gt_student from gt_student_select.
        endloop.
        "sets the number of lines displayed in the table control to the
        "number of line in the internal table.
        DESCRIBE TABLE gt_student LINES tabctrl-lines.
        clear gt_student_select[].
    ***********************Reward points if found useful***************
    Regards,
    Kriththika.

Maybe you are looking for

  • Thunderbird crashes every time I try to attach a file

    Every time I try to attach a file Thunderbird crashes as does Firefox when I try to use the online e-mail program at Yahoo O/S is windows 7 below is the error report. escription: A problem caused this program to stop interacting with Windows. Problem

  • Script to export IDCS3 to PDF utilizing text from document as file name

    I have written a few very very basic scripts so I really only know enough to be dangerous. I tried searching the forums first but couldn't find a situation quite like this one. I have an IDCS3 file that is using data merge to create multiple files. A

  • Problem in setting image in setbouns  size

    hai to all iam new to core java i created an application with 4 fields and 1 button name is browse. my problem is image i want to set full image within specified setbounds it is possible in core java thanks please help me

  • HT1417 how to get rid of duplicates in itunes 11

    I cannot find where to get rid of duplicates in the new version of itunes, which I cannot stand.  Can I go back to the old one, where it would let you find duplicates and delete them?

  • Problems opening Firefox or Netscape after migrating from old iMac to new

    When I set up my new iMac I migrated my internet settings and other preferences and apps from my old iMac. Now, I can't get Firefox, Netscape or even Internet Explorer to open unless I have my old iMac on and connected via Firewire and router to my n