Wednesday, May 03, 2006

[BW] Popup table list and return user selection

DATA: field_desc TYPE TABLE OF rsvbfidesc.
DATA: l_nr LIKE sy-tabix.

CLEAR: field_desc, wa_field_desc.
wa_field_desc-fieldnum = 5. "ex: ZSBU 是在table的第五欄
wa_field_desc-display = 'X'.
APPEND wa_field_desc TO field_desc.

i_ods-/BIC/ZSBU = '1011'.
append i_ods.
i_ods-/BIC/ZSBU = '1012'.
append i_ods.
i_ods-/BIC/ZSBU = '1013'.
append i_ods.
i_ods-/BIC/ZSBU = '1014'.
append i_ods.
l_nr = 0.
CALL FUNCTION 'RS_VALUES_BOX'
EXPORTING
left_upper_col = 5
left_upper_row = 5
pagesize = 20
title = 'Select SBU'(sdc)
IMPORTING
linenumber = l_nr
TABLES
field_desc = field_desc
value_tab = I_ods
EXCEPTIONS
OTHERS = 1.
read table i_ods index l_nr.