Create consignment

This page describes an additional option to create a consignment. This part is not required.
Usually, a consignment can be created using the NAST Framework. We provided an API to create consigments independently.
This section lists the functions that can be used in a context of a concrete document to manually create a consignment. Choose the according object class for instantiation based on the document type:

Document typeClass to use
Billing document/AEB/CL_AES_PB_INV_EXP_BC
Purchase document/AEB/CL_AES_PB_PD_EXP_BC
Delivery document/AEB/CL_AES_PB_DLV_EXP_BC
Shipment document/AEB/CL_AES_PB_SHP_EXP_BC
Incoming invoice/AEB/CL_AES_PB_II_EXP_BC
Freight order/AE1/CL_AES_PB_FRO_EXP_BC
Material document/AEB/CL_AES_PB_MD_EXP_BC

You can use the function do_export to individually start the consignment of a document.

DATA:
  export_bc TYPE REF TO /aeb/cl_aes_pb_inv_exp_bc,
  vbeln     TYPE vbeln,
  cx_parm   TYPE REF TO cx_01_pb_missing_parm_sc,
  cx_exp		TYPE REF TO cx_01_pb_export_failed_sc.

  vbeln = '12345'.

export_bc = /aeb/cl_aes_pb_inv_exp_bc=>new( ).
TRY.
  export_bc->do_export( im_vbeln = vbeln ).
CATCH cx_01_pb_missing_parm_sc INTO cx_parm.
  * a parameter is missing
CATCH cx_01_pb_export_failed_sc INTO cx_exp.
	* export failed
ENDTRY.
DATA:
  export_bc TYPE REF TO /aeb/cl_aes_pb_pd_exp_bc,
  ebeln     TYPE ebeln,
  cx_parm   TYPE REF TO cx_01_pb_missing_parm_sc,
  cx_exp		TYPE REF TO cx_01_pb_export_failed_sc.

  ebeln = '12345'.
  export_bc = /aeb/cl_aes_pb_pd_exp_bc=>new( ).
TRY.
	export_bc->do_export( im_ebeln = ebeln ).
CATCH cx_01_pb_missing_parm_sc INTO cx_parm.
  * a parameter is missing
CATCH cx_01_pb_export_failed_sc INTO cx_exp.
	* export failed
ENDTRY.
DATA:
  export_bc TYPE REF TO /aeb/cl_aes_pb_dlv_exp_bc,
  vbeln     TYPE vbeln,
  cx_parm   TYPE REF TO cx_01_pb_missing_parm_sc,
  cx_exp		TYPE REF TO cx_01_pb_export_failed_sc.

	vbeln = '12345'.
	export_bc = /aeb/cl_aes_pb_dlv_exp_bc=>new( ).
TRY.
	export_bc->do_export( im_vbeln = vbeln ).
CATCH cx_01_pb_missing_parm_sc INTO cx_parm.
	* a parameter is missing
CATCH cx_01_pb_export_failed_sc INTO cx_exp.
	* export failed
ENDTRY.
DATA:
  export_bc TYPE REF TO /aeb/cl_aes_pb_shp_exp_bc,
  tknum     TYPE tknum,
  cx_parm   TYPE REF TO cx_01_pb_missing_parm_sc,
  cx_exp		TYPE REF TO cx_01_pb_export_failed_sc.

  tknum = '12345'.
  export_bc = /aeb/cl_aes_pb_shp_exp_bc=>new( ).
TRY.
	export_bc->do_export( im_vttk_tknum = tknum ).
CATCH cx_01_pb_missing_parm_sc INTO cx_parm.
	* a parameter is missing
CATCH cx_01_pb_export_failed_sc INTO cx_exp.
	* export failed
ENDTRY.
DATA:
  export_bc TYPE REF TO /aeb/cl_aes_pb_ii_exp_bc,
  belnr     TYPE re_belnr,
  gjahr     TYPE gjahr,
  cx_parm   TYPE REF TO cx_01_pb_missing_parm_sc,
  cx_exp		TYPE REF TO cx_01_pb_export_failed_sc.


  belnr = '12345'.
  gjahr = '2022'.

	export_bc = /aeb/cl_aes_pb_ii_exp_bc=>new( ).
TRY.
	export_bc->do_export( im_belnr = belnr
												im_gjahr = gjahr ).
CATCH cx_01_pb_missing_parm_sc INTO cx_parm.
	* a parameter is missing
CATCH cx_01_pb_export_failed_sc INTO cx_exp.
	* export failed
ENDTRY.
DATA:
  export_bc TYPE REF TO /aeb/cl_aes_pb_md_exp_bc,
  mblnr     TYPE mblnr,
  mjahr     TYPE mjahr,
  cx_parm   TYPE REF TO cx_01_pb_missing_parm_sc,
  cx_exp		TYPE REF TO cx_01_pb_export_failed_sc.

  mblnr = '12345'.
  mjahr = '2022'.

  export_bc = /aeb/cl_aes_pb_md_exp_bc=>new( ).
TRY.
  export_bc->do_export( im_mblnr = mblnr
  											im_mjahr = mjahr ).
CATCH cx_01_pb_missing_parm_sc INTO cx_parm.
	* a parameter is missing
CATCH cx_01_pb_export_failed_sc INTO cx_exp.
	* export failed
ENDTRY.
DATA:
  export_bc            TYPE REF TO /ae1/cl_aes_pb_fro_exp_bc,
  tor_id               TYPE /scmtms/tor_id,
  cx_parm   TYPE REF TO cx_01_pb_missing_parm_sc,
  cx_exp		TYPE REF TO cx_01_pb_export_failed_sc.

	tor_id = '12345'.

	export_bc = /ae1/cl_aes_pb_fro_exp_bc=>new( ).
TRY.
	export_bc->do_export( im_tor_id = tor_id ).
CATCH cx_01_pb_missing_parm_sc INTO cx_parm.
  * a parameter is missing
CATCH cx_01_pb_export_failed_sc INTO cx_exp.
	* export failed
ENDTRY.