首页 > 代码库 > SAP 参照sto订单创建外向交货BAPI

SAP 参照sto订单创建外向交货BAPI

 
DATA: VSTEL                        LIKE TVST-VSTEL,                             "装运点/接收点
      NUM_DELIVERIES               TYPE VBNUM,
      STOCK_TRANS_ITEMS LIKE BAPIDLVREFTOSTO OCCURS 0 WITH HEADER LINE.


SHIP_POINT = 1000.                                                              "装运点

STOCK_TRANS_ITEMS-REF_DOC = 4500000000.        "参考凭证
APPEND STOCK_TRANS_ITEMS.

REFRESH LT_RETURN.

CALL FUNCTION BAPI_OUTB_DELIVERY_CREATE_STO
  EXPORTING
    SHIP_POINT             = SHIP_POINT
  IMPORTING
    DELIVERY               = LF_VBELN
    NUM_DELIVERIES         = NUM_DELIVERIES
  TABLES
    STOCK_TRANS_ITEMS  = STOCK_TRANS_ITEMS
    DELIVERIES             = DELIVERIES
    CREATED_ITEMS          = CREATED_ITEMS
    EXTENSION_OUT          = EXTENSION_OUT
    RETURN                 = RETURN.

IF NOT LF_VBELN IS INITIAL.

  CALL FUNCTION BAPI_TRANSACTION_COMMIT
    EXPORTING
      WAIT = X.
ENDIF.

 

SAP 参照sto订单创建外向交货BAPI