2005 Nov 28 2:07 PM
hi,
i have an issue
i have created a table-control in module programming with four columns.
correspondigly i have four text fields in the same screen.
Now if i select a line(row) from the table control
and press a button (say a pushbutton which i created),
i need the data of the selected line (in table control) to appear in the corresponding text fields.
How should i do that.
pls help me.
Deepak
2005 Nov 28 2:18 PM
Say your internal table on the control is I_TAB and control name is myControl. The statement will be as following.
read table I_TAB into w_TAB index myControl-current_line.
W_TAB will have the data of the selected line.
2005 Nov 28 2:18 PM
Say your internal table on the control is I_TAB and control name is myControl. The statement will be as following.
read table I_TAB into w_TAB index myControl-current_line.
W_TAB will have the data of the selected line.
2005 Nov 28 2:21 PM
In the PAI of the screen, check for the record selected. For this you need to have W/sel column checkbox selected in the table control properties and assign a field. This will be set to 'X' when you select the record.
In PAI loop at table control and select the record with this field = 'X'. This is the record user has selected in the table control.
Assign the values to respective 4 fields.
2005 Nov 28 2:21 PM
Hi,
I suppose that when you push the pushbutton you use a user-command. There you must check in the table control which is the selected line ( I suppose you have a flag to know the selected line). You can read table i_control with key flag = 'X' for example. And then when you have in the header line of i_control de data, you can put them into the text fields.
Regards.
Mireia
2005 Nov 28 2:23 PM
see example prg
DEMO_DYNPRO_TABCONT_LOOP
DEMO_DYNPRO_TABCONT_LOOP_AT