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

Function CMAC_ANALYSIS_SM 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 'CMAC_ANALYSIS_SM'"Pricing Analysis for Module.
EXPORTING
IS_ST_DATA = "Student Info for CM Student Accounting
IS_SM_DATA = "Module Info for CM Student Accounting
IT_SM_DATA = "Table Type for Module in CM Student Acct.
IV_PRIPROC = "Procedure (pricing, output control, acct. det., costing,...)
IS_FEE_CONTROL = "Fee Calculation Control for CM Student Acct.
EXCEPTIONS
NO_STUDENT_DATA = 1 NO_MODULE_DATA = 2 NO_PRICING_PROC = 3 INVALID_PARAMETER = 4
IMPORTING Parameters details for CMAC_ANALYSIS_SM
IS_ST_DATA - Student Info for CM Student Accounting
Data type: CMAC_STOptional: No
Call by Reference: No ( called with pass by value option)
IS_SM_DATA - Module Info for CM Student Accounting
Data type: CMAC_SMOptional: No
Call by Reference: No ( called with pass by value option)
IT_SM_DATA - Table Type for Module in CM Student Acct.
Data type: CMAC_T_SMOptional: No
Call by Reference: No ( called with pass by value option)
IV_PRIPROC - Procedure (pricing, output control, acct. det., costing,...)
Data type: KOMK-KALSMOptional: No
Call by Reference: No ( called with pass by value option)
IS_FEE_CONTROL - Fee Calculation Control for CM Student Acct.
Data type: CMAC_FEE_CONTROLOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_STUDENT_DATA - No student data
Data type:Optional: No
Call by Reference: Yes
NO_MODULE_DATA - No entry was found in module table
Data type:Optional: No
Call by Reference: Yes
NO_PRICING_PROC - No pricing procedure
Data type:Optional: No
Call by Reference: Yes
INVALID_PARAMETER - Invalid parameters
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CMAC_ANALYSIS_SM 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_is_st_data | TYPE CMAC_ST, " | |||
| lv_no_student_data | TYPE CMAC_ST, " | |||
| lv_is_sm_data | TYPE CMAC_SM, " | |||
| lv_no_module_data | TYPE CMAC_SM, " | |||
| lv_it_sm_data | TYPE CMAC_T_SM, " | |||
| lv_no_pricing_proc | TYPE CMAC_T_SM, " | |||
| lv_iv_priproc | TYPE KOMK-KALSM, " | |||
| lv_invalid_parameter | TYPE KOMK, " | |||
| lv_is_fee_control | TYPE CMAC_FEE_CONTROL. " |
|   CALL FUNCTION 'CMAC_ANALYSIS_SM' "Pricing Analysis for Module |
| EXPORTING | ||
| IS_ST_DATA | = lv_is_st_data | |
| IS_SM_DATA | = lv_is_sm_data | |
| IT_SM_DATA | = lv_it_sm_data | |
| IV_PRIPROC | = lv_iv_priproc | |
| IS_FEE_CONTROL | = lv_is_fee_control | |
| EXCEPTIONS | ||
| NO_STUDENT_DATA = 1 | ||
| NO_MODULE_DATA = 2 | ||
| NO_PRICING_PROC = 3 | ||
| INVALID_PARAMETER = 4 | ||
| . " CMAC_ANALYSIS_SM | ||
ABAP code using 7.40 inline data declarations to call FM CMAC_ANALYSIS_SM
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 KALSM FROM KOMK INTO @DATA(ld_iv_priproc). | ||||
Search for further information about these or an SAP related objects