SAP CMAC_GRANT_SAVE Function Module for Save grant master data into database
CMAC_GRANT_SAVE is a standard cmac grant 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 grant master data into database 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 grant save FM, simply by entering the name CMAC_GRANT_SAVE into the relevant SAP transaction such as SE37 or SE38.
Function Group: PMIQBP_GRANT
Program Name: SAPLPMIQBP_GRANT
Main Program: SAPLPMIQBP_GRANT
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CMAC_GRANT_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 'CMAC_GRANT_SAVE'"Save grant master data into database.
EXPORTING
IV_DBACTION = "'I' = Insert, 'U' = Update
IS_GRANT = "Grant Master
* IV_LANGUAGE = SY-LANGU "Language Key
* IV_COMMIT = ' ' "Checkbox
* IV_EST_SP_POST = "Estimated posting on sponsor's account
* IT_GRANT_CONDITIONS = "Grant Conditions
EXCEPTIONS
UPDATE_ERROR = 1
IMPORTING Parameters details for CMAC_GRANT_SAVE
IV_DBACTION - 'I' = Insert, 'U' = Update
Data type: XFELDOptional: No
Call by Reference: No ( called with pass by value option)
IS_GRANT - Grant Master
Data type: CMACRFCGRANTOptional: No
Call by Reference: No ( called with pass by value option)
IV_LANGUAGE - Language Key
Data type: SPRASDefault: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_COMMIT - Checkbox
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_EST_SP_POST - Estimated posting on sponsor's account
Data type: CMACEST_SP_POSTOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_GRANT_CONDITIONS - Grant Conditions
Data type: CMACGRANTCONDITIONS_TOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
UPDATE_ERROR - Error occurs in update
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CMAC_GRANT_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_iv_dbaction | TYPE XFELD, " | |||
| lv_update_error | TYPE XFELD, " | |||
| lv_is_grant | TYPE CMACRFCGRANT, " | |||
| lv_iv_language | TYPE SPRAS, " SY-LANGU | |||
| lv_iv_commit | TYPE XFELD, " SPACE | |||
| lv_iv_est_sp_post | TYPE CMACEST_SP_POST, " | |||
| lv_it_grant_conditions | TYPE CMACGRANTCONDITIONS_T. " |
|   CALL FUNCTION 'CMAC_GRANT_SAVE' "Save grant master data into database |
| EXPORTING | ||
| IV_DBACTION | = lv_iv_dbaction | |
| IS_GRANT | = lv_is_grant | |
| IV_LANGUAGE | = lv_iv_language | |
| IV_COMMIT | = lv_iv_commit | |
| IV_EST_SP_POST | = lv_iv_est_sp_post | |
| IT_GRANT_CONDITIONS | = lv_it_grant_conditions | |
| EXCEPTIONS | ||
| UPDATE_ERROR = 1 | ||
| . " CMAC_GRANT_SAVE | ||
ABAP code using 7.40 inline data declarations to call FM CMAC_GRANT_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.| DATA(ld_iv_language) | = SY-LANGU. | |||
| DATA(ld_iv_commit) | = ' '. | |||
Search for further information about these or an SAP related objects