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

cursor

Former Member
0 Likes
262

Hi...

i want to get the cursor in the next line after entering the data, so that i can enter the data in next line . please give me code .

and please check this code its not working...

&----


*& Module set_cursor OUTPUT

&----


  • text

----


data : r_line type i.

module set_cursor output.

set cursor field record-name line TCTRL_PHONELIST-current_line.

endmodule. " set_cursor OUTPUT

&----


*& Module get_cursor INPUT

&----


  • text

----


module get_cursor input.

get cursor field record-name line r_line.

r_line = r_line + 1.

TCTRL_PHONELIST-current_line = r_line.

endmodule. " get_cursor INPUT

1 REPLY 1
Read only

Former Member
0 Likes
233

hi,

you declare the field <b>record-name</b> before setting the cursor position on that particuller field.

we can set the cursor position in two way's.

<b>Static Cursor Position</b>

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

<b>Dynamic Cursor Position</b>

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

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

<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.

<b>follow this sample program.</b>

REPORT DEMO_DYNPRO_SET_CURSOR.

DATA: FIELD1(14), FIELD2(14), FIELD3(14),

NAME(10).

SELECTION-SCREEN BEGIN OF BLOCK BLOC WITH FRAME.

PARAMETERS: DEF RADIOBUTTON GROUP RAD,

TXT RADIOBUTTON GROUP RAD,

F1 RADIOBUTTON GROUP RAD,

F2 RADIOBUTTON GROUP RAD,

F3 RADIOBUTTON GROUP RAD.

SELECTION-SCREEN END OF BLOCK BLOC.

PARAMETERS POS TYPE I.

IF TXT = 'X'.

NAME = 'TEXT'.

ELSEIF F1 = 'X'.

NAME = 'FIELD1'.

ELSEIF F2 = 'X'.

NAME = 'FIELD2'.

ELSEIF F3 = 'X'.

NAME = 'FIELD3'.

ENDIF.

CALL SCREEN 100.

MODULE CURSOR OUTPUT.

IF DEF NE 'X'.

SET CURSOR FIELD NAME OFFSET POS.

ENDIF.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE BACK INPUT.

LEAVE SCREEN.

ENDMODULE.

At the start of the program, a selection screen appears on which you can select a cursor position.

Screen 100 is then called. The next screen (statically defined) for screen 100 is itself, and it has the following layout:

regards,

Ashok Reddy