Friday, December 17, 2010
Line selection is important in table control. Operations like Delete, Modify, Copy can be done for the line selected.
Steps involved
We should take one variable in your internal table or in structure which is used for table control fieldsDATA :BEGIN OF itab OCCURS 0 , mark TYPE c , matnr LIKE mara-matnr , matkl LIKE mara-matkl, maktx LIKE makt-maktx, END OF itab . CONTROLS: tabc TYPES tableview USING screen 100.
This mark variable should be given in Table control properties. follow the path.
Flow Logic of the screen.
Code for read_table_control
- Double click on the table control.
- Attributes
- w/SelColumn and in that give itab-mark. Check in the figure.
Flow Logic of the screen.
PROCESS BEFORE OUTPUT. MODULE status_0100. LOOP AT itab WITH CONTROL tabc ENDLOOP. PROCESS AFTER INPUT. MODULE CANCEL AT exit-command. LOOP AT itab. MODULE read_table_control. ENDLOOP. MODULE user_command_0100.
REPORT ZTEST_PROGRAM. *----------------------------------------------------------------------* * MODULE read_table_control INPUT *----------------------------------------------------------------------* MODULE READ_TABLE_CONTROL INPUT. MODIFY ITAB INDEX TABC-CURRENT_LINE."this will update the itab table "mark field with 'X ' whatever we "have selected on table control ENDMODULE. "read_table_control INPUT
If you want to Delete some of the records from Table control follow this code.
Create one pushbutton and give Fucnction code to that and write below code.
Create one pushbutton and give Fucnction code to that and write below code.
CASE okcode. WHEN 'DELETE'. LOOP AT itab WHERE mark = 'X'. DELETE itab. ENDLOOP. ENDCASE.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Sending email with pdf attachment
- ABAP - Step by step tutorial on Smart Forms - Template Node
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
Not working value get clear again from 'X' to blank..
ReplyDeleteWhat is the issue