物料搜索功能 根据 客户工厂 销售组织
Posted ferzalez
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了物料搜索功能 根据 客户工厂 销售组织相关的知识,希望对你有一定的参考价值。
REPORT ZSDR227. TYPE-POOLS: SLIS. "ALV *---------------------------------------------------------------------* *&数据类型定义 *---------------------------------------------------------------------* *TYPES: * BEGIN OF TP_XX, * * END OF TP_XX. *---------------------------------------------------------------------* *&全局数据定义 *---------------------------------------------------------------------* DATA:LS_PARAMS TYPE WSD_MS_INITIAL_PARAMS_STY. *---------------------------------------------------------------------* *&全局常量定义 *---------------------------------------------------------------------* *---------------------------------------------------------------------* *&选择画面定义 *---------------------------------------------------------------------* SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-B01. PARAMETER:P_KUNNR TYPE KUNNR OBLIGATORY, P_WERKS TYPE WERKS_D OBLIGATORY, P_VKORG TYPE VKORG OBLIGATORY, P_AUART TYPE AUART OBLIGATORY DEFAULT ‘ZOR‘. SELECTION-SCREEN END OF BLOCK B1. *---------------------------------------------------------------------* *&初始化 *---------------------------------------------------------------------* INITIALIZATION. *---------------------------------------------------------------------* *&选择画面相应 *---------------------------------------------------------------------* AT SELECTION-SCREEN. *---------------------------------------------------------------------* *&程序运行 *---------------------------------------------------------------------* START-OF-SELECTION. SELECT SINGLE COUNT(*) FROM KNVV WHERE KUNNR = P_KUNNR AND VKORG = P_VKORG. IF SY-SUBRC <> 0. MESSAGE ‘客户与销售组织不匹配‘ TYPE ‘S‘ DISPLAY LIKE ‘E‘. LEAVE LIST-PROCESSING. ENDIF. LS_PARAMS-APP_NAME = CL_WSD_CONSTANTS=>CO_APPL_SALES_ORDER. LS_PARAMS-KUNNR = P_KUNNR. LS_PARAMS-VKORG = P_VKORG. LS_PARAMS-VTWEG = ‘10‘. LS_PARAMS-WERKS = P_WERKS. LS_PARAMS-SPART = ‘00‘. LS_PARAMS-AUART = P_AUART. LS_PARAMS-EFFECTIVE_DATE = SY-DATUM. CALL FUNCTION ‘WSD_MATERIAL_SEARCH‘ EXPORTING IS_PARAMS = LS_PARAMS. *---------------------------------------------------------------------* *&程序结果 *---------------------------------------------------------------------* END-OF-SELECTION.