Document context functions

This section lists the functions that can be used in a context of a concrete document. Based on the document type you choose the according object class for instantiation:

Document type

Class to use

Billing document


Purchase document


Delivery document


Shipment document


Incoming invoice


Freight order


Querying customs declarations data

You can use the function get_declarations to query all associated customs declarations for a document that have already been synchronized.
It can be applied for all customs declarations generated via the International Customs Integration Engine (ICI).

  inv_decl_bc           TYPE REF TO /aeb/cl_aes_pb_inv_decl_bc,
  exception             TYPE REF TO /aeb/cx_aes_pb_get_decl_sc,
  result_do             TYPE REF TO /aeb/cl_aes_pb_get_decl_res_do,
  declaration_dos       TYPE /aeb/aes_if_aes_pb_decl_dos,
  declaration_do        TYPE REF TO /aeb/if_aes_pb_declaration_do,
  error_text            TYPE string,
  document_no           TYPE /aeb/aes_pb_doc_no VALUE '90017468',
  mrn_nv                TYPE REF TO /aeb/cl_01_char_35_nv,
  mrn                   TYPE string.

inv_decl_bc = /aeb/cl_aes_pb_inv_decl_bc=>new_for(
    im_doc_no = document_no ).

    result_do = inv_decl_bc->get_declarations( ).
    declaration_dos = result_do->get_ici_declarations( ).
    LOOP AT declaration_dos INTO declaration_do.
      mrn_nv = declaration_do->get_customs_registration_numbe( ).
      mrn = mrn_nv->v.
*     do something with MRN
  CATCH /aeb/cx_aes_pb_get_decl_sc INTO exception.
    error_text = exception->if_message~get_text( ).
*   react to errors

Marking documents as printed

One possible use case for reading the documents can be that you want to print them in a specific way which the standard product doesn't support. In this case you want to tell the standard application that you have printed the document yourself or rather mark the document as printed. For this there exists the class /AEB/CL_AES_PB_DOC_STA_BC with the method MARK_DOCUMENT_AS_PRINTED.