SAP SUSAGE_INSERT2 Function Module for Insert Usage Entry into SUSAGE2
SUSAGE_INSERT2 is a standard susage insert2 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Insert Usage Entry into SUSAGE2 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 susage insert2 FM, simply by entering the name SUSAGE_INSERT2 into the relevant SAP transaction such as SE37 or SE38.
Function Group: SUSAGE_LOGGING
Program Name: SAPLSUSAGE_LOGGING
Main Program: SAPLSUSAGE_LOGGING
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SUSAGE_INSERT2 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 'SUSAGE_INSERT2'"Insert Usage Entry into SUSAGE2.
EXPORTING
* I_PPMSPV = ' ' "Component version as in PPMS
I_FEATURE = "Feature provided by product and registered in the taxonomy tool
* I_TYPE = ' ' "
* I_SUBTYPE = ' ' "
I_CONTAINER = "Container for generic data
* I_CONT2 = "Container2 for generirc data
* I_BUFFER_HANDLING = ' ' "Buffer usage, space=no buffer, 1= add to buffer, 2= commit buffer and clear
EXCEPTIONS
UPDATE_ERROR = 1 WRONG_INPUT = 2
IMPORTING Parameters details for SUSAGE_INSERT2
I_PPMSPV - Component version as in PPMS
Data type: SUSAGE-PPMSPVDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_FEATURE - Feature provided by product and registered in the taxonomy tool
Data type: SUSAGE-FEATUREOptional: No
Call by Reference: Yes
I_TYPE -
Data type: SUSAGE-TYPEDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_SUBTYPE -
Data type: SUSAGE-SUBTYPEDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_CONTAINER - Container for generic data
Data type: SUSAGE2-CONTAINEROptional: No
Call by Reference: Yes
I_CONT2 - Container2 for generirc data
Data type: SUSAGE2-CONT2Optional: Yes
Call by Reference: Yes
I_BUFFER_HANDLING - Buffer usage, space=no buffer, 1= add to buffer, 2= commit buffer and clear
Data type: CHAR01Default: SPACE
Optional: Yes
Call by Reference: Yes
EXCEPTIONS details
UPDATE_ERROR - Update not successful
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_INPUT - Wrong input for buffer handling
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SUSAGE_INSERT2 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_ppmspv | TYPE SUSAGE-PPMSPV, " SPACE | |||
| lv_update_error | TYPE SUSAGE, " | |||
| lv_i_feature | TYPE SUSAGE-FEATURE, " | |||
| lv_wrong_input | TYPE SUSAGE, " | |||
| lv_i_type | TYPE SUSAGE-TYPE, " SPACE | |||
| lv_i_subtype | TYPE SUSAGE-SUBTYPE, " SPACE | |||
| lv_i_container | TYPE SUSAGE2-CONTAINER, " | |||
| lv_i_cont2 | TYPE SUSAGE2-CONT2, " | |||
| lv_i_buffer_handling | TYPE CHAR01. " SPACE |
|   CALL FUNCTION 'SUSAGE_INSERT2' "Insert Usage Entry into SUSAGE2 |
| EXPORTING | ||
| I_PPMSPV | = lv_i_ppmspv | |
| I_FEATURE | = lv_i_feature | |
| I_TYPE | = lv_i_type | |
| I_SUBTYPE | = lv_i_subtype | |
| I_CONTAINER | = lv_i_container | |
| I_CONT2 | = lv_i_cont2 | |
| I_BUFFER_HANDLING | = lv_i_buffer_handling | |
| EXCEPTIONS | ||
| UPDATE_ERROR = 1 | ||
| WRONG_INPUT = 2 | ||
| . " SUSAGE_INSERT2 | ||
ABAP code using 7.40 inline data declarations to call FM SUSAGE_INSERT2
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 PPMSPV FROM SUSAGE INTO @DATA(ld_i_ppmspv). | ||||
| DATA(ld_i_ppmspv) | = ' '. | |||
| "SELECT single FEATURE FROM SUSAGE INTO @DATA(ld_i_feature). | ||||
| "SELECT single TYPE FROM SUSAGE INTO @DATA(ld_i_type). | ||||
| DATA(ld_i_type) | = ' '. | |||
| "SELECT single SUBTYPE FROM SUSAGE INTO @DATA(ld_i_subtype). | ||||
| DATA(ld_i_subtype) | = ' '. | |||
| "SELECT single CONTAINER FROM SUSAGE2 INTO @DATA(ld_i_container). | ||||
| "SELECT single CONT2 FROM SUSAGE2 INTO @DATA(ld_i_cont2). | ||||
| DATA(ld_i_buffer_handling) | = ' '. | |||
Search for further information about these or an SAP related objects