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

Regarding Cursor Position in Module Pool

Former Member
0 Likes
3,426

Hi Gurus,

I am working on Dialog Programming, when i enter values into input fields in the screen and press Enter , the cursor is moving into the first input field .... but i want that cursor on the same input field where the user press enter. How can i do that?

Waiting for ur reply....

-


Regards

Srinath

4 REPLIES 4
Read only

Former Member
0 Likes
1,711

Hi Sreenath,

Please use the key word SET CURSOR

for futher help go through the key word documentation.

hope this will serve your purpose.

regards

Ramchander Rao.K

Read only

Former Member
0 Likes
1,711

Hi Srinath

Setting the Cursor Position

When a screen is displayed, the system automatically places the cursor in the first field that is ready for input. However, you can also define on which screen element the cursor should appear in your program. The screen element does not have to be an input field. Positioning the cursor can make applications more user-friendly.

You can set the cursor position either statically in the Screen Painter or dynamically in your ABAP program.

Static Cursor Position

To define the cursor position statically, enter the name of the required screen element in the Cursor position screen attribute in the Screen Painter.

Dynamic Cursor Position

To set the cursor position dynamically, use the following statement in an ABAP dialog module in the PBO event:

SET CURSOR FIELD <f> [OFFSET <off>].

<f> can be a literal or a variable containing the name of a screen element. You can use the OFFSET addition to place the cursor at a particular point within an input/output field.

Please refer this link for more details:

http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dbac0b35c111d1829f0000e829fbfe/content.htm

Regards

Neha

Read only

Former Member
0 Likes
1,711

Hi,

1. Get field name where cursor is. use command GET CURSOR FIELD in PAI.

2. Set the cursor into the field. Use command SET CURSOR FIELD in PBO.

Ex.

PROCESS BEFORE OUTPUT.

MODULE set_cursor.

PROCESS AFTER INPUT.

MODULE get_cursor.

MODULE get_CURSOR INPUT.

data : wa_cursor(40).

get CURSOR FIELD wa_cursor.

ENDMODULE. " SET_CURSOR INPUT

MODULE SET_CURSOR OUTPUT.

set CURSOR FIELD wa_cursor.

ENDMODULE. " SET_CURSOR OUTPUT

it is working fine.

Read only

Former Member
0 Likes
1,711

You can place the cursor at the required field using Set Cursor

Syntax : SET CURSOR FIELD fieldname OFFSET numeric.

If you want to check where the cursor is currently use Get cursor.

Syntax : GET CURSOR FIELD fld.