Skip to Content

Addition of text line item (Item category: TATX) to existing Delivery (VL02N) using FM

Hello All,

I have a requirement to add a new text line item (w/o SO reference) to the existing outbound delivery using BAPI/FM.

the FM that I checked are:

BAPI_DELIVERYPROCESSING_EXEC

/SPE/OUTB_DLV_CHG_ITEMS_INSERT.

The fact about these FMs are that, the FM do not return any error messages but neither do they add a new line item although using the BAPI:

BAPI_TRANSACTION_COMMIT.

can anyone help me resolving this issue?

Are there any other ways/BAPI/FM to add an item in the existing delivery?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Jul 25, 2018 at 09:43 AM
    • Didn't you get a single message even 'S', 'I' or 'W' in RETURN parameter?
    • How did you fill the parameters?
    Add comment
    10|10000 characters needed characters exceeded

    • And for FM: /SPE/OUTB_DLV_CHG_ITEMS_INSERT

      ls_delivery_head-vbeln = '0080000263'.
      ls_delivery_head-spe_le_scenario = 'I'.
      ls_delivery_head-spe_lifex_type = 'N'.
      
      *ls_new_items-rfpos  = '00020'.
      ls_new_items-matnr  = ' ' .
      ls_new_items-pstyv  = 'TATX'.
      ls_new_items-lfimg  = '1.00'.
      ls_new_items-vrkme  = 'PC'.
      ls_new_items-meins  = 'PC'.
      ls_new_items-umvkz  = '1'.
      ls_new_items-umvkn  = '1'.
      ls_new_items-arktx  = 'Test NC'.
      ls_new_items-werks  = 'HD02'.
      ls_new_items-lgort  = 'FG02'.
      ls_new_items-vbeln  = '0080000263'.
      ls_new_items-posnr  = '00020'.
      ls_new_items-meins  = 'PC'.
      ls_new_items-vgtyp  = 'J'.
      ls_new_items-posar  = 'B'.
      
      APPEND ls_new_items TO lt_new_items.
      
      is_process_steps-dlv_item_insert = 'X'.
      
      ls_process_steps-vbeln = '0080000263'.
      ls_process_steps-posnr = '00020'.
      ls_process_steps-dlv_item_insert = 'X'.
      APPEND ls_process_steps TO it_process_steps.
      
      CALL FUNCTION '/SPE/OUTB_DLV_CHG_ITEMS_INSERT'
        EXPORTING
          if_commit                    = 'X'
      *   IF_SYNCHRON                  = ' '
          if_no_messages_update        = ' '
      *   IF_UPDATE_PICKING            = ' '
      *   IF_NO_LOCK                   = ' '
      *   IF_CONFIRM_CENTRAL           = ' '
          if_database_update           = '1'
      *   IF_NO_REMOTE_CHG             = ' '
          if_error_messages_send       = ' '
          if_delivery_number           = '0080000100'
      *   IT_PARTNER_UPDATE            =
      *   IT_SERNR_UPDATE              =
          is_vbkok                     = is_vbkok
          it_process_steps             = it_process_steps
          is_process_steps             = is_process_steps
      *    it_delivery_item             = it_delivery_item
      *   IS_DELIVERY_HEAD             =
       TABLES
      *   it_vbpok                     = it_vbpok
          it_new_items                 = lt_new_items
      *   IT_NEW_ITEMS_SKU             =
      *   IT_VERKO_TAB                 =
      *   IT_VERPO_TAB                 =
      *   IT_VBSUPCON_TAB              =
      *   IT_VERPO_SERNR               =
      *   IT_HANDLING_UNITS            =
      *   IT_HU_HEADER_EPC             =
      *   IT_HU_ITEMS_EPC              =
      *   IT_AAC_ITEM_BLOCK            =
      *   IT_TMSTMP                    =
      *   IT_TEXTH                     =
      *   IT_TEXTL                     =
         et_return                    =  lt_return
                .
      CHECK lt_return[] IS INITIAL.
      COMMIT WORK AND WAIT.
      
  • Jul 25, 2018 at 09:37 AM

    Hi Neeraja,

    Please check Sample code for using BAPI 'BAPI_DELIVERYPROCESSING_EXEC'

    number of messages in a bapi return table

    Also check FM: BAPI_MESSAGE_GETDETAIL which returns long text also.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Neenu,

      BAPI: BAPI_OUTB_DELIVERY_CHANGE will allow to only change the existing data in the Outbound Delivery. You cannot add any new items using this BAPI. For that purpose i might have to activate switch LE_SFWS_SC3 which my team didnt allow me to.

      WS_DELIVERY_UPDATE / WS_DELIVERY_UPDATE_2: does not work (only changes/deletion of items are supported).

  • Jul 27, 2018 at 11:59 PM

    Google -> BAPI add item to delivery -> found this old post which is almost the exact same question (adding a new item without a reference). It doesn't have a definitive answer but offers some clues.

    It is very odd that return table is completely empty. Maybe there is something specific to the text type item? I'd try with a regular item just out of curiosity.

    Add comment
    10|10000 characters needed characters exceeded