Shipment Processing

Everything about processing the shipment.

The add-on provides predetermined functions for the following SAP business objects to support the creation and processing of a shipment in Carrier Connect:

  • Delivery
  • Shipment
  • Freight Order
    But in general all business objects can be integrated (custom scenario).

The way they are handled is the same in the end, so once you understand the concept how it works for one of them you can apply it to the others as well.

Next, we prepared some example cases for processing the shipment. The first one is just to create the shipment with items and packages. But there are some more:

TaskABAP function module / class method
Create the shipment
Prepare labels
Complete the shipment
Delivery:
/AEB/PA_PB_DLV_CR_SHP_W_COMP
Shipment:
/AEB/PA_PB_SHP_CR_SHP_W_COMP
Freight order:
Class: /AE1/CL_PA_PB_FRO_PS_AC
Method: CREATE_SHP_W_COMPLETE
Create the shipment
Prepare and print all labels
Complete the shipment
Delivery:
/AEB/PA_PB_DLV_CR_SHP_W_PRINT
Shipment:
/AEB/PA_PB_SHP_CR_SHP_W_PRINT
Freight order:
Class: /AE1/CL_PA_PB_FRO_PS_AC
Method: CREATE_SHP_W_PRINT
Create the shipment
No preparation, no print
No completion
Delivery:
/AEB/PA_PB_DLV_CR_SHP
Shipment:
/AEB/PA_PB_SHP_CR_SHP
Freight order:
Class: /AE1/CL_PA_PB_FRO_PS_AC
Method: CREATE_SHP
Prepare and print labels
Complete the shipment
Delivery:
/AEB/PA_PB_DLV_PRINT_SHP
Shipment:
/AEB/PA_PB_SHP_PRINT_SHP
Freight order:
Class: /AE1/CL_PA_PB_FRO_PS_AC
Method: PRINT_SHP
Prepare labels
Complete the shipment
Delivery:
/AEB/PA_PB_DLV_COMPETE_SHP
Shipment:
/AEB/PA_PB_SHP_COMPETE_SHP
Freight order:
Class: /AE1/CL_PA_PB_FRO_PS_AC
Method: COMPLETE_SHP
Create the shipment (only if not already existing)
Prepare and print labels (also for reprinting if package already exists)
No completion
Delivery:
/AEB/PA_PB_DLV_CR_PKGS_W_PRINT
/AEB/PA_PB_DLV_CR_PKG_W_PRINT
Shipment:
/AEB/PA_PB_SHP_CR_PKGS_W_PRINT
/AEB/PA_PB_SHP_CR_PKG_W_PRINT
Freight order:
Class: /AE1/CL_PA_PB_FRO_PS_AC
Method: CREATE_PKGS_W_PRINT

So let's go on with an example of processing a shipment by printing labels and complete it.

REPORT zaeb_print_and_complete_shipment.

PARAMETERS: vbeln TYPE likp-vbeln.

DATA:
  likp  TYPE likp.

SELECT SINGLE * FROM likp INTO likp WHERE vbeln = vbeln.

CALL FUNCTION '/AEB/PA_PB_DLV_PRINT_SHP'
  EXPORTING
    im_likp  = likp.

Perfect - we just run through the whole standard process. But in some cases, it might be necessary to cancel the shipment to start over. Use one of the following functions in order to achieve this:

Business objectFunction module or class method
Freight OrderClass: /AE1/CL_PA_PB_FRO_PS_BC
Method: CANCEL_SHP
Shipment/AEB/PA_PB_SHP_CANCEL_SHP
Delivery/AEB/PA_PB_DLV_CANCEL_SHP

Cancel Shipment

Here is a code snippet that shows how to cancel the shipment in Carrier Connect that was created based on a SAP delivery.

REPORT zaeb_cancel_shipment.

PARAMETERS: vbeln TYPE likp-vbeln.

DATA:
  likp  TYPE likp.

SELECT SINGLE * FROM likp INTO likp WHERE vbeln = vbeln.

CALL FUNCTION '/AEB/PA_PB_DLV_CANCEL_SHP'
  EXPORTING
    im_likp  = likp.

Create Pickup

After we finished processing the shipment we have to create a pickup. That is possible via the following function modules.

Business objectFunction module
Shipment/AEB/PA_PB_CR_PU_W_PR_FOR_SHPS
Delivery/AEB/PA_PB_CR_PU_W_PR_FOR_DLVS
Custom object/AEB/PA_PB_CR_PU_W_PR_FOR_CUS