Adding new line items to an Inbound delivery (with PO reference)

Method 1:

data: lv_li type ref to /spe/cl_id_handling,
        xs_lips type lipsvb,
        x_uepos type xfeld,
        e_result type /SPE/INB_RESULT.
 
  lv_li ?= /spe/cl_class_factory=>create_class(
        i_name = '/SPE/CL_ID_HANDLING' ).
 
  lv_li->a_vbeln = '0180000160'. " inbound delivery number
 
    CALL METHOD lv_li->select
      EXPORTING
        i_vbeln      = lv_li->a_vbeln
      IMPORTING
        e_result     = e_result.
 
  xs_lips-lfimg = '5'.
  xs_lips-vgbel = '5500000007'. " purschasir
  xs_lips-vgpos = '000010'.
  call method lv_li->item_add
    exporting
      i_line  = 2 "new pos.
    changing
      xs_lips = xs_lips
      x_uepos = x_uepos.
 
  call method lv_li->save
          importing
            e_result = e_result.

Method 2:
FM IDOC_INPUT_DELVRY:

ENHANCEMENT 15  DIMP_GENERAL_SAPLV55K.
LT_DELIVERY_EXTEND-DELIVERY_NUMBER = s_koko-vbeln_vl.
* ...
    CALL FUNCTION 'BAPI_DELIVERYPROCESSING_EXEC'
         EXPORTING
              DELIVERY_EXTEND = LT_DELIVERY_EXTEND
         TABLES
              REQUEST         = LT_REQUEST
              CREATEDITEMS    = LT_CREATEDITEMS
              RETURN          = LT_RETURN.

Method 3:
Just began to use external delivery numbers. In this case such deliveries can be deleted and re-created with the same number.

Добавить комментарий



All fields are required. Your email address will not be published.