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 Position In TABLE CONTROL

NR_Ranasingh
Participant
0 Likes
4,334

Hi All,

My requirement is ....

in my screen i Have a TABLECONTROL .

I have 4 fields in a row on Tablecontrol . now if i put data on first field and get it validated by pressing the Enter button on the screen the cursor should automaticaly come to second field of the same row of same Tablecontrol .

i guess with the help Of GET cursor or TBCL-COLS properties ...( TBCL - Table Control name ).

but i don have any idea abt Get Cursor .

Any body knows how to achieve this .

Thanks .

4 REPLIES 4
Read only

Former Member
0 Likes
1,603

hi

try the demo standared reports for table control...

DEMO_DYNPRO_TABLE_CONTROL_1

DEMO_DYNPRO* F4

Read only

Former Member
0 Likes
1,603

Hi Sagar,

You will have to do something like this,

PROCESS AFTER INPUT.

*&spwizard: pai flow logic for tablecontrol 'TC_RATE_CARD'

loop at g_TC_RATE_CARD_itab.

chain.

field mark_sel.

field ZTGRATE_CARD-TIME_FROM.

field ZTGRATE_CARD-TIME_TO.

field ZTGRATE_CARD-MON_VAL.

field ZTGRATE_CARD-TUE_VAL.

field ZTGRATE_CARD-WED_VAL.

field ZTGRATE_CARD-THU_VAL.

field ZTGRATE_CARD-FRI_VAL.

field ZTGRATE_CARD-SAT_VAL.

field ZTGRATE_CARD-SUN_VAL.

module TC_RATE_CARD_modify on chain-request. "in this module validate your data{color]

  • MODULE CHECK_LINE_SELECT. " check line selection

endchain.

endloop.

AND ALSO

if the validations is successfully wirte this

SET CURSOR FIELD ztgrate_card-time_to LINE 1 .

this will set the cursor.

Hope this helps you,

Regards,

Abhijit G. Borkar

Read only

Former Member
0 Likes
1,603

Hi,

I have the same requirement.

Please try this.


  get cursor field l_tc_field_name.

  if sy-subrc = 0.
     set cursor field l_tc_field_name line 1.
    endif.

Regards

Arbind

Read only

awin_prabhu
Active Contributor
0 Likes
1,603

Dear Sagar,

Use GET CURSOR LINE in PAI and SET CURSOR FIELD in PBO like below. Create a function key 'ENTER' in PF-Status.


CONTROLS: tabctrl TYPE TABLEVIEW USING SCREEN 100. " Table control
DATA: g_f_lin TYPE i,
           ok_code TYPE sy-ucomm. 

PROCESS BEFORE OUTPUT.
  MODULE status_0100.
  MODULE next_line.

PROCESS AFTER INPUT.
  MODULE leave.

MODULE status_0100 OUTPUT.
  SET PF-STATUS 'HUSCREEN'.
  tabctrl-lines = 999.   " Set number of lines in table control. ' tabctrl' is Table control name
ENDMODULE.                 " STATUS_0100  OUTPUT

MODULE next_line OUTPUT.
  IF ok_code = 'ENTER'.
*Validate the entered value
*If OK increase curosr value by 1 and Set the Cursor to next line.
      g_f_lin = g_f_lin + 1.
    SET CURSOR FIELD 'VEKP_VENUM' LINE g_f_lin.  " VEKP_VENUM  is table control field name
*Else 
*Display an Error message
  ENDIF.
ENDMODULE.                 " NEXT_LINE  OUTPUT

MODULE leave INPUT.
  CLEAR ok_code.
  ok_code = sy-ucomm.
  CASE ok_code.
       WHEN 'ENTER'.
      GET CURSOR LINE g_f_lin.  " Get the Cursor line
     ENDCASE.
ENDMODULE.                 " LEAVE  INPUT

Thanks,