‎2008 Nov 20 10:54 AM
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
‎2008 Nov 20 11:01 AM
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
‎2008 Nov 23 5:24 AM
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
‎2008 Dec 01 5:32 AM
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.
‎2008 Dec 02 6:50 AM
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.