BAdIs for archiving
These BAdIs enable you to determine further SAP objects for which your customs documents (e.g. ABD and AGV for German Export) should be archived and linked to.
Document type | BAdI |
---|---|
Delivery | /AEB/AES_AR_01 |
Incoming invoice | /AEB/AES_AR_02 |
Invoice | /AEB/AES_AR_03 |
Purchase document | /AEB/AES_AR_04 |
Shipment | /AEB/AES_AR_05 |
Freight order (available with version 1.1) | /AE1/AES_AR_06 |
Material document (available with version 1.1) | /AEB/AES_AR_06 |
Notes
Every BAdI definition contains a factory object that you can use to create new data objects.
You have to use predefined constants to refer to the SAP object and the archive type. The constant values are available in the interfaces
- /aeb/if_01_pb_ar_obj_do for the SAP objects
- /aeb/if_aes_pb_ar_type_obj_do for the archive types
There are currently two archive types implemented:
- Archive storage: This type is relevant for objects of type delivery, invoice, incoming invoice, purchase document and shipment. Documents are saved in your ArchiveLink repository and linked to the business object.
- Attachment: This type is only relevant for objects of type freight order. Documents are added to the attachment folder of the freight order.
Example implementations
DATA:
ar_obj_no TYPE /aeb/if_01_pb_ar_obj_do=>t_ar_obj_no,
ar_obj_nos TYPE /aeb/if_01_pb_ar_obj_do=>tt_ar_obj_no,
ar_obj_do TYPE REF TO /aeb/if_01_pb_ar_obj_do,
ar_obj_dos TYPE /aeb/if_01_pb_ar_obj_do=>tt_ar_obj_do,
ar_type_obj_do TYPE REF TO /aeb/if_aes_pb_ar_type_obj_do.
ar_obj_no = '0090000001'. "Replace this line with the determination of the invoice number.
APPEND ar_obj_no TO ar_obj_nos.
ar_obj_do = im_ar_data_object_factory->new_01_pb_ar_obj_do(
im_sap_object = /aeb/if_01_pb_ar_obj_do=>c_sap_object_invoice
im_ar_object_numbers = ar_obj_nos ).
APPEND ar_obj_do TO ar_obj_dos.
ar_type_obj_do = im_ar_data_object_factory->new_aes_pb_ar_type_obj_do(
im_archive_type = /aeb/if_aes_pb_ar_type_obj_do=>c_archive_type_arch_storage
im_ar_obj_dos = ar_obj_dos ).
APPEND ar_type_obj_do TO ch_value.
Updated about 2 years ago