Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

position in table control

i add a button 'POSI' in table control

when i push the button , i want to like the right row to be the top of the table contorl

case ok_code,

when 'POSI'.

perform fm_position.

i use this the get the line:

FORM fm_position.

DATA : l_return TYPE c.

DATA :lt_fields TYPE STANDARD TABLE OF sval WITH HEADER LINE,

lw_fields TYPE sval.

DATA :l_title TYPE string.

l_title = 'Choose Bin Material and Batch'.

CLEAR lt_fields.

lw_fields-tabname = 'LINV'.

lw_fields-fieldname = 'LGPLA'.

lw_fields-field_attr = ' '.

lw_fields-field_obl = 'X'.

lw_fields-fieldtext = 'Bin'.

APPEND lw_fields TO lt_fields.

lw_fields-fieldname = 'MATNR'.

lw_fields-field_obl = ' '.

lw_fields-fieldtext = 'Material'.

APPEND lw_fields TO lt_fields.

lw_fields-fieldname = 'CHARG'.

lw_fields-field_obl = ' '.

lw_fields-fieldtext = 'Batch'.

APPEND lw_fields TO lt_fields.

CALL FUNCTION 'POPUP_GET_VALUES'

EXPORTING

no_value_check = 'X'

popup_title = l_title

start_column = '5'

start_row = '5'

IMPORTING

returncode = l_return

TABLES

fields = lt_fields

EXCEPTIONS

error_in_fields = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

IF l_return = ' '.

READ TABLE gt_tc WITH KEY lgpla = lt_fields-value.

IF sy-subrc = 0.

item_info-top_line = sy-tabix.

  • item_info_curr_line = sy-tabix.

  • item_info_tot_line = item_info-lines.

REFRESH lt_fields.

CLEAR l_return.

ENDIF.

ENDIF.

ENDFORM. " fm_position

and i can input the 3 parameters to search line ,but when i "enter", the line of table contorl are not changed ,why? how to do this??

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question