ATP检测 BAPI BAPI_MATERIAL_AVAILABILITY
阅读原文时间:2023年07月15日阅读:1

*****ATP检测
       DATA: END_RLT LIKE EBAN-LFDAT,
             NOT_AVAILABLE,
             AVAILABLE(3),
             AVAIL_QTY_PLANT LIKE BAPICM61V-WKBST.
       DATA:xwmdvsx LIKE BAPIWMDVS OCCURS 0,
             xwmdvex LIKE BAPIWMDVE OCCURS 0.
       DATA: ls_temp type BAPIWMDVS.
       DATA: ls_temp_ex type BAPIWMDVE.

ls_temp-REQ_DATE = ls_sale-ETDAT.
       ls_temp-REQ_QTY = ls_sale-sqty.
       append ls_temp to xwmdvsx.

CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
         EXPORTING
           plant            = ls_sale-WERKS
           material         = ls_sale-MABNR
           unit             = ls_sale-meins
           check_rule       = 'A'
           STGE_LOC         = ls_sale-LGORT
*           BATCH            = ls_sale-CHARG
           CUSTOMER         = ls_first
*          DOC_NUMBER       = SALESDOCUMENT
           ITM_NUMBER       = ls_sale-POSNR
           DEC_FOR_ROUNDING = '0'
         IMPORTING
           endleadtme       = end_rlt
           av_qty_plt       = avail_qty_plant
           dialogflag       = not_available
         TABLES
           wmdvsx           = xwmdvsx
           wmdvex           = xwmdvex
         EXCEPTIONS
           error_message    = 1.

read table xwmdvex index 1 into ls_temp_ex.

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章