BAdIs to change the exported data

SAP business object / documentBAdI
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 for the SAP business object 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 in this structure will be sent to Customs Management eventually, so you need to change it in the BAdI implementation according to your requirements.

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

    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 object containing the mentioned sub-objects. Some examples:

SAP business object transfered to AEBSAP levelInterface object
-"-Invoice itemsItems
-"-Deliveries of the shipmentDeliveries
-"-Delivery itemsItems
-"-Handling unitsPackages
Outbound deliveryOutbound deliveryConsignment
-"-Outbound deliveryDeliveries
-"-Outbound delivery itemsItems
-"-Handling unitsPackages
Purchase orderPurchase orderConsignment
Purchase orderDelivery
Purchase order itemsItems
etc. etc.

What's Next

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