BAdIs to change the exported data

If you would like to change the data of the shipment, use the following BAdIs to change the data.

DocumentBAdI
Delivery/AEB/MA_DLV_CR_01
Shipment/AEB/MA_CWT_SHP_01 - BEFORE_STANDARD_FILLING /AEB/MA_CWT_SHP_02 - AFTER_STANDARD_FILLING
Freight order/AE1/MA_CWT_FRO_01
Sales order/AEB/MA_SDOC_CR_01

Change shipment data

This coding example sets the email address of the consignee in the shipment:

LOOP AT im_vbpas INTO ls_vbpa.
  IF ls_vbpa-parvw = 'WE'.
    CALL FUNCTION 'ADDR_GET_COMPLETE'
      EXPORTING
        addrnumber              = ls_vbpa-adrnr
      IMPORTING
        addr1_complete          = ls_addr1_compl
      EXCEPTIONS
        parameter_error         = 1
        address_not_exist       = 2
        internal_error          = 3
        wrong_access_to_archive = 4
        address_blocked         = 5
        OTHERS                  = 6.
    IF sy-subrc <> 0.
      RETURN.
    ENDIF.

    LOOP AT ls_addr1_compl-adsmtp_tab INTO ls_adsmtp.
      IF ls_adsmtp-adsmtp-remark = 'AEB'.
        ch_cons_w_trans_do-head-consignee-email_address = ls_adsmtp-adsmtp-smtp_addr.
      ENDIF.
    ENDLOOP.

  ENDIF.
ENDLOOP.

This example sets the details for the contact person at the consignee. Note: The consignee is handled by Monitoring & Alerting on item level.

DATA:
  contact TYPE REF TO /aeb/if_01_pb_contact_do.
FIELD-SYMBOLS:
    <curr_item>      TYPE /aeb/ma_pb_cwt20_cons_itm_do.

  contact = im_data_object_factory->new_01_contact_do( ).
  contact->set_name( 'Henry Smith' ).
  contact->set_email( '[email protected]' ).
  contact->set_phone( '0011194053' ).

"Loop over items
 LOOP AT ch_cons_w_trans_do-items ASSIGNING <curr_item>.
    <curr_item>-consignee-contact = contact.    “needs to be assigned on item level
  ENDLOOP.

ENDMETHOD.