Application Development and Automation 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: 
Read only

Setting custom cursor position in Module Pool programming

Former Member
0 Likes
6,082

Hi,

I am working on the module pool program, I have created one screen with certain fields from database table .

I have to give functionality to the user that when the user enters first record on the screen and press ENTER the cursor must move to next field. I this way user must fill all the fields on the screen and after saving all the data using SAVE on the standard toolbar screen must be cleared for next entry.

If anybody have any idea how to achieve this please share it with me.

Thanks

Avadhut

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,643

You should use a combination of GET CURSOR (in PAI) and SET CURSOR (in PBO).

in PAI

GET CURSOR FIELD l_cursor l_cursor_line.

in PBO

CASE l_cursor.

  WHEN 'FIELD1'.

    SET CURSOR FIELD 'FIELD2'.

  WHEN 'FIELD2'.

    SET CURSOR FIELD 'FIELD3'.

and so on..

if you wish to move down a line in a table control, when you reach the last field in the preceeding line ADD 1 TO L_CURSOR_LINE.

4 REPLIES 4
Read only

SyambabuAllu
Contributor
0 Likes
2,643

Hi Avadhut,

Can you try with below link

http://scn.sap.com/thread/197885

Thanks,

Syam

Read only

Former Member
0 Likes
2,643

Hi Avadhut,

You can set the cursor field by using the stmt SET CURSOR FIELD <fld> in the PBO.

Regards,

Ashish Kumar.

Read only

Former Member
0 Likes
2,644

You should use a combination of GET CURSOR (in PAI) and SET CURSOR (in PBO).

in PAI

GET CURSOR FIELD l_cursor l_cursor_line.

in PBO

CASE l_cursor.

  WHEN 'FIELD1'.

    SET CURSOR FIELD 'FIELD2'.

  WHEN 'FIELD2'.

    SET CURSOR FIELD 'FIELD3'.

and so on..

if you wish to move down a line in a table control, when you reach the last field in the preceeding line ADD 1 TO L_CURSOR_LINE.