Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Module pool-Position button

Former Member
0 Kudos

Hi Champs,

I have tried to create position button in module pool like we have in NACE, wherein user doesnt have to scroll all the way into the Table COntrol to search for an entry. On the basis of the primary key which is Plant & Date he is able to go to that record.

But i have a small problem here.

The code i have written is:

MODULE position OUTPUT.

IF flag = 1.

DATA: f(25) TYPE c.

f = 'ITAB_PRODC-PLANT'.

tabctrl-v_scroll = 'X'.

tabctrl-current_line = tab.

SET CURSOR FIELD f LINE tab OFFSET 0.

CLEAR flag.

CLEAR tab.

ENDIF.

SET PF-STATUS 'ZCHNGENTRY'.

This works, but it takes me only to the entry which is visible in the table control. In case if I search for an entry for which we have to scroll down, 'SET CURSOR' doesnt auto-scroll into the table control and take me to that entry.

Plz help.

Thanx in advance,

Amit

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Amit,

Table Control can set its cursor only on the records currently displayed and can not set for other records.

Instead of doing like this, you can do as follows :

1. Sort the table according to your search fields i.e. Plant & Date

2. Search this table for given values using 'FIND IN TABLE' statement and get the least record number.

3. Assign that number to table control's TOP_LINE field. This step should be done in PBO and after 'LOOP...ENDLOOP' statement.

Try this.

Regards,

R.Nagarajan.

3 REPLIES 3

Former Member
0 Kudos

Hi Amit,

Table Control can set its cursor only on the records currently displayed and can not set for other records.

Instead of doing like this, you can do as follows :

1. Sort the table according to your search fields i.e. Plant & Date

2. Search this table for given values using 'FIND IN TABLE' statement and get the least record number.

3. Assign that number to table control's TOP_LINE field. This step should be done in PBO and after 'LOOP...ENDLOOP' statement.

Try this.

Regards,

R.Nagarajan.

Former Member
0 Kudos

Hi Amit,

I think you already know the record number.

Then just assign it to TOP_LINE field of table control and set cursor in first line.

Do this in PBO.

Regards,

R.Nagarajan.

0 Kudos

Thanx Nagaraj,

problem resolved..