我使用 ABAP 屏幕列表框创建了一个包含一些选择的报告。
REPORT z_prueba.
TYPE-POOLS: vrm.
DATA : name TYPE vrm_id,
list TYPE vrm_values,
value LIKE LINE OF list,
aux(85) TYPE c.
DATA: i_grupo TYPE STANDARD TABLE OF ztart_mto_1,
i_material TYPE STANDARD TABLE OF ztart_mto_2,
i_aux TYPE STANDARD TABLE OF ztart_mto_2,
wa_grupo TYPE ztart_mto_1,
wa_material TYPE ztart_mto_2,
wa_aux TYPE ztart_mto_2.
SELECTION-SCREEN BEGIN OF BLOCK cab WITH FRAME TITLE tcab.
PARAMETERS:
grupo TYPE ztart_mto_1-grupo AS LISTBOX VISIBLE LENGTH 80 USER-COMMAND gr.
SELECTION-SCREEN END OF BLOCK cab.
SELECTION-SCREEN BEGIN OF BLOCK art WITH FRAME TITLE tart.
PARAMETERS:
articulo TYPE ztart_mto_2-refn AS LISTBOX VISIBLE LENGTH 80 USER-COMMAND art.
SELECTION-SCREEN END OF BLOCK art.
INITIALIZATION.
tcab = 'Grupo de artículos'.
tart = 'Artículo del grupo'.
SELECT * INTO TABLE i_grupo FROM ztart_mto_1.
CLEAR list.
REFRESH list.
LOOP AT i_grupo INTO wa_grupo.
CLEAR value.
CLEAR aux.
CONCATENATE wa_grupo-grupo ` - ` wa_grupo-denom INTO aux.
value-key = wa_grupo-grupo.
value-text = aux.
APPEND value TO list.
ENDLOOP.
name = 'grupo'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
CLEAR name.
CLEAR list.
CLEAR i_grupo.
CLEAR wa_grupo.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR grupo.
IF grupo = ''.
"HERE I NEED TO PUT THE VALUE OF articulo IN BLANK
ELSE.
SELECT * FROM ztart_mto_2 WHERE grupo = @grupo INTO TABLE @i_material.
LOOP AT i_material INTO wa_material.
CLEAR value.
CLEAR aux.
CONCATENATE wa_material-refn ` - ` wa_material-descr INTO aux.
value-key = wa_material-refn.
value-text = aux.
APPEND value TO list.
ENDLOOP.
name = 'articulo'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
articulo = ''.
CLEAR grupo.
CLEAR aux.
CLEAR name.
CLEAR list.
CLEAR i_material.
CLEAR wa_material.
REFRESH i_material.
ENDIF.
articulo
当值为grupo
空白时,我需要更改值。
当我设置了一个值grupo
然后articulo
设置grupo
为空白时articulo
不会改变