2010 Oct 20 9:19 AM
Hi all,
I am implementing search button, in which if I click on button, there are 2 fields OD and PERNR. Now, I need to search and highlight that record in the output table control. in my workarea I am am able get the desired single record, but I am not able to highlight it. I tried to use SET CURSER wa_tab-mandt line sy-tabix.. Please help me out
Hi all,
I am implementing search button, in which if I click on button, there are 2 fields OD and PERNR. Now, I need to search and highlight that record in the output table control. in my workarea I am am able get the desired single record, but I am not able to highlight it. I tried to use SET CURSER wa_tab-mandt line sy-tabix.. Please help me out
2010 Oct 20 10:04 AM
HI,
Have defined SEL field i.e for row selection in table control , then when u press the search button after find the record in internal table then set SEL field EQ 'X'. This wiill select the searched row so it will be highlighted.
Then write the Refresh table control statement.
Hope this helps
Regards,
Madhukar Shetty
2010 Oct 20 1:07 PM
Thanks Madhukar for the concern. But, I am using the with selct option in tab-control already. when I try to refresh using REFRESH CONTROL ctrl_name FROM SCREEN 9000, its a sytactical error.
2010 Oct 20 10:14 AM
Hi Rahul,
Go to screen attribute for the table control give the line sel field any value (say 'PICK').
set this line selector variable to 'X' in PBO of the table control with below logic.
Let say you are using itab internal table for table control then define this internal tbale as below
DATA : BEGIN OF itab OCCURS 0,
PICK.
INCLUDE STRUCTURE (structure refered for table control).
DATA END OF itab.
you can see we have added the column PICK in the internal table also which we have given for table control.
Now you must have coded for handling the search option and you got the particular searched record, modify PICK='X' for
this record in your internal table.So now you will have the searched value marked 'X' your table control.
And modify PBO of table control as follow.
loop with control <tabcntrl>.
Module highlight.
Endloop.
then Module highlight will be
Module highlight.
READ itab INDEX <tabcntrl>-CURRENT_LINE.
if itab-PICK = 'X'.
loop at screen.
screen-intensified = 1. or use (screen-color variable).
modify screen.
endloop.
endif.
endmodule.
Or to simply place a cursor use
SET CURSOR LINE (and give index here) , i think you have not used the proper set cursor statement please check it.
Hope this helps.
Regards,
Pawan
2010 Oct 20 10:36 AM
Hi,
I agree with madhukar shetty.
use the sel column functionality of table control it will be easier.in that you can use multiple select also.