Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Introduction
A table control is an area on the screen in which the system displays data in tabular form. It is
processed using a loop.
Select type as MODULE POOL and status as TEST PROGRAM and click SAVE
Select Local Object ( You can also select your own package and save)
Write the below coding (Defining Internal tables for table controls SOURCE and
DESTINATION)
Enter the structure defined in the program and click GET FROM PROGRAM and select all
fields
Provide the following attributes in the attribute panel for each table control
Create push buttons as shown below using PUSH BUTTON icon in the toolbar and provide
attributes for each element as following and Save the screen
Double click on screen 9000 and enter the below code in the flow logic tab
(Cont.)
(Cont.)
Add a code MODULE modify_source and double click on it and select YES
Write the below code in the generated module block and activate program
(Cont.)
(Cont.)
(Cont.)
(Cont.)
(Cont.)
Provide attributes shown below and save and execute the program
EXECUTE : Activate Program and Right click Program name and select
Execute->In a new window
OUTPUT :
Select All
Deselect All
Invert Selection
Delete Rows
WHEN 'RESTORE'.
"Moving records from restore table to source table
APPEND LINES OF LT_RESTORE TO LT_SOURCE.
"Sorting source table in ascending order
SORT LT_SOURCE BY MATNR.
"Clearing contents in restore table
REFRESH LT_RESTORE.
WHEN 'MOVE'.
"Retrieving record selected
LOOP AT LT_SOURCE INTO LS_SOURCE WHERE MARK = 'X'.
"Making records being not selected
CLEAR LS_SOURCE-MARK.
"Moving record to destination table
APPEND LS_SOURCE TO LT_DESTINATION.
ENDLOOP.
"Sorting destination table in ascending order
SORT LT_DESTINATION.
"Deleting duplicate records
DELETE ADJACENT DUPLICATES FROM LT_DESTINATION COMPARING ALL FIELD
S.
WHEN 'SELECT'.
"Retrieving record being not selected
LOOP AT LT_SOURCE INTO LS_SOURCE WHERE MARK <> 'X'.
"Making record being selected
LS_SOURCE-MARK = 'X'.
"Updating Changes to source table
MODIFY LT_SOURCE FROM LS_SOURCE TRANSPORTING MARK.
ENDLOOP.
WHEN 'DESELECT'.
"Retrieving record being selected
LOOP AT LT_SOURCE INTO LS_SOURCE WHERE MARK = 'X'.
"Making record being not selected
LS_SOURCE-MARK = ''.
"Updating Changes to source table
MODIFY LT_SOURCE FROM LS_SOURCE TRANSPORTING MARK.
ENDLOOP.
WHEN 'INVERT'.