1. 程式人生 > 其它 >MSSC 擴充物料庫存地點

MSSC 擴充物料庫存地點

一、MSSC

輸入庫存地點,點選儲存

 

 二、呼叫BAPI:BAPI_MATERIAL_SAVEREPLICA

DATA:ls_return TYPE bapiret2,
     lt_head   TYPE TABLE OF bapie1matheader WITH HEADER LINE,
     lt_mard   TYPE TABLE OF bapie1mard WITH HEADER LINE,
     lt_mardx  TYPE TABLE OF bapie1mardx WITH HEADER LINE.

lt_head-function     = '009'.
lt_head
-material = 'HYM01'. lt_head-storage_view = 'X'. APPEND lt_head. CLEAR lt_head. lt_mard-function = '009'. lt_mard-material = 'HYM01'. lt_mard-plant = '1000'. lt_mard-stge_loc = '1002'. APPEND lt_mard. CLEAR lt_mard. lt_mardx-function = '009'. lt_mardx-material = 'HYM01'. lt_mardx
-plant = '1000'. lt_mardx-stge_loc = '1002'. APPEND lt_mardx. CLEAR lt_mardx. CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA' EXPORTING noappllog = 'X' nochangedoc = '' testrun = '' inpfldcheck = '' IMPORTING return = ls_return
TABLES headdata = lt_head storagelocationdata = lt_mard storagelocationdatax = lt_mardx. IF ls_return-type <> 'E'. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = 'X'. ELSE. CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'. ENDIF.