‎2007 Sep 19 12:09 PM
Dear Friends,
I have created a table control to display material group and material number,
Exp: there are total 200 records and visible length in table control is 10 records,
and i have push button called "POSITION" in bottom of table control,
if I press the Position button need to display a subscreen with MATKL and MATNR selection fields and ones I entered the material number or material group then pressed the enter button ..I need to take the position in my table cotrol to the exact position of entered value in subscreen.
How to solve the problem?? pls give me some logic on this.
Thanks,
Sridhar.
‎2007 Sep 19 12:13 PM
Read internal table associated to the table control with the values entered on the subscreen and capture the sy-tabix value set the topline value of the table control with sy-tabix.
‎2007 Sep 19 12:14 PM
Hi ,
Check for the logic for transaction VOV8 .
Logic is create screen as modal dialog box with two fields material group or material number as input .
Then on input read the index and set the table control current line as that index .
Please reward if useful.
‎2007 Sep 19 12:20 PM
hi
Looping in a Step Loop
CURSOR <scroll-var>
The CURSOR parameter tells which internal table row should be the first in the screen
display. <Scroll-var> is a local program variable that can be set either by your program or
automatically by the system. The value of <scroll-var> is absolute with respect to the
internal table (that is, not relative to the FROM or TO values).
The CURSOR <scroll-var> parameter is required in the PBO event to tell the system where to
start displaying.
If u still have any doubts revert back to me, i will post the full code
Regards,
Prasant
*reward if useful
‎2007 Sep 19 12:26 PM
Hi Prashanth,
Thanks for the inputs...
I am training here..and if possible pls send me the code .
Thanks,
Sridhar
‎2007 Sep 19 12:36 PM
hi,
I think it should work
just try it.
LOOP AT itab.
IF itab-matnr = strin OR itab-matkl = strin.
line1 = sy-tabix.
EXIT.
ENDIF.
ENDLOOP.
IF line1 <> 0.
SET CURSOR LINE line1.
tab1-top_line = line1.
ENDIF.
here <b>itab</b> is my internal table.
<b>tab1</b> is table control.
<b>strin</b> is my input string which i want to find.
u can write this code the PBO module in which u fetching data.
just put one codition that u have enter search term or not.
Hope it will helpful.
‎2007 Sep 20 12:28 PM