Application Development 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: 

How can i set focus on table controls first line

Former Member
0 Kudos

I have lot of fields and one table control on a screen. The user enters a delivery number on the screen in a field and clicks on "Get" button which retrieves the handling units for that delivery in a table control. By default i want to select the first line of that table control after the user clicks "Get" button and retrieves data.

<b><REMOVED BY MODERATOR></b> Thanks for reading.

Message was edited by:

Alvaro Tejada Galindo

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I tried giving

set cursor field 'TABLE1' line 1. "Table control name

I also tried giving

set cursor field s_vepo-sel line 1. "Field in the internal table associated with

"TABLE1 control

but nothing seems to work.

6 REPLIES 6

Former Member
0 Kudos

You can use Select and Read Table with index set 1.

Select * into table TI_table from table.

read table ti_table index 1.

Regards

Allan Cristian

Former Member
0 Kudos

You can use below syntax :

if sy-ucomm = function code.

SET CURSOR FIELD gs_set_cursor-fieldname.

endif.

gs_set_cursor-fieldname -> internal table is using in Table control.

Thanks

Seshu

Former Member
0 Kudos

I tried giving

set cursor field 'TABLE1' line 1. "Table control name

I also tried giving

set cursor field s_vepo-sel line 1. "Field in the internal table associated with

"TABLE1 control

but nothing seems to work.

0 Kudos

Hello Krishna,

I am using below syntax and it works great.

I am writing below code at pbo.

here tc is the table control

PROCESS BEFORE OUTPUT.

loop with control tc.

module modify.

endloop.

<b>MODULE STATUS_9000. -> I am double click on module</b>

MODULE STATUS_9000 OUTPUT.

SET PF-STATUS '9000'.

Please use sy-ucomm as per your requirement

<b>set cursor field i_data-matnr line tc-top_line.</b>

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_9000 OUTPUT

Thanks

Seshu

0 Kudos

In the PBO, when you move the data from the internal table to the table control, try setting the selection field at that point to the record you want to be selected.

You'll have to set that field in the PAI.

Rob

Message was edited by:

Rob Burbank

0 Kudos

Please use below logic ,you should get it now >

Field name should be within single quotation and should be upper case

set cursor field 'I_DATA_MATNR' line 1.

Thanks

Seshu