SAP /ACCGO/CALCULATE_DERIVED_CHAR Function Module for Derived Characteristic Calculation
/ACCGO/CALCULATE_DERIVED_CHAR is a standard /accgo/calculate derived char SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Derived Characteristic Calculation 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 /accgo/calculate derived char FM, simply by entering the name /ACCGO/CALCULATE_DERIVED_CHAR into the relevant SAP transaction such as SE37 or SE38.
Function Group: /ACCGO/CCK_CALC_DERV_CHAR
Program Name: /ACCGO/SAPLCCK_CALC_DERV_CHAR
Main Program: /ACCGO/SAPLCCK_CALC_DERV_CHAR
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:
Function /ACCGO/CALCULATE_DERIVED_CHAR 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 '/ACCGO/CALCULATE_DERIVED_CHAR'"Derived Characteristic Calculation.
EXPORTING
IM_CALC_RULE = "Calculation Rule
IM_CHAR_PARAMS = "Table Type for Derived Characteristics
IM_CHAR_DETAILS = "Table Type for Characteristic Details
IMPORTING
EX_VALUE = "Reference Value
EX_UOM = "Unit of Measurement
EX_RETURN = "Return parameter table
EXCEPTIONS
CALC_RULE_INVALID = 1 NON_OPTIONAL_DATA_MISSING = 2
IMPORTING Parameters details for /ACCGO/CALCULATE_DERIVED_CHAR
IM_CALC_RULE - Calculation Rule
Data type: /ACCGO/E_CALCULATION_RULEOptional: No
Call by Reference: Yes
IM_CHAR_PARAMS - Table Type for Derived Characteristics
Data type: /ACCGO/CMN_TT_DERV_PARAM_UIOptional: No
Call by Reference: Yes
IM_CHAR_DETAILS - Table Type for Characteristic Details
Data type: /ACCGO/CMN_TT_CHAR_DETAILSOptional: No
Call by Reference: Yes
EXPORTING Parameters details for /ACCGO/CALCULATE_DERIVED_CHAR
EX_VALUE - Reference Value
Data type: /ACCGO/E_REF_VALUEOptional: No
Call by Reference: Yes
EX_UOM - Unit of Measurement
Data type: MSEHIOptional: No
Call by Reference: Yes
EX_RETURN - Return parameter table
Data type: BAPIRET2_TOptional: No
Call by Reference: Yes
EXCEPTIONS details
CALC_RULE_INVALID - Calculation rule invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NON_OPTIONAL_DATA_MISSING - Non optional data is missing
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for /ACCGO/CALCULATE_DERIVED_CHAR 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_ex_value | TYPE /ACCGO/E_REF_VALUE, " | |||
lv_im_calc_rule | TYPE /ACCGO/E_CALCULATION_RULE, " | |||
lv_calc_rule_invalid | TYPE /ACCGO/E_CALCULATION_RULE, " | |||
lv_ex_uom | TYPE MSEHI, " | |||
lv_im_char_params | TYPE /ACCGO/CMN_TT_DERV_PARAM_UI, " | |||
lv_non_optional_data_missing | TYPE /ACCGO/CMN_TT_DERV_PARAM_UI, " | |||
lv_ex_return | TYPE BAPIRET2_T, " | |||
lv_im_char_details | TYPE /ACCGO/CMN_TT_CHAR_DETAILS. " |
  CALL FUNCTION '/ACCGO/CALCULATE_DERIVED_CHAR' "Derived Characteristic Calculation |
EXPORTING | ||
IM_CALC_RULE | = lv_im_calc_rule | |
IM_CHAR_PARAMS | = lv_im_char_params | |
IM_CHAR_DETAILS | = lv_im_char_details | |
IMPORTING | ||
EX_VALUE | = lv_ex_value | |
EX_UOM | = lv_ex_uom | |
EX_RETURN | = lv_ex_return | |
EXCEPTIONS | ||
CALC_RULE_INVALID = 1 | ||
NON_OPTIONAL_DATA_MISSING = 2 | ||
. " /ACCGO/CALCULATE_DERIVED_CHAR |
ABAP code using 7.40 inline data declarations to call FM /ACCGO/CALCULATE_DERIVED_CHAR
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.Search for further information about these or an SAP related objects