BAdIs to change the exported data

Document typeBAdI
Delivery/AEB/AES_CONS_SDV_01
Shipment/AEB/AES_CONS_SHP_01
Invoice/AEB/AES_CONS_INV_01
Purchase document/AEB/AES_CONS_PD_01
Incoming Invoice/AEB/AES_CONS_II_01
Freight order/AE1/AES_CONS_FRO_01
Material document/AEB/AES_CONS_MD_01

The data sent to Customs Management can be changed using the according BAdI as listed in the table above. Each BAdI offers an interface method AFTER_STD_FILLING with the parameter IM_VALUE. This parameter contains the data determined by the standard logic of the plug-in. The data contained by this structure will be sent to Customs Management eventually, so you need to change it according to your requirements.

This simple example shows how you can change a single field value in the IM_VALUE structure:

DATA:
    remark TYPE /aeb/if_aes_pb_consignment_do=>t_remark.

  CONCATENATE 'Invoice number: ' im_vbrk-vbeln ', invoice date: ' im_vbrk-fkdat
         INTO remark
         SEPARATED BY space.
  im_value->set_remark( remark ).

The IM_VALUE parameter is a structure of type /AEB/IF_AES_PB_CONSIGNMENT_DO, which represents a consignment of Customs Management. It contains different sub objects:

  • Deliveries
  • Items
  • Packages
  • Parties

So regardless of what kind of SAP business object triggered the data transfer, Customs Management is always receiving a consignment with the related sub-structures.

SAP business object transfered to AEBSAP levelInterface object
InvoiceInvoiceConsignment
-"-InvoiceDelivery
-"-Invoice itemsItem
ShipmentShipmentConsignment
-"-Outbound deliveries of the shipmentDelivery
-"-Outbound delivery itemsItem
Outbound deliveryOutbound deliveryConsignment
-"-Outbound deliveryDelivery
-"-Outbound delivery itemsItem

What's Next

The following sections provide some code snippets to demonstrate changing of the data.