BAdI to handle synchronized shipping orders

When a shipping order gets updated in Carrier Connect, the data is also synchronized back to SAP. To access this data and implement your own logic, you can use the BAdI /AEB/PA_DLS_01.

Here is a short example to write the recieved carrier shipment number into the BOLNR of the delivery.

DATA:
  vbelns TYPE TABLE OF vbeln,
  vbeln  TYPE vbeln,
  tknum  TYPE tknum.
FIELD-SYMBOLS:
  <curr_vbeln> TYPE vbeln.

IF im_shipment-carriershipmentnumber IS NOT INITIAL.
  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = im_shipment-referencenumber1
    IMPORTING
      output = tknum.
  SELECT vbeln
    FROM vttp
    INTO TABLE @vbelns
    WHERE tknum = @tknum.
  IF vbelns IS INITIAL.
    vbeln = tknum.
    APPEND vbeln TO vbelns.
  ENDIF.
  LOOP AT vbelns ASSIGNING <curr_vbeln>.
    UPDATE likp
    SET bolnr = im_shipment-carriershipmentnumber
    WHERE vbeln = <curr_vbeln>.
  ENDLOOP.
ENDIF.