标签:back select idt field int 根据 image -- 共享
需求:根据物料号查询下层物料清单
DATA LV_MATNR LIKE ZMARA_TEST-MATNR VALUE ‘000000000000000001‘.
DATA: LT_MAT LIKE TABLE OF ZMARA_TEST.
PERFORM FRM_MULTIPLY USING LV_MATNR.
BREAK-POINT.
FORM FRM_MULTIPLY USING P_LV_MATNR LIKE ZMARA_TEST-MATNR.
DATA: LT_MAT_TEMP LIKE TABLE OF ZMARA_TEST, "必须定义局部变量,每层变量之间不共享
LS_MAT_TEMP LIKE ZMARA_TEST.
SELECT * INTO CORRESPONDING FIELDS OF TABLE LT_MAT_TEMP
FROM ZMARA_TEST
WHERE ZMATNR = P_LV_MATNR.
IF LT_MAT_TEMP IS NOT INITIAL.
LOOP AT LT_MAT_TEMP INTO LS_MAT_TEMP.
APPEND LS_MAT_TEMP TO LT_MAT.
PERFORM FRM_MULTIPLY USING LS_MAT_TEMP-MATNR. "form递归,循环调用本身
ENDLOOP.
ENDIF.
ENDFORM.
效果展示
标签:back select idt field int 根据 image -- 共享
原文地址:https://www.cnblogs.com/south-wall/p/11250038.html