SAP J_3G_SHIPMENT_SAVE Function Module for Save Shipping Document
J_3G_SHIPMENT_SAVE is a standard j 3g shipment save SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Save Shipping Document 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 j 3g shipment save FM, simply by entering the name J_3G_SHIPMENT_SAVE into the relevant SAP transaction such as SE37 or SE38.
Function Group: J3GM
Program Name: SAPLJ3GM
Main Program: SAPLJ3GM
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function J_3G_SHIPMENT_SAVE 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 'J_3G_SHIPMENT_SAVE'"Save Shipping Document.
EXPORTING
I_BELK = "'New' Document Header Record Data
I_YBELK = "'Old' Document Header Record Data
I_ACTVT = "01=Create, 02=Change
I_WFKNZ = "Indicator: Generate Event for Workflow
* I_COMMIT_WORK = 'X' "Commit Work
* I_NO_MM = ' ' "No MM Integration (for Value 'X')
IMPORTING
E_NUMBER = "Document Number
TABLES
T_XBELP = "Shipping Document Items Eqiuipment
T_XBELP_BAL = "Shipping Document Items Material
T_YBELP = "'Old' Shipping Document Items Equipment
T_YBELP_BAL = "'Old' Shipping Document Items Material
T_HBEST = "Historical Stock
T_TBEST = "Temporary Stock
T_YTBEST = "'Old' Temporary Stock
* T_XBDPOS = "Requisition Note Item
* T_YBDPOS = "Requisition Note Item
IMPORTING Parameters details for J_3G_SHIPMENT_SAVE
I_BELK - 'New' Document Header Record Data
Data type: J_3GBELKOptional: No
Call by Reference: No ( called with pass by value option)
I_YBELK - 'Old' Document Header Record Data
Data type: J_3GBELKOptional: No
Call by Reference: No ( called with pass by value option)
I_ACTVT - 01=Create, 02=Change
Data type:Optional: No
Call by Reference: Yes
I_WFKNZ - Indicator: Generate Event for Workflow
Data type: J_3GBELART-WFKNZOptional: No
Call by Reference: Yes
I_COMMIT_WORK - Commit Work
Data type: BAPI_COMMIT_WORK-COMMIT_WORKDefault: 'X'
Optional: Yes
Call by Reference: Yes
I_NO_MM - No MM Integration (for Value 'X')
Data type: XFELDDefault: SPACE
Optional: No
Call by Reference: Yes
EXPORTING Parameters details for J_3G_SHIPMENT_SAVE
E_NUMBER - Document Number
Data type: J_3GBELK-J_3GBELNRIOptional: No
Call by Reference: Yes
TABLES Parameters details for J_3G_SHIPMENT_SAVE
T_XBELP - Shipping Document Items Eqiuipment
Data type: J_3GBELP_SOptional: No
Call by Reference: Yes
T_XBELP_BAL - Shipping Document Items Material
Data type: J_3GBELP_SOptional: No
Call by Reference: Yes
T_YBELP - 'Old' Shipping Document Items Equipment
Data type: J_3GBELP_SOptional: No
Call by Reference: Yes
T_YBELP_BAL - 'Old' Shipping Document Items Material
Data type: J_3GBELP_SOptional: No
Call by Reference: Yes
T_HBEST - Historical Stock
Data type: /SAPCEM/HBEST_WOptional: No
Call by Reference: Yes
T_TBEST - Temporary Stock
Data type: J_3GTBESTSOptional: No
Call by Reference: Yes
T_YTBEST - 'Old' Temporary Stock
Data type: J_3GTBESTSOptional: No
Call by Reference: Yes
T_XBDPOS - Requisition Note Item
Data type: /SAPCEM/BDPOOptional: Yes
Call by Reference: Yes
T_YBDPOS - Requisition Note Item
Data type: /SAPCEM/BDPOOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for J_3G_SHIPMENT_SAVE 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_i_belk | TYPE J_3GBELK, " | |||
| lt_t_xbelp | TYPE STANDARD TABLE OF J_3GBELP_S, " | |||
| lv_e_number | TYPE J_3GBELK-J_3GBELNRI, " | |||
| lv_i_ybelk | TYPE J_3GBELK, " | |||
| lt_t_xbelp_bal | TYPE STANDARD TABLE OF J_3GBELP_S, " | |||
| lv_i_actvt | TYPE J_3GBELP_S, " | |||
| lt_t_ybelp | TYPE STANDARD TABLE OF J_3GBELP_S, " | |||
| lv_i_wfknz | TYPE J_3GBELART-WFKNZ, " | |||
| lt_t_ybelp_bal | TYPE STANDARD TABLE OF J_3GBELP_S, " | |||
| lt_t_hbest | TYPE STANDARD TABLE OF /SAPCEM/HBEST_W, " | |||
| lv_i_commit_work | TYPE BAPI_COMMIT_WORK-COMMIT_WORK, " 'X' | |||
| lv_i_no_mm | TYPE XFELD, " SPACE | |||
| lt_t_tbest | TYPE STANDARD TABLE OF J_3GTBESTS, " | |||
| lt_t_ytbest | TYPE STANDARD TABLE OF J_3GTBESTS, " | |||
| lt_t_xbdpos | TYPE STANDARD TABLE OF /SAPCEM/BDPO, " | |||
| lt_t_ybdpos | TYPE STANDARD TABLE OF /SAPCEM/BDPO. " |
|   CALL FUNCTION 'J_3G_SHIPMENT_SAVE' "Save Shipping Document |
| EXPORTING | ||
| I_BELK | = lv_i_belk | |
| I_YBELK | = lv_i_ybelk | |
| I_ACTVT | = lv_i_actvt | |
| I_WFKNZ | = lv_i_wfknz | |
| I_COMMIT_WORK | = lv_i_commit_work | |
| I_NO_MM | = lv_i_no_mm | |
| IMPORTING | ||
| E_NUMBER | = lv_e_number | |
| TABLES | ||
| T_XBELP | = lt_t_xbelp | |
| T_XBELP_BAL | = lt_t_xbelp_bal | |
| T_YBELP | = lt_t_ybelp | |
| T_YBELP_BAL | = lt_t_ybelp_bal | |
| T_HBEST | = lt_t_hbest | |
| T_TBEST | = lt_t_tbest | |
| T_YTBEST | = lt_t_ytbest | |
| T_XBDPOS | = lt_t_xbdpos | |
| T_YBDPOS | = lt_t_ybdpos | |
| . " J_3G_SHIPMENT_SAVE | ||
ABAP code using 7.40 inline data declarations to call FM J_3G_SHIPMENT_SAVE
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 J_3GBELNRI FROM J_3GBELK INTO @DATA(ld_e_number). | ||||
| "SELECT single WFKNZ FROM J_3GBELART INTO @DATA(ld_i_wfknz). | ||||
| "SELECT single COMMIT_WORK FROM BAPI_COMMIT_WORK INTO @DATA(ld_i_commit_work). | ||||
| DATA(ld_i_commit_work) | = 'X'. | |||
| DATA(ld_i_no_mm) | = ' '. | |||
Search for further information about these or an SAP related objects