cancel
Showing results for 
Search instead for 
Did you mean: 

Updating LIPS Custom Fields In Outbound Delivery Using BAPI

ariel_gluzman
Discoverer
0 Kudos
1,710

Hey people,

I have an Issue in which I fail to update delivery item fields when using 'BAPI_OUTB_DELIVERY_CHANGE'

I'll let you consider the following setting:

  • My System is ECC 6.0
  • I have extended standard table LIPS with a new field 'ZZEXT_REF'
  • I am receiving an update to the field mentioned with an incoming IDOC
    • something like [vbeln, posnr, ....., zzext_ref]

The solution I have gathered is this:

  1. Receive Delivery Number, Item Number, ZZEXT_REF from IDOC
  2. Call BAPI 'BAPI_OUTB_DELIVERY_CHANGE' with 
    1. DELIVERY = Delivery Number from IDOC
    2. EXTENSION2 = (
      1. ROW = Delivery Row
      2. FIELD = ZZEXT_REF
      3. VALUE = Value from IDOC
  3. Implement BAdI SMOD_V50B0001~EXIT_SAPLV50I_010 (Similar to what is done here)
    1. Export EXTENSION2 values using static member of a BAdI "
      LE_SHP_DELIVERY_PROC
      " Class
  4. Implement (as said above) a BAdI Class of "LE_SHP_DELIVERY_PROC"
    1. Implement SAVE_DOCUMENT_PREPARE, extract the data from the static member and insert it into field ZZEXT_REF of table CT_XLIPS at POSNR = ROW from EXTENSION2
  5. Call Commit After Calling 'BAPI_OUTB_DELIVERY_CHANGE'

The problem is that it all runs well except for the actual change save to table LIPS,
I thought it might be caused due to some efficiency mechanism that detected no changes to standard LIPS fields and therefore figured no changes should be done and dropped the change to db.

Suggestions will be suuuuuper useful.

Thanks,

Ariel.

Accepted Solutions (0)

Answers (1)

Answers (1)

ariel_gluzman
Discoverer
0 Kudos

Well,
after taking a deeper look into it, I found this

since non of the standard values change the system will not call the BAdI's (LE_SHP_DELIVERY_PROC) following methods:

- CHANGE_DELIVERY_HEADER
- CHANGE_DELIVERY_ITEM

but will call SAVE_DOCUMENT_PREPARE,
and what I did notice is that the system sets the update indicator to being empty instead of 'U' that will ultimately trigger an update i.e. XLIPS-UPDKZ = 'U' and/or XLIKP-UPDKZ = 'U', the one relevant for you depends whether you need changes in delivery header and/or items.

when you set these values to 'U' the values that you extracted from the 'BAPI_OUTB_DELIVERY_CHANGE' on BAdI 'SMOD_V50B0001' will be saved.