1. 程式人生 > >內向交貨單建立函式(BBP_INB_DELIVERY_CREATE、BAPI_DELIVERYPROCESSING_EXEC) VL31N

內向交貨單建立函式(BBP_INB_DELIVERY_CREATE、BAPI_DELIVERYPROCESSING_EXEC) VL31N

1 , BBP_INB_DELIVERY_CREATE

  ls_head-deliv_date = sy-datum.
  ls_head-ship_point = '2000'.
 
  ls_item-deliv_item = '000010'.
  ls_item-material = 'B01-089791-B1'.
  ls_item-deliv_qty = '1.000'.
  ls_item-unit = 'PCS'.
  ls_item-po_number = '2015031250'.
  ls_item-po_item = '00010'.
  APPEND ls_item TO lt_item.
  CLEAR ls_item.
 
 
  CALL FUNCTION 'BBP_INB_DELIVERY_CREATE'
    EXPORTING
      is_inb_delivery_header = ls_head
    IMPORTING
      ef_delivery            = lv_dn
    TABLES
      it_inb_delivery_detail = lt_item
      return                 = lt_ret.


2 , BAPI_DELIVERYPROCESSING_EXEC

  ls_req-id = '1'.
  ls_req-document_numb = '2015031250'.
  ls_req-document_item = '00010'.
  ls_req-extdelv_no = ''.  "LIFEX
  ls_req-plant = '2000'.
  ls_req-stge_loc = 'A097'.
  ls_req-quantity_base__uom = '1'.
  ls_req-delivery_date = sy-datum.
  ls_req-delivery_time = sy-uzeit.
  ls_req-document_type = 'B'.  " B - PO  , L - DN , A - SALES ORDER
  APPEND ls_req TO lt_req.
  CLEAR ls_req.
  CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
    TABLES
      request      = lt_req
      createditems = lt_result           "ID - DN
      return       = lt_return.