SAP BAPI_SHIPMENT_CREATE Function Module for Create Shipment
BAPI_SHIPMENT_CREATE is a standard bapi shipment create SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create Shipment processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for bapi shipment create FM, simply by entering the name BAPI_SHIPMENT_CREATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: V56I_BAPI
Program Name: SAPLV56I_BAPI
Main Program: SAPLV56I_BAPI
Appliation area:
Release date: 17-May-2000
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_SHIPMENT_CREATE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'BAPI_SHIPMENT_CREATE'"Create Shipment.
EXPORTING
HEADERDATA = "Shipment BAPI, Header Data
IMPORTING
TRANSPORT = "Shipment Number
SHIPMENTGUID = "Globally Unique Identifier (Linked to Time Segment, etc)
TABLES
* HEADERDEADLINE = "Shipment BAPI, Deadlines
* ITEMDATA = "Shipment BAPI, Items
* STAGEDATA = "Shipment BAPI, Stages
* STAGEDEADLINE = "Shipment BAPI, Deadlines
* ITEMONSTAGE = "Shipment BAPI, Items on Stages
* ADDRESS = "Shipment BAPI, Addresses
* HDUNHEADER = "Shipment BAPI, Handling Unit Header Data
* HDUNITEM = "Shipment BAPI, Handling Unit Items
RETURN = "Return Parameter
IMPORTING Parameters details for BAPI_SHIPMENT_CREATE
HEADERDATA - Shipment BAPI, Header Data
Data type: BAPISHIPMENTHEADEROptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_SHIPMENT_CREATE
TRANSPORT - Shipment Number
Data type: BAPISHIPMENTIDS-SHIPMENTNUMOptional: No
Call by Reference: No ( called with pass by value option)
SHIPMENTGUID - Globally Unique Identifier (Linked to Time Segment, etc)
Data type: BAPISHIPMENTIDS-GUIDOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_SHIPMENT_CREATE
HEADERDEADLINE - Shipment BAPI, Deadlines
Data type: BAPISHIPMENTHEADERDEADLINEOptional: Yes
Call by Reference: Yes
ITEMDATA - Shipment BAPI, Items
Data type: BAPISHIPMENTITEMOptional: Yes
Call by Reference: Yes
STAGEDATA - Shipment BAPI, Stages
Data type: BAPISHIPMENTSTAGEOptional: Yes
Call by Reference: Yes
STAGEDEADLINE - Shipment BAPI, Deadlines
Data type: BAPISHIPMENTSTAGEDEADLINEOptional: Yes
Call by Reference: Yes
ITEMONSTAGE - Shipment BAPI, Items on Stages
Data type: BAPISHIPMENTITEMONSTAGEOptional: Yes
Call by Reference: Yes
ADDRESS - Shipment BAPI, Addresses
Data type: BAPISHIPMENTADDRESSOptional: Yes
Call by Reference: Yes
HDUNHEADER - Shipment BAPI, Handling Unit Header Data
Data type: BAPISHIPMENTHDUNHEADEROptional: Yes
Call by Reference: Yes
HDUNITEM - Shipment BAPI, Handling Unit Items
Data type: BAPISHIPMENTHDUNITEMOptional: Yes
Call by Reference: Yes
RETURN - Return Parameter
Data type: BAPIRET2Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_SHIPMENT_CREATE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_transport | TYPE BAPISHIPMENTIDS-SHIPMENTNUM, " | |||
| lv_headerdata | TYPE BAPISHIPMENTHEADER, " | |||
| lt_headerdeadline | TYPE STANDARD TABLE OF BAPISHIPMENTHEADERDEADLINE, " | |||
| lt_itemdata | TYPE STANDARD TABLE OF BAPISHIPMENTITEM, " | |||
| lv_shipmentguid | TYPE BAPISHIPMENTIDS-GUID, " | |||
| lt_stagedata | TYPE STANDARD TABLE OF BAPISHIPMENTSTAGE, " | |||
| lt_stagedeadline | TYPE STANDARD TABLE OF BAPISHIPMENTSTAGEDEADLINE, " | |||
| lt_itemonstage | TYPE STANDARD TABLE OF BAPISHIPMENTITEMONSTAGE, " | |||
| lt_address | TYPE STANDARD TABLE OF BAPISHIPMENTADDRESS, " | |||
| lt_hdunheader | TYPE STANDARD TABLE OF BAPISHIPMENTHDUNHEADER, " | |||
| lt_hdunitem | TYPE STANDARD TABLE OF BAPISHIPMENTHDUNITEM, " | |||
| lt_return | TYPE STANDARD TABLE OF BAPIRET2. " |
|   CALL FUNCTION 'BAPI_SHIPMENT_CREATE' "Create Shipment |
| EXPORTING | ||
| HEADERDATA | = lv_headerdata | |
| IMPORTING | ||
| TRANSPORT | = lv_transport | |
| SHIPMENTGUID | = lv_shipmentguid | |
| TABLES | ||
| HEADERDEADLINE | = lt_headerdeadline | |
| ITEMDATA | = lt_itemdata | |
| STAGEDATA | = lt_stagedata | |
| STAGEDEADLINE | = lt_stagedeadline | |
| ITEMONSTAGE | = lt_itemonstage | |
| ADDRESS | = lt_address | |
| HDUNHEADER | = lt_hdunheader | |
| HDUNITEM | = lt_hdunitem | |
| RETURN | = lt_return | |
| . " BAPI_SHIPMENT_CREATE | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_SHIPMENT_CREATE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single SHIPMENTNUM FROM BAPISHIPMENTIDS INTO @DATA(ld_transport). | ||||
| "SELECT single GUID FROM BAPISHIPMENTIDS INTO @DATA(ld_shipmentguid). | ||||
Search for further information about these or an SAP related objects