Se utiliza el siguiente código:
PARAMETERS:
p_zona(5) AS LISTBOX VISIBLE LENGTH 5 OBLIGATORY. " Zona
INITIALIZATION.
PERFORM fill_listbox CHANGING p_zona.
FORM fill_listbox CHANGING p_zona.
TYPES: BEGIN OF ty_zona,
codzo TYPE zostb_zonapesca-codzo,
END OF ty_zona.
DATA: lt_zona TYPE STANDARD TABLE OF ty_zona WITH HEADER LINE,
wa_zona LIKE LINE OF lt_zona.
TYPE-POOLS: VRM.
DATA: name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list.
SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_zona
FROM zostb_zonapesca.
LOOP AT lt_zona INTO wa_zona.
value-key = wa_zona-codzo.
value-text = wa_zona-codzo.
APPEND value TO list.
ENDLOOP.
name = 'p_zona'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = name
VALUES = list
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
"Implement suitable error handling here
ENDIF.
ENDFORM. " FILL_LISTBOX
0 comentarios:
Publicar un comentario