SAP FMAVC_OVERWRITE_TOLPROF Function Module for Overwrite default tolerance profile (AVC)
FMAVC_OVERWRITE_TOLPROF is a standard fmavc overwrite tolprof SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Overwrite default tolerance profile (AVC) 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 fmavc overwrite tolprof FM, simply by entering the name FMAVC_OVERWRITE_TOLPROF into the relevant SAP transaction such as SE37 or SE38.
Function Group: FMAVC_DERI_TOOLS
Program Name: SAPLFMAVC_DERI_TOOLS
Main Program: SAPLFMAVC_DERI_TOOLS
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FMAVC_OVERWRITE_TOLPROF 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 'FMAVC_OVERWRITE_TOLPROF'"Overwrite default tolerance profile (AVC).
EXPORTING
I_ALDNR = "Availability ledger
* I_PROFRULE = "Strategy (environment) for deriving tolerance profile
* I_REF_CURRENCY = "Desired Currency of the Tolerance Profile
* I_FLG_DOC_CHAIN = "'X' = Document to be checked is in a document chain
I_FM_AREA = "Financial management area
I_FISCYEAR = "Fiscal year
* I_CEFFYEAR = "Year of cash effectivity
* I_ACO_ADDRESS = "Control object or cover group
* I_FLG_BUD_ADDRESS = ' ' "Flag: source account assignment is a bugdet address
* I_CG_BUD_ADDRESS = "Budget address (assigned to a cover group)
* I_CG_BUD_ROLE = "Role of Budget Address in Cover Group
* I_PROFSTRATID = "Strategy ID of the tool for deriving tolerance profile
IMPORTING
E_FLG_DO_NOT_MOD_RES = "'X' = Do not apply implicit logic for error conversion in cover groups
CHANGING
C_TOLPROF = "Tolerance profile for availability control
EXCEPTIONS
DERIVATION_FAILED = 1
IMPORTING Parameters details for FMAVC_OVERWRITE_TOLPROF
I_ALDNR - Availability ledger
Data type: BUAVC_ALDNROptional: No
Call by Reference: Yes
I_PROFRULE - Strategy (environment) for deriving tolerance profile
Data type: BUAVC_PROFRULEOptional: Yes
Call by Reference: No ( called with pass by value option)
I_REF_CURRENCY - Desired Currency of the Tolerance Profile
Data type: BUAVC_CURRENCYOptional: Yes
Call by Reference: Yes
I_FLG_DOC_CHAIN - 'X' = Document to be checked is in a document chain
Data type: XFELDOptional: Yes
Call by Reference: Yes
I_FM_AREA - Financial management area
Data type: FIKRSOptional: No
Call by Reference: Yes
I_FISCYEAR - Fiscal year
Data type: GJAHROptional: No
Call by Reference: Yes
I_CEFFYEAR - Year of cash effectivity
Data type: GNJHROptional: Yes
Call by Reference: Yes
I_ACO_ADDRESS - Control object or cover group
Data type: FMAVC_S_DIMENSIONSOptional: Yes
Call by Reference: Yes
I_FLG_BUD_ADDRESS - Flag: source account assignment is a bugdet address
Data type: XFELDDefault: ' '
Optional: Yes
Call by Reference: Yes
I_CG_BUD_ADDRESS - Budget address (assigned to a cover group)
Data type: FMKU_S_DIMPARTOptional: Yes
Call by Reference: Yes
I_CG_BUD_ROLE - Role of Budget Address in Cover Group
Data type: FMCE_CGADDRINDOptional: Yes
Call by Reference: Yes
I_PROFSTRATID - Strategy ID of the tool for deriving tolerance profile
Data type: BUAVC_PROFSTRATIDOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for FMAVC_OVERWRITE_TOLPROF
E_FLG_DO_NOT_MOD_RES - 'X' = Do not apply implicit logic for error conversion in cover groups
Data type: XFELDOptional: No
Call by Reference: Yes
CHANGING Parameters details for FMAVC_OVERWRITE_TOLPROF
C_TOLPROF - Tolerance profile for availability control
Data type: BUAVC_TOLPROFOptional: No
Call by Reference: Yes
EXCEPTIONS details
DERIVATION_FAILED - Call of the derivation tool failed
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for FMAVC_OVERWRITE_TOLPROF 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_aldnr | TYPE BUAVC_ALDNR, " | |||
| lv_c_tolprof | TYPE BUAVC_TOLPROF, " | |||
| lv_derivation_failed | TYPE BUAVC_TOLPROF, " | |||
| lv_e_flg_do_not_mod_res | TYPE XFELD, " | |||
| lv_i_profrule | TYPE BUAVC_PROFRULE, " | |||
| lv_i_ref_currency | TYPE BUAVC_CURRENCY, " | |||
| lv_i_flg_doc_chain | TYPE XFELD, " | |||
| lv_i_fm_area | TYPE FIKRS, " | |||
| lv_i_fiscyear | TYPE GJAHR, " | |||
| lv_i_ceffyear | TYPE GNJHR, " | |||
| lv_i_aco_address | TYPE FMAVC_S_DIMENSIONS, " | |||
| lv_i_flg_bud_address | TYPE XFELD, " ' ' | |||
| lv_i_cg_bud_address | TYPE FMKU_S_DIMPART, " | |||
| lv_i_cg_bud_role | TYPE FMCE_CGADDRIND, " | |||
| lv_i_profstratid | TYPE BUAVC_PROFSTRATID. " |
|   CALL FUNCTION 'FMAVC_OVERWRITE_TOLPROF' "Overwrite default tolerance profile (AVC) |
| EXPORTING | ||
| I_ALDNR | = lv_i_aldnr | |
| I_PROFRULE | = lv_i_profrule | |
| I_REF_CURRENCY | = lv_i_ref_currency | |
| I_FLG_DOC_CHAIN | = lv_i_flg_doc_chain | |
| I_FM_AREA | = lv_i_fm_area | |
| I_FISCYEAR | = lv_i_fiscyear | |
| I_CEFFYEAR | = lv_i_ceffyear | |
| I_ACO_ADDRESS | = lv_i_aco_address | |
| I_FLG_BUD_ADDRESS | = lv_i_flg_bud_address | |
| I_CG_BUD_ADDRESS | = lv_i_cg_bud_address | |
| I_CG_BUD_ROLE | = lv_i_cg_bud_role | |
| I_PROFSTRATID | = lv_i_profstratid | |
| IMPORTING | ||
| E_FLG_DO_NOT_MOD_RES | = lv_e_flg_do_not_mod_res | |
| CHANGING | ||
| C_TOLPROF | = lv_c_tolprof | |
| EXCEPTIONS | ||
| DERIVATION_FAILED = 1 | ||
| . " FMAVC_OVERWRITE_TOLPROF | ||
ABAP code using 7.40 inline data declarations to call FM FMAVC_OVERWRITE_TOLPROF
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_i_flg_bud_address) | = ' '. | |||
Search for further information about these or an SAP related objects