SAP FMCY_INIT_FROM_VARIANT Function Module for Init screen fields from variant
FMCY_INIT_FROM_VARIANT is a standard fmcy init from variant SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Init screen fields from variant 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 fmcy init from variant FM, simply by entering the name FMCY_INIT_FROM_VARIANT into the relevant SAP transaction such as SE37 or SE38.
Function Group: FMCY_MD_SEL
Program Name: SAPLFMCY_MD_SEL
Main Program: SAPLFMCY_MD_SEL
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FMCY_INIT_FROM_VARIANT 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 'FMCY_INIT_FROM_VARIANT'"Init screen fields from variant.
EXPORTING
I_FM_AREA = "Financial management area
I_R_FUND = "Structure of a Range Table for a Ten Character Field
I_R_FUNC = "Structure of a Range Table for a 16 Character Field
I_R_FUNDSCTR = "Structure of a Range Table for a 16 Character Field
I_R_CMMTITEM = "Structure of a Range Table for a 24 Character Field
I_R_GRANT = "Structure of a Range Table for a Character (20) Field
IMPORTING Parameters details for FMCY_INIT_FROM_VARIANT
I_FM_AREA - Financial management area
Data type: FIKRSOptional: No
Call by Reference: Yes
I_R_FUND - Structure of a Range Table for a Ten Character Field
Data type: RANGE_C10Optional: No
Call by Reference: Yes
I_R_FUNC - Structure of a Range Table for a 16 Character Field
Data type: RANGE_C16Optional: No
Call by Reference: Yes
I_R_FUNDSCTR - Structure of a Range Table for a 16 Character Field
Data type: RANGE_C16Optional: No
Call by Reference: Yes
I_R_CMMTITEM - Structure of a Range Table for a 24 Character Field
Data type: RANGE_C24Optional: No
Call by Reference: Yes
I_R_GRANT - Structure of a Range Table for a Character (20) Field
Data type: RANGE_C20Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for FMCY_INIT_FROM_VARIANT 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_fm_area | TYPE FIKRS, " | |||
| lv_i_r_fund | TYPE RANGE_C10, " | |||
| lv_i_r_func | TYPE RANGE_C16, " | |||
| lv_i_r_fundsctr | TYPE RANGE_C16, " | |||
| lv_i_r_cmmtitem | TYPE RANGE_C24, " | |||
| lv_i_r_grant | TYPE RANGE_C20. " |
|   CALL FUNCTION 'FMCY_INIT_FROM_VARIANT' "Init screen fields from variant |
| EXPORTING | ||
| I_FM_AREA | = lv_i_fm_area | |
| I_R_FUND | = lv_i_r_fund | |
| I_R_FUNC | = lv_i_r_func | |
| I_R_FUNDSCTR | = lv_i_r_fundsctr | |
| I_R_CMMTITEM | = lv_i_r_cmmtitem | |
| I_R_GRANT | = lv_i_r_grant | |
| . " FMCY_INIT_FROM_VARIANT | ||
ABAP code using 7.40 inline data declarations to call FM FMCY_INIT_FROM_VARIANT
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