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: 

table control top line problem

darren_bambrick2
Active Participant
0 Kudos

Hi All

I have a problem with a table control and setting cursors and the top line.

I have a table with 10 lines and only 4 are visible at a time.

I scan a material and i set the cursor to the field where the user can enter a quantity.

My problem arises when the material I scan is not in the first four visible items of the table control.

If the material is item 8, I do a scan, i set the top line of the table control to the material index in the pai and then in the pbo

i set the cursor field to line 8.

The top line is set correctly but the cursor field is not set.

I use set cursor <fieldname> line <line No>

Any help would be great

Thanks

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

Your eight record is now on the first line, so you need to set LINE 1 in the Set Cursor


set cursor <fieldname> line 1.

Regards,

Naimesh Patel

5 REPLIES 5

naimesh_patel
Active Contributor
0 Kudos

Your eight record is now on the first line, so you need to set LINE 1 in the Set Cursor


set cursor <fieldname> line 1.

Regards,

Naimesh Patel

0 Kudos

Hi Nimesh

Thanks for replying

It didn't work for me, the cursor remains in the barcode for the material number.

In the PAI I set the top line to the item index.

In the Pbo is set the cursor field to line 1.

MODULE status_0200.

MODULE tab_output_change_tc_attr.

LOOP AT tbl_items

WITH CONTROL tab_output

CURSOR tab_output-current_line.

module save_index.

MODULE tab_output_get_lines.

module set_line_enabled_status.

ENDLOOP.

MODULE init_0200.

MODULE set_cursor_field. " this is where i set my cursor

**************************************************

MODULE set_cursor_field

IF p_line > 0.

IF p_line > 4.

SET CURSOR FIELD cursorfield LINE 1.

ELSE.

SET CURSOR FIELD cursorfield LINE p_line.

ENDIF.

ELSE.

SET CURSOR FIELD 'P_MATNR'.

ENDIF.

IF p_line > 0.

IF p_line > 4.

SET CURSOR FIELD cursorfield LINE 1.

ELSE.

SET CURSOR FIELD cursorfield LINE p_line.

ENDIF.

ELSE.

SET CURSOR FIELD 'P_MATNR'.

ENDIF.

0 Kudos

Anyone got any ideas ?

0 Kudos

I believe your coding is not working.

you need to set the record you have selected (scan) always

on the top of the table control than you can set the cursor

fix on line 1

but please do it like this in PBO.

Data: ZEILE(6) TYPE N.

 ZEILE = 1.

 SET CURSOR FIELD 'ITAB-FELD3' LINE ZEILE.

Hope this is working.

0 Kudos

Thanks that worked