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

Set the cursor in table control

Former Member
0 Likes
485

Hi experts.

I have created one module pool program in which i have table control which is for item details.

I have one problem, when user enter the first item entry the cursor goes to second line of table control. but when user enters 19 items the cursor goes to order type parameter (first parameter header information). I want that cursor should go to item 20 to enter the details of next items.

when you execute the program the screen shows only 19 lines of table control...

Can you please tell me how we can implement this?

thank you in advance..

Hi experts.

I have created one module pool program in which i have table control which is for item details.

I have one problem, when user enter the first item entry the cursor goes to second line of table control. but when user enters 19 items the cursor goes to order type parameter (first parameter header information). I want that cursor should go to item 20 to enter the details of next items.

when you execute the program the screen shows only 19 lines of table control...

Can you please tell me how we can implement this?

thank you in advance..

2 REPLIES 2
Read only

Former Member
0 Likes
448

Hi Ruchit,

At PBO you can set the cursor on a specific field of a specific row of a table control.

SET CURSOR FIELD f LINE lin [OFFSET off].

Using the optional addition OFFSET, you can enter the offset of the cursor in the field as described under Setting the Cursor Position .

Try exploring this code:-

REPORT demo_dynpro_set_cursor.

DATA:  field1(14) TYPE c, field2(14) TYPE c, field3(14) TYPE c,
       name(10) TYPE c.

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.

Regards

Abhii

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
448

Link:[Cursor Position on Table Controls|http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/content.htm]