How to delete data in table control

Hi,
I am doing module pool programming. After the user enters the data in table control after saving the data. if the user wants to  remove the line item the line item shd be removed from the screen and data base.
Please Give me vaulable Suggestions
Regards

Hi,
Screen 8002 (with table control) --> select records --> press delete button --> delete selected records
Now you wan to delete those records selected by the user at runtime when DELETE button is clicked.
Take another internal table and work area same as the initial internal table and work area used in screen 8002 which is to be used to delete the selected data.
Take the names of the input/output fields as work_area-field_name and select column in table control as work_area-flag.
Also take a flag field of size 1 datatype character as the last field in the internal table and work area while declaration.
You must have passed a code in PBO of the screen for reading internal table into the table control.
So it reads the internal table into the table control whenever you perform any action on use command.
All you need to do is to write a code to modify the internal table form the table control while performing any user action.
Remember to change the LINE SEL option in attributes of table control as MULTIPLE.
At screen logic,
PROCESS BEFORE OUTPUT.
  MODULE status_8002. "for pf-status
  LOOP WITH CONTROL po_tab. "po_tab is table control
    MODULE pass_data. "to pass data into table control from internal table
  ENDLOOP.
PROCESS AFTER INPUT.
  MODULE user_command_8002. "for user command(back and exit)
  LOOP WITH CONTROL po_tab.
    MODULE modify_data. "to modify data from table control into table control
  ENDLOOP.
  MODULE delete. "to delete the selected records
In PBO,
*&      Module  STATUS_8002 OUTPUT
MODULE status_8002 OUTPUT.
  SET pf-status 'ZAB_PFSTA'. " pf-status
  DATA : line_count TYPE i.
  DESCIRBE TABLE it_ekpo
  LINES line_count.
  po_tab-lines = line_count + 10.
  " to make table control scrollable
ENDMODULE.                 " STATUS_8002  OUTPUT
*&      Module  PASS_DATA  OUTPUT
MODULE pass_data OUTPUT.
  READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE.                 " PASS_DATA  OUTPUT
"it_ekpo is internal table and wa_ekpo is the work area
In PAI,
*&      Module  MODIFY_DATA  INPUT
MODULE MODIFY_DATA INPUT.
  MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
  "modify records from table control into the internal table
ENDMODULE.                 " MODIFY_DATA  INPUT
*&      Module  DELETE  INPUT
MODULE DELETE INPUT.
  OK_CODE = SY-UCOMM.
  CASE OK_CODE.
    WHEN 'DELETE'. "when delete button is clicked
      SORT IT_EKPO BY FLAG DESCENDING. "sort by flag(selection column value)
      CLEAR WA_EKPO1.
      CLEAR WA_EKPO.
      REFRESH IT_EKPO1.
      LOOP AT IT_EKPO INTO WA_EKPO WHERE FLAG = 'X'.
        DATA : J TYPE I.
        CLEAR J.
        J = SY-TABIX. "assign index value if a record is selected
        MOVE-CORRESPONDING WA_EKPO TO WA_EKPO1. "append selected records to another
        "work area and append to another internal table to delete
        APPEND WA_EKPO1 TO IT_EKPO1.
        DELETE IT_EKPO. "delete the selected records from initial internal table
        " to reflect the changes on the table control
      ENDLOOP.
      IF J = 0.
        MESSAGE I006. "if no record selected
      ELSE. "if some records are selected
        DELETE ZEKPO FROM TABLE IT_EKPO1. "delete from database table
        COMMIT WORK.
        IF SY-SUBRC = 0.
          MESSAGE S007. "success message (records deleted)
        ENDIF.
      ENDIF.
  ENDCASE.
ENDMODULE.                 " DELETE  INPUT
Now at PAI, you have delete records and these changes are reflected back to the internal table.
Now when PBO is executed it will again read the initial internal table and will not show the deleted records.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir

Similar Messages

  • How to insert data into table control

    hi experts,,
           i have inserted data into data base table through table control .
    now i want to insert data into table control through database table.
      how to delete data from table control for selected row

    Hi
    go through this link.
    http://www.****************/Tutorials/ABAP/TableControl/Demo.htm

  • How to populate data in table control  .

    hi all,
    i put matnr no. in screen no. 103
    validation is done at that screen only.
    now when i want to modify dat record
    when i put matnr no. at screen 103
    so how i will get all  data of dat number to table control screen.

    Hi Darshan,
       Here is a detailed description of how to update data in table controll.
      Updating data in table control
    The ABAP language provides two mechanisms for loading the table control with data from the internal table and then storing the altered rows of the table control back to the internal table.
    Method 1: Read the internal table into the Table Control in the screenu2019s flow logic.  Used when the names of the Table Control fields are based on fields of the internal table.
    Method 2: Read the internal table into the Table Control in the module pool code. Used when the names of the Table Control fields are based on fields of the database table.
    Method 1 (table control fields = itab fields)
    In the flow logic we can read an internal table using the LOOP statement. Define the reference to the relevant able control by specifying WITH CONTROL <ctrl>
    Determine which table entry is to be read by specifying CURSOR <ctrl>-CURRENT_LINE.
    After the read operation the field contents are placed in the header line of the internal table. If the fields in the table control have the same name as the internal they will be filled automatically. Otherwise we need to write a module to transfer the internal table fields to the screen fields.
    We must reflect any changes the user makes to the fields of the table control in the internal table otherwise they will not appear when the screen is redisplayed after PBO processing, (eg, after the user presses Enter or scrolls) However, this processing should be performed only if changes have actually been made to the screen fields of the table control (hence the use of the ON REQUEST)
    PROCESS BEFORE OUTPUT.
    LOOP AT ITAB_REG WITH CONTROL TCREG
    CURSOR TCREG-CURRENT_LINE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT ITAB_REG.
    MODULE MODIFY_ITAB_REG.
    ENDLOOP.
    MODULE MODIFY_ITAB_REG INPUT.
    MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
    ENDMODULE.
    Method 2 (table control fields = dict. fields)
    If using a LOOP statement without an internal table in the flow logic, we must read the data in a PBO module which is called each time the loop is processed.
    Since, in this case, the system cannot determine the number of internal table entries itself, we must use the EXIT FROM STEP-LOOP statement to ensure that no blank lines are displayed in the table control if there are no more corresponding entries in the internal table.
    PROCESS BEFORE OUTPUT.
    LOOP WITH CONTROL TCREG.
    MODULE READ_ITAB_REG.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP WITH CONTROL TCREG.
    CHAIN.
    FIELD: ITAB_REG-REG,
    ITAB_REG-DESC.
    MODULE MODIFY_ITAB_REG
    ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    MODULE READ_ITAB_REG OUTPUT.
    READ TABLE ITAB_REG INDEX TCREG-CURRENT_LINE.
    IF SY-SUBRC EQ 0.
    MOVE-CORRESPONDING ITAB_REREG TO TCREG.
    ELSE.
    EXIT FROM STEP-LOOP.
    ENDIF.
    ENDMODULE.
    MODULE MODIFY_ITAB_REG INPUT.
    MOVE-CORRESPONDING TCREG TO ITAB_REG.
    MODIFY ITAB_REG INDEX
    TCREG-CURRENT_LINE.
    ENDMODULE.
    Updating the internal table
    Method 1
    PROCESS AFTER INPUT.
    LOOP AT ITAB_REG.
    CHAIN.
    FIELD: ITAB_REG-REG,
    ITAB_REG-DESC.
    MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    MODULE MODIFY_ITAB_REG INPUT.
    ITAB_REG-MARK = u2018Xu2019.
    MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
    ENDMODULE.
    Method 2
    PROCESS AFTER INPUT.
    LOOP WITH CONTROL TCREG.
    CHAIN.
    FIELD: TCREG-REG,
    TCREG-DESC.
    MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    MODULE MODIFY_ITAB_REG INPUT.
    MOVE-CORRESPONDING TCREG TO ITAB_REG.
    ITAB_REG-MARK = u2018Xu2019.
    MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
    ENDMODULE.
    Updating the database
    MODULE USER_COMMAND_100.
    CASE OK_CODE.
    WHEN u2018SAVEu2019.
    LOOP AT ITAB-REG.
    CHECK ITAB_REG-MARK = u2018Xu2019.
    MOVE-CORRESPONDING ITAB_REG TO TCREG.
    UPDATE TCREG.
    ENDLOOP.
    WHEN u2026
    u2026
    ENDCASE.
    ENDMODULE.
    Hope this will solve your problem.
    Regards,
    Pavan.
    Edited by: PAVAN CHANDRASEKHAR GANTI on Aug 3, 2009 12:48 PM

  • How to transfer data in table control in bdc

    hi
    how to transfer data in table control in bdc . I need the theory regarding this
    bye

    Hi,
    just check in the forum , there is many threads available to ur questions.
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    You can even refer to these related threads
    bdc table control
    Re: table control in bdc
    table control in BDC
    Reward if helpful.
    Thanks
    Naveen khan

  • How to show data through table control

    Hi Experts,
    I have created an table control through wizard using table EKKO.
    I have to populate one internal table( type ekko ), and then show it in output  through table control.
    Please advise, how to do that and in where i have to write the codes.
    I will reward points for every suggestion
    Thanks in advance.
    regards

    hi saubrab,
                    This is kiran kumar.G.I am sending some sample code to populate data into table control check it once.
    i will give input in 100 screen. and display table control in 200 screen.check it once once ..ok....
    SE38 :(CODE)
    *& Module pool       YMODULEPOOL_TABLECONTROL1                         *
    *& DEVELOPER   : KIRAN KUMAR.G                                         *
    *& PURPOSE     : TABLE CONTROL DEMO                                    *
    *& CREATION DT : 17/12/2007                                            *
    *& T.CODE      : YMODTABLECONTROL1                                     *
    *& REQUEST     : ERPK900035                                            *
    PROGRAM  ymodulepool_tablecontrol1.
    Tables
    TABLES: yvbap,  "Sales Document: Item Data
            vbak.   "Sales Document: Header Data
    Controls
    CONTROLS: my_table TYPE TABLEVIEW USING SCREEN 200.
    Global Variables
    DATA: gv_lines    TYPE i,
          gv_lines1   type i,
          gv_temp     type i,
          gv_flag(20) TYPE c VALUE 'DISP',
          gv_mode1    TYPE c,
          gv_mode     TYPE c VALUE 'C'. " C: Change, D :Display
    Internal Table
    DATA: BEGIN OF gt_item OCCURS 0,
            vbeln LIKE vbap-vbeln,  "Sales Document Number
            posnr LIKE vbap-posnr,  "Sales Document Item
            matnr LIKE vbap-matnr,  "Material Number
            matkl LIKE vbap-matkl,  "Material Group
            arktx LIKE vbap-arktx,  "Short Text for Sales Order Item
            cflag,                  "Deletion Indicator
          END OF gt_item.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'ZTABLECONTROL' OF PROGRAM 'YMODULEPOOL_TABLECONTROL'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'DISP'.
          SELECT single vbeln
                        erdat
                        angdt
                        bnddt
                   FROM vbak
                  INTO (vbak-vbeln,vbak-erdat,
                        vbak-angdt,vbak-bnddt)
                  WHERE vbeln = vbak-vbeln.
            IF sy-subrc EQ 0.
    *Fetch the table control data and place them in Internal Table
              SELECT vbeln
                     posnr
                     matnr
                     matkl
                     arktx
                FROM yvbap
                INTO TABLE gt_item
                WHERE vbeln = vbak-vbeln.
              IF sy-subrc EQ 0.
    *NO OF line in the Internal Table
                DESCRIBE TABLE gt_item LINES gv_lines.
                my_table-lines = gv_lines + 20.
              ENDIF.
            ENDIF.
    *Call Screen 200.
            SET SCREEN 200.
          WHEN  'EXIT' OR 'BACK' OR 'CANCEL'.
    *Exit from the Program
            CALL TRANSACTION 'SESSION_MANAGER'.
        ENDCASE.
      ENDMODULE.                 " USER_COMMAND_0100  INPUT
    module STATUS_0200 output.
    SET PF-STATUS 'ZTABLECONTROL1'.
    endmodule.                 " STATUS_0200  OUTPU
    *&      Module  copy_data  OUTPUT
          text
    module copy_data output.
    *Fetch the current line data from the Table control
    read table gt_item index my_table-current_line.
    if sy-subrc eq 0.
    *Populating data into screen fields
    gt_item-vbeln = gt_item-vbeln.
    gt_item-posnr = gt_item-posnr.
    gt_item-matnr = gt_item-matnr.
    gt_item-matkl = gt_item-matkl.
    gt_item-arktx = gt_item-arktx.
    endif.
    SE51:CODE (SCREEN 100)
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_0100.
    SE51 :CODE (SCREEN 200)
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0200.
    loop at gt_item with control my_table cursor my_table-current_line.
    module copy_data.
    endloop.
    PROCESS AFTER INPUT.
    loop at gt_item.
    MODULE USER_COMMAND_0200.
    endloop.
                             HAVE A NICE DAY..
    Award points if helpful,kiran kumar.G

  • How to modify data in table control

    hi
    i have created table control where i have displayed  data into table control
    logic used
    screen 200
    PROCESS BEFORE OUTPUT.
    MODULE SELECT_RECORD.
    *&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TBC_200'
      MODULE TBC_200_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TBC_200_CHANGE_COL_ATTR.
      LOOP AT   IT_MARA
           INTO WA_MARA
           WITH CONTROL TBC_200
           CURSOR TBC_200-CURRENT_LINE.
        MODULE TBC_200_GET_LINES.
    *&SPWIZARD:   MODULE TBC_200_CHANGE_FIELD_ATTR
      ENDLOOP.
    MODULE STATUS_0200.
    PROCESS AFTER INPUT.
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TBC_200'
      LOOP AT IT_MARA.
        CHAIN.
          FIELD WA_MARA-MATNR.
          FIELD WA_MARA-ERSDA.
          FIELD WA_MARA-ERNAM.
          MODULE TBC_200_MODIFY ON CHAIN-REQUEST.
        ENDCHAIN.
        FIELD WA_MARA-MARK
          MODULE TBC_200_MARK ON REQUEST.
      ENDLOOP.
      MODULE TBC_200_USER_COMMAND.
    *&SPWIZARD: MODULE TBC_200_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE TBC_200_CHANGE_COL_ATTR.
    module -
    MODULE SELECT_RECORD.
    MODULE SELECT_RECORD OUTPUT.
    SELECT MATNR ERSDA ERNAM
            FROM MARA
            INTO CORRESPONDING FIELDS OF TABLE it_mara.
    ENDMODULE.                 " SELECT_RECORD  OUTPUT
    and
    another thing
    i have made  field  MARA-ERSDA. and  FIELD WA_MARA-ERNAM editable by
    input possible using layout
    so
    now those 2 fields contents  are editable
    i want to know how to edit and save the data
    some body guide.
    and i want to put the lock so that i can update
    can tell how to implement lock.
    Thanks
    Edited by: viju bangalore on Jan 27, 2011 10:40 AM

    Hi Viju,
    In PAI do something like this
    LOOP AT itab.
        MODULE mod_table_control.
    ENDLOOP.
    MODULE user_command_0100.
    at module mod_table_control put this
    MODULE mod_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
      if sy-subrc ne 0.
           insert itab.
      endif.
    ENDMODULE.
    for saving you can create at custom gui status with a save button, and at MODULE user_command_0100 save the data.

  • How to clear data in Table Control.

    hi! all
    How to clear the data in table control.
    i have a Table control which displays column A data from the previous screen and allows to enter column B and column C and i have a button CLEAR, when i click CLEAR button the Data displaying in table control has to be cleared. how to do it.
    Regards,
    Nagulan

    Hi,
    Loop over the internal table of table control & clear data from table control.
    loop at tctab.
    clear tctab.
    modify tctab.
    endloop.
    Best regards,
    Prashant

  • How to delete columns in table control (tab Services) for transaction ME51

    Hi, gurus!
    We're facing this problem in our upgrade: we have a batch input (ME51) in order to create purchase requisitions, but we get an error with the dynpro data (program: SAPMM06B, dynpro: 0102).
    We are sure we populate all the required fields in that screen.
    The only possible reason we find for that error is the fact  that we have two new entries in table control (in tab services=> Current settings there are 67 fixed columns)
    We had to add in table T162V (which previously had only 65 columns for each variant): ESLL-SRVMAPKEY y ESLL-EXTERNALID, as described on note 1382685, so table control and table T162V could have same number of fields.
    We guess we could solve the batch input error deleting those fields in both table control and T162V, but don't know how.
    We really would appreciate any clue.
    Thanks in advance.
    Best regards,
    J. Madariaga

    It's an own batch input.
    The error is: "Batch input information for dynpro SAPMM06B 0102 does not exist", but the fields in that screen are alright.
    And that batch input works fine in another client with same patch level, but without fields ESLL-SRVMAPKEY and ESLL-EXTERNALID in table T162V, so I guess that could be the problem (not sure about it, of course).
    Regards,
    J Madariaga

  • How to delete columns in table control

    hi
    1) I have creted a table control with five columns
    now i want to delted the tow of the five coluent pls let me know how to delete it
    1) also i am useing a module pool programming (code if needed i will paste)
    in that the requirment is to select data from a ztable and aloow user to enter new ship to data only whne the corresponding records exists in kna1 table
    and to populate the name1 value automatically from table kna1 whne user enters ship to number
    pls suggest
    regards
    Arora

    Hello,
    Requirement 1
    i believe you need to delete a row from the control table based on the user input...
    if thats the case then definitely in the control table the multiple line selection will be activated .
    in PAI of the control table screen...
    if user has clicked delete.
    loop at control table records..
    if the selection code for the line is 'X'.
    Delete from the internal table.
    endif.
    endloop.
    endif.
    Requirement 2..
    i will give an outline on the checks
    a)first let the user enter the data...in the PAI of the screen...write the code to do the checking....if your requirement is not satisfied provide a warning/error  message or delete the record and give a message stating the reason for deletion...
    in PAI.
    for a control table...
    loop at the table records
    select from table and check if user record is O.K
    if not delete the record and give message
    endif.
    endloop.
    b)similarly inside the PBO write code to fetch the name1 from Kna1 table for the ship to number if that ship to number is not empty
    in PBO of that screen
    if  ship_to is not initial.
    select text for ship_to number to the display field
    else.
    clear the display field
    endif.
    reward if the suggestions were useful
    Regards
    Byju

  • How to delete record from table control in BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    Hi,
    While doing recording check for Filter button available for the table control, if it available then do the recording for the same.
    Once it is done while passing the data from internal table put the value into Filter field.
    Hope it resolves your issue.
    Thanks & Regards.
    Nagaraj Kalbavi

  • How to delete record from table control using BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    One option is to identify the table and find out the location as the number of row which should be deleted from the table and then in the bdc program instead of postioning the cursor on the row 1(using the statement perform bdc_cursor ....(01)), replace the 01 with the row number.
    Second option is that if a filter control is available for the table control, then filter the data each and every time with the material number to be deleted and then delete the first row.
    Regards
    Farzan

  • How to display data in Table control?

    Hi Experts,
    Can anyone please explain me how to display the data from two different tables(those two table is related with 1 field) into a single table control?
    For Example: T1 has fields (F1,F2) and
                         T2 has fields (F3,F4) --> here F3 is foreign key for F1
    I need to display the data F1,F2,F3,F4 into the table control.
    Can anyone explain me?
    Thanks in Advance,
    Regards,
    Raghu

    Hi,
    If F3 is foreign key for F1, then both fields will have same values.  Then why do you need to display both F1 and F3?  Either one of them is enough.  Try the following code.
    types: begin of t_table,
                 F1 type T1-F1,
                 F2 type T1-F2,
                 F4 type T2-F4,
              end of t_table.
    data: i_table type standard table of t_table with header line.
    select F1 F2 F4 into table i_table from T1 inner join T2 on T1F1 = T2F3.
    You should create three columns in the table control with names i_table-F1, i_table-F2, i_table-F3.
    After populating the internal table, refresh the control with the following statement.
    REFRESH CONTROL <NAME> FROM SCREEN <SCREEN_NO>.
    All the above statements should be in your PBO Module.
    Regards,
    Hema
    Message was edited by:
    Sorry, Declarations can be in the common include.  Select statement and refresh statement should be in PBO.
            Hema Nagarajan

  • How to maintain data in table control

    plz send a detail description of how to create table control and maintain data in that table control.

    Hello Narendar,
    Check the following link:
    http://help.sap.com/saphelp_erp2005/helpdata/en/45/adee2396f711d1b46b0000e8a52bed/frameset.htm
    Also, a table control wizard in Screen Painter(SE51) exists, which takes you step by step through the Table Control generation and also creates code, so you can start using the Table Control right away.
    You can either specify a database table, or use an internal table from program.
    If you want to use internal table, it needs to be predefined in your program, before you start creating the table control.
    Reward if helpful.

  • How to clear data from Table-Control

    Hi all,
    I am working on table control. I have some data on the table control.
    When I press the 'Cancel' button, I require that the table-control should be cleared.
    I tried using REFRESH CONTROL TC01 USING SCREEN 1001. But, the data doesn't get cleared.
    Please advise.
    Regards,
    Saurabh Buksh.

    hi
    good
    try this example
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
          lines TYPE i.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
          TABLES demo_conn.
    SELECT * FROM spfli INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
      DESCRIBE TABLE itab LINES lines.
      flights-lines = lines.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
            ENDIF.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols
                                  WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
            ENDLOOP.
          ENDIF.
      ENDCASE.
    ENDMODULE.
    thanks
    mrutyun^

  • How to delete records in Table control

    Hi,
    i defined  a table control in which it has 5 records and i have 1 ''DELETE button.
    if i select a record and if i click on delete button.
    The selected button has to be deleted.
    Please let me know how i can i do..if possible with sample codes..
    Thanks in advance.

    Hi Andrew,
    In the PAI event, you need to handle the DELETE logic.
    Just have a look at the following code.
    OK_CODE = SY-UCOMM.
    Case OK_CODE.
    When 'DELETE'.
    Loop at internal table where CHECKBOX = 'X'. " Checkbox is marked.
    lv_sytabix = sy-tabix.
    If sy-subrc eq 0.
      Delete from itab index lv_sytabix. " Deleting values from ITAB
    Endif.
    Endloop.
    Endcase.
    Also have a look at this demo dynpro code. This will let you know the exact syntax.
    DEMO_DYNPRO_TABCONT_LOOP_AT.
    Hope this will help.
    Thanks,
    Samantak.

Maybe you are looking for

  • 13" MacBook Pro (Early 2011) doesn't detect display over mini DisplayPort HDMI adapter in Mountain Lion 10.8.2

    Hi to all. I have a problem connecting external display (Dell U2311H) to my 13" MacBook Pro (Early 2011). I use Tecklink Mini DasplayPort to HDMI adapter (http://www.techlink.uk.com/products/wires_cables/wiresmedia/wiresmedia_media/wir esmedia_mini_d

  • Image Management and Creation

    Greetings: I've been looking around in the Net, for how to manage images, to be more precise, merging PNG images (which handle transparecy) with JPEG images. The thing is that I'm looking if there are any classes and which may they be to merge images

  • Applications wont open

    All my purchased applications wont open any more. I recently changed from a laptop using vista to a new macbook and my applications wont sync from phone to itunes on mac. I can still open all apps that came with phone i am on ver 2.2 software help pl

  • IC WebClient: Add new field case management result view.

    Hello Experts, I need to add a new field in the view CaseAResult.htm, this field is EXT_REF and It is in the structure of CmgCaseStandard (I see in the GENIL_MODEL_BROWSER) I append the field in the view CaseASearch.htm with the transaction BSP_WD_WO

  • Security Provider for a web dynpro with tool Visual Administrator

    Hello all, after deploying successfully my web dynpro on the J2EE 7.0 WAS, I'm trying to set up authentication to it but I cannot find my applicaiton in the list of policy configurations of the Security Provider entry. When I try to add the path to m