2013 Aug 02 10:09 AM
Hi Guru,
I have a table control in which multiple rows can be selected.
My requirement is to know which row is selected first.
Can it be possible?
Plz help.
Thanks & Regards,
Abdul.
Hi Guru,
I have a table control in which multiple rows can be selected.
My requirement is to know which row is selected first.
Can it be possible?
Plz help.
Thanks & Regards,
Abdul.
2013 Aug 02 10:24 AM
Hi Abdul,
It is very easy. The table control to be displayed is displayed according to your entries in your internal table. When you select any entry there is a 1 char field in the table control that gets selected. So in PAI when you loop on your internal table, all the selected fields will be marked as X in your 1 char field. It will be in the same order.
Hope its clear.
2013 Aug 02 10:35 AM
Hi Siddharth,
Question is not that , how we can know which selected first in table control.
2013 Aug 02 10:40 AM
Hi Ramesh,
Can it be possible??If yes, do you know the solution?
Regards,
Abdul
2013 Aug 02 11:38 AM
2013 Aug 02 10:44 AM
s/m Abdul,
Declare ABAP variable to store line selection indicator.
DATA: MARK TYPE C.
In your internal table also keep a field as SEL
Now in the Screen
In the PAI.
PROCESS AFTER INPUT.
loop at itab.
module update_table.
endloop.
Now insert the following ABAP code into this PAI module!
*&---------------------------------------------------------------------*
*& Module update_table INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module update_table input.
read table itab into wa_itab index tc100-CURRENT_LINE.
wa_itab-SEL = mark.
modify itab from wa_itab index tc100-CURRENT_LINE.
endmodule. " update_table INPUT
I have given for both Single as well as Multi Select.
You can read the table itab where sel = 'X' this will give you the first selected record.
2013 Aug 02 11:10 AM
w/s mohammed bhai,
but how to trigger PAI when we select a row in table control.
I checked.It is not triggering PAI when i select a row in table control.
Regards,
Abdul
2013 Aug 02 11:44 AM
The PAI will trigger when you press Enter or any executing button.
2013 Aug 02 11:47 AM
Yes abdul. You are correct. Just by selecting the rows doesnt call PAI.
I dont think this is possible to know which row has been selected first in ascending order.
Only thing we can get are the selected rows.
Or else we need to call PAI everytime we select a row in table control.
2013 Aug 02 11:58 AM
hi,
but i dont want to press enter or any execution button.
Can it be possible to trigger now.....(we can just click on a row.No pressing of button etc)
regards,
Abdul
2013 Aug 02 11:59 AM
Yes Siddharth.
Do you know how to trigger PAI everytime..as you have written "Or else we need to call PAI everytime we select a row in table control."
Regards,
Abdul
2013 Aug 02 12:02 PM
Hi Abdul.
As such it is not possible since PAI won't be triggered from selection line.
But there is one alternative way for your requirement.
1) Disable default selection (means user cannot select it by pressing selection line)
PBO
loop at screen.
if screen-name = 'ITAB-SEL'.
screen-active = 0.
modify screen.
endif.
endloop.
2) Deploy additional column for the selection in table control with either button or hyperlink (Which Triggers PAI).
In your PAI,highlight the selected record by passing itab-sel = 'X'
3)Write the logic to find out which one is the first selected.
Hope it helps you
2013 Aug 02 12:01 PM
Hi All,
If we have another field 'counter' in the original internal table which stores the record number (1 for 1st rec, 2 for 2nd rec etc) , cant this be used to get the record number of the selected record in the table control. Pls let me know your thoughts.
--Shankar--
2013 Aug 02 3:52 PM
Hi Rahiman,
Instead of selecting w/SelColumn check box in your table control. just put button in your table control and give FCODE for this. and please dont ask any example for this. it is very simple. and handle fcode with your selected line of table control.
Regards
Amit
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |