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

How to put cursor in table controll fields

Former Member
0 Likes
841

How to move cursor in Table controll's fields after entering the values

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
819

Udaya,

For example, here is the exact code which is working in my system and has been for quite a while.

The screen flow logic.

PROCESS BEFORE OUTPUT.

MODULE STATUS_1500.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1500.

The code for module status_1500.

************************************************************************

  • Module STATUS_1500 OUTPUT

************************************************************************

module status_1500 output.

set pf-status 'STDCONSOLE'.

set titlebar '1500_07'.

********************************************

<b> set cursor field cursorfield.</b>----


This is your requirement

********************************************

endmodule.

The PAI module USER_COMMAND_1500

************************************************************************

  • Module USER_COMMAND_1500 INPUT

************************************************************************

module user_command_1500 input.

case sy-ucomm.

when 'ENTER'.

<b>* Scroll thru fields when user hits enter

get cursor field cursorfield.

case cursorfield.

when 'P_TICNO'.

cursorfield = 'P_PERNR'.

when 'P_PERNR'.

cursorfield = 'P_WERKS'.

when 'P_WERKS'.

cursorfield = 'P_LGORT'.

when 'P_LGORT'.

cursorfield = 'P_AREAC'.

when 'P_AREAC'.

cursorfield = 'P_TICNO'.

endcase.</b>

......

endcase.

Here I'm using the same variable CURSORFIELD for setting/getting

Don't forget to reward if useful........

6 REPLIES 6
Read only

Former Member
0 Likes
819

HI,

u can use GET cursor < cursor name> statement.

<cursor-name is field name>

Regadrs

suresh.d

Read only

Former Member
0 Likes
819

you can use SET cursor command

Thanks

Seshu

Read only

Former Member
0 Likes
819

Hi ...

there is Cursor position attitribute in the attitribute screen of the any screen which you had created ... there do F4 it will show the SCREEN fields ... so that the Cursor will automatically placed ...

so see in your screen attrubute there in the Othere attribute block .... where you can mention next screen NO . below that .

need no to write any code for it even for table control also .

Next Screen 100

<b>Cursor position</b>

Screen group

reward points if it is usefull....

Girish

Read only

Former Member
0 Likes
820

Udaya,

For example, here is the exact code which is working in my system and has been for quite a while.

The screen flow logic.

PROCESS BEFORE OUTPUT.

MODULE STATUS_1500.

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1500.

The code for module status_1500.

************************************************************************

  • Module STATUS_1500 OUTPUT

************************************************************************

module status_1500 output.

set pf-status 'STDCONSOLE'.

set titlebar '1500_07'.

********************************************

<b> set cursor field cursorfield.</b>----


This is your requirement

********************************************

endmodule.

The PAI module USER_COMMAND_1500

************************************************************************

  • Module USER_COMMAND_1500 INPUT

************************************************************************

module user_command_1500 input.

case sy-ucomm.

when 'ENTER'.

<b>* Scroll thru fields when user hits enter

get cursor field cursorfield.

case cursorfield.

when 'P_TICNO'.

cursorfield = 'P_PERNR'.

when 'P_PERNR'.

cursorfield = 'P_WERKS'.

when 'P_WERKS'.

cursorfield = 'P_LGORT'.

when 'P_LGORT'.

cursorfield = 'P_AREAC'.

when 'P_AREAC'.

cursorfield = 'P_TICNO'.

endcase.</b>

......

endcase.

Here I'm using the same variable CURSORFIELD for setting/getting

Don't forget to reward if useful........

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
819

Hi,

In the PAI event while looping on the internal table

which is attched to the tb control .

Use chain end chain or field .

Make whatever validation u need and use.

SET CURSOR field "field name" of that column .

Hope this will help.

Read only

Former Member
0 Likes
819

U can use GET Cursor and SET Cursor keyword and can do that