标签:mat join mil form 使用 where rom events style
*SALV显示数据
FORM DISPLAY_DATA.
*-----------1设置ALV窗口化--------------------
SET_POPUP_SIZE 20 120 7 27. "列起始,列结束,行起始,行结束
*----------2设置过滤字段----------------------
*ADD_FILTER ‘MATNR‘ ‘I‘ ‘EQ‘ ‘02-14-0004‘ ‘‘. "字段,标识,比较符,最小值,最大值
*----------3设置排序--------------------------
ADD_SORTS ‘ERSDA‘ 1 2 ‘‘. "排序字段,排序的顺序,【1】升序【2】降序,是否以此字段分类小计,‘X’-yes
*----------4设置合计-------------------------
ADD_SUM ‘BRGEW‘.
*----------5设置颜色-------------------------
SET_COL_COLOR ‘BRGEW‘ 4 1 0.
*----------DISPLAY--------------------------
DISPLAY_ALV DISPLAY_TAB ‘物料信息显示‘. "TABLE 表头,调用显示alv
ENDFORM.
*SALV事件使用
ADD_ALV_EVENTS ‘2‘ ‘CALL_SO‘. "先添加双击事件,CALL_SO为具体的双击事件实现内容
DISPLAY_ALV IMM_TAB ‘Material‘.
*双击事件响应的内容
FORM CALL_SO USING I_ROW
I_COLUMN.
READ TABLE IMM_TAB INTO IMM INDEX I_ROW.
IF SY-SUBRC = 0 AND I_COLUMN = ‘MATNR‘.
CLEAR ISO_TAB.
SELECT P~MATNR P~VBELN D~BSTKD K~AUART K~VKORG P~POSNR P~WAERK D~ZTERM
INTO CORRESPONDING FIELDS OF TABLE ISO_TAB
FROM VBAP AS P
INNER JOIN VBKD AS D ON P~VBELN = D~VBELN
INNER JOIN VBAK AS K ON P~VBELN = K~VBELN
WHERE MATNR = IMM-MATNR.
* ADD_ALV_EVENTS ‘3‘ ‘CALL_VA‘.
SET_POPUP_SIZE 20 120 7 27.
DISPLAY_ALV ISO_TAB ‘Sales Order‘. "双击后显示的内容
ENDIF.
ENDFORM.
标签:mat join mil form 使用 where rom events style
原文地址:https://www.cnblogs.com/zuoting-haoxue/p/12190527.html