2013 Apr 23 4:48 AM
I have a question about Table Control.
Firstly, the screen of my ABAP program contains a text field and a table control. When I input something contents into the text field as search condition to get data from database, the table control will display the corresponding data.
I have succeeded in data displaying in table control. The second step is to select rows in table control without selection mark disappearing after doing some kind of actions like pushing ‘enter’ key.
Followed is part of my coding.
Tables: sflight. ”table control field name in screen
Data g_select type c. “mark name in table control
In PBO:
Module select_data_from_db.
LOOP AT it_xxx
INTO wa_xxx
WITH CONTROL TB_CL01.
MODULE move_to_ sflight.
In PAI:
LOOP AT it_xxx.
MODULE modify_internaltable.
Module move_to_sflight is:
g_select = wa_xxx-mark.
MOVE-CORRESPONDING wa_xxx to sflight.
Module modify_internaltable is:
wa_xxx-mark = g_select.
modify it_xxx from wa_xxx index tb_cl01-current_line.
The problem is “Module select_data_from_db” will refresh the it_xxx and make the mark ‘X’ clear. So marked selected rows will be unselected after inputing.
I tried to move “Module select_data_from_db” into PAI and settle this problem, but someone told me it is better to put “Module select_data_from_db” in the PBO.
I am just wondering a solution or some standard samples if existed.
Thank you guys.
2013 Apr 23 11:47 AM
Hi,
if the given solutions are not working. try this one:
In PAI pass it_xxx into another table it_xxx_temp.
Now when it comes to PBO, you compare both it_xxx and it_xxx_temp and update the mark field in it_xxx based on it_xxx_dummy table.
Regards,
Swarna
2013 Apr 23 6:11 AM
hi ming , just take your select indicator with in internal table
likes this , hope it will solve ur problem,...if not then let me know
Tables: sflight. ”table control field name in screen
************************
types : begin of ty_xxx,
types : include structure sflight.
types : g_select type c. “mark name in table control
type : end of ty_xxx.
data : it_xxx type standard table of ty_xxx initial size 0 with header line.
or you can take it separately as work ares.
*********************
In PBO:
Module select_data_from_db.
LOOP AT it_xxx
INTO wa_xxx
WITH CONTROL TB_CL01.
MODULE move_to_ sflight.
In PAI:LOOP AT it_xxx. MODULE modify_internaltable.
Module move_to_sflight is:
g_select = wa_xxx-mark.
MOVE-CORRESPONDING wa_xxx to sflight.
Module modify_internaltable is:
wa_xxx-mark = g_select.
modify it_xxx from wa_xxx index tb_cl01-current_line.
2013 Apr 23 6:55 AM
what have you changed?
I know the definition between ************************
2013 Apr 23 8:15 AM
if you have specified the def. of internal table then
go to screen painter
double click on table control
it will open attribute of table control
in attribute there should we a tick on "w/selcolum" and in the input field write " it_xxx-g_select"
2013 Apr 23 7:39 AM
Hi,
Try writing the code in events.find some examples in links.
In se11 Display table.
Go to Utilities ---> Table maintenence Generator
Then Environment ---> Modification ---->Events-->click on new entries.
Press F4 and select appropriate event when u want changes to be triggered and create Include and write code in it.
check
http://****************/Tutorials/ABAP/TableMaintenance/events.htm
2013 Apr 23 11:47 AM
Hi,
if the given solutions are not working. try this one:
In PAI pass it_xxx into another table it_xxx_temp.
Now when it comes to PBO, you compare both it_xxx and it_xxx_temp and update the mark field in it_xxx based on it_xxx_dummy table.
Regards,
Swarna