Shipment Processing

Everything about processing the shipment.

The plug-in supports 3 types of SAP business objects that can be used to create and process a shipment in Carrier Connect:

  • Delivery (VL01N)
  • Shipment (VL01)
  • Freight Order

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:

Task

ABAP Function modules / Method and ClassClass

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_SHP_CR_SHP_W_PRINT
Shipment: /AEB/PA_PB_DLV_CR_SHP_W_PRINT
Freight order:
Class: /AE1/CL_PA_PB_FRO_PS_AC
Method: CREATE_SHP_W_PRINT

Create the shipment
No Prepare No Print
No Complete

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

Prepare and print Labels
Complete 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

Prepare Labels
Complete 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

So let's go on with our sample of processing a shipment by printining 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 object

Function module or ClassAndMethod

Freight Order

Class: /AE1/CL_PA_PB_FRO_PS_BC
Method: CANCEL_SHP

Shipment

/AEB/PA_PB_SHP_CANCEL_SHP

Delivery

/AEB/PA_PB_DLV_CANCEL_SHP

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.

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

Business object

Function 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