SAP Function Modules

MCS_ANALYSE_CALL SAP Function module







MCS_ANALYSE_CALL is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name MCS_ANALYSE_CALL into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: MCSA
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM MCS_ANALYSE_CALL - MCS ANALYSE CALL





CALL FUNCTION 'MCS_ANALYSE_CALL' "
* EXPORTING
*   i_mcinf =                   " tmc4-mcinf    Info structure
*   i_stored_version = SPACE    " boolean       Calls display of selection versions
*   i_flg_no_submit = SPACE     " boolean       No SUBMIT, only generation, if required
*   i_speri = SPACE             " tmc4-speri    Period unit                            --->
*   i_flg_via_selscreen = 'X'   " boolean       'X' = Call via selection screen
*   i_periv =                   " tmc4-periv    Fiscal year variant in period unit P
*   i_mcana =                   " tmc7-mcana    Analysis (instead of info structure)
*   i_mcapp =                   " tmc7-mcapp    Application (instead of info structure)
*   i_vrsio =                   " p44v-vrsio    Version
*   i_reportname =              " sy-repid      Internal use only: calling report
*   i_flg_add_figures = SPACE   " boolean       Indicator: Add key figures           >
*   i_flg_anl_default = SPACE   " boolean       Calls the default analysis
*   i_call_planning = SPACE     " sy-datar
  IMPORTING
    e_reportname =              " sy-repid      The standard analysis report name reappears
    e_mcapp =                   " tmcap-mcapp   Chosen application
    e_mcana =                   " tmc7-mcana    Chosen analysis
* TABLES
*   t_data =                    "               Table with data, instead of SELECT on IS
*   t_sel =                     " rstisel       Selection options bsd on report/report interface
*   t_fields =                  " rstifields    see report/report interface
*   t_drilldown =               " mcddown       Table with characteristics for standard drill-down
*   t_figures =                 " mcs03         Key Figures
  EXCEPTIONS
    EVALUATIVE_INFO_STRUCTURE = 1  "            Info structure is evaluation structure
    INFO_STRUCTURE_NOT_GENERATED = 2  "         Info structure not generated
    NO_ANALYSIS_SELECTED = 3    "               There is no standard analysis, cancel
    INFO_STRUCTURE_DOES_NOT_EXIST = 4  "        Info structure does not exist
    ANALYSE_DOES_NOT_EXIST = 5  "
    .  "  MCS_ANALYSE_CALL

ABAP code example for Function Module MCS_ANALYSE_CALL





The ABAP code below is a full code listing to execute function module MCS_ANALYSE_CALL including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_e_reportname  TYPE SY-REPID ,
ld_e_mcapp  TYPE TMCAP-MCAPP ,
ld_e_mcana  TYPE TMC7-MCANA ,
it_t_data  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_t_data  LIKE LINE OF it_t_data ,
it_t_sel  TYPE STANDARD TABLE OF RSTISEL,"TABLES PARAM
wa_t_sel  LIKE LINE OF it_t_sel ,
it_t_fields  TYPE STANDARD TABLE OF RSTIFIELDS,"TABLES PARAM
wa_t_fields  LIKE LINE OF it_t_fields ,
it_t_drilldown  TYPE STANDARD TABLE OF MCDDOWN,"TABLES PARAM
wa_t_drilldown  LIKE LINE OF it_t_drilldown ,
it_t_figures  TYPE STANDARD TABLE OF MCS03,"TABLES PARAM
wa_t_figures  LIKE LINE OF it_t_figures .


SELECT single MCINF
FROM TMC4
INTO @DATA(ld_i_mcinf).

DATA(ld_i_stored_version) = 'Check type of data required'.
DATA(ld_i_flg_no_submit) = 'Check type of data required'.

SELECT single SPERI
FROM TMC4
INTO @DATA(ld_i_speri).

DATA(ld_i_flg_via_selscreen) = 'Check type of data required'.

SELECT single PERIV
FROM TMC4
INTO @DATA(ld_i_periv).


SELECT single MCANA
FROM TMC7
INTO @DATA(ld_i_mcana).


SELECT single MCAPP
FROM TMC7
INTO @DATA(ld_i_mcapp).


SELECT single VRSIO
FROM P44V
INTO @DATA(ld_i_vrsio).

DATA(ld_i_reportname) = 'Check type of data required'.
DATA(ld_i_flg_add_figures) = 'some text here'.
DATA(ld_i_flg_anl_default) = 'some text here'.
DATA(ld_i_call_planning) = 'some text here'.

"populate fields of struture and append to itab
append wa_t_data to it_t_data.

"populate fields of struture and append to itab
append wa_t_sel to it_t_sel.

"populate fields of struture and append to itab
append wa_t_fields to it_t_fields.

"populate fields of struture and append to itab
append wa_t_drilldown to it_t_drilldown.

"populate fields of struture and append to itab
append wa_t_figures to it_t_figures. . CALL FUNCTION 'MCS_ANALYSE_CALL' * EXPORTING * i_mcinf = ld_i_mcinf * i_stored_version = ld_i_stored_version * i_flg_no_submit = ld_i_flg_no_submit * i_speri = ld_i_speri * i_flg_via_selscreen = ld_i_flg_via_selscreen * i_periv = ld_i_periv * i_mcana = ld_i_mcana * i_mcapp = ld_i_mcapp * i_vrsio = ld_i_vrsio * i_reportname = ld_i_reportname * i_flg_add_figures = ld_i_flg_add_figures * i_flg_anl_default = ld_i_flg_anl_default * i_call_planning = ld_i_call_planning IMPORTING e_reportname = ld_e_reportname e_mcapp = ld_e_mcapp e_mcana = ld_e_mcana * TABLES * t_data = it_t_data * t_sel = it_t_sel * t_fields = it_t_fields * t_drilldown = it_t_drilldown * t_figures = it_t_figures EXCEPTIONS EVALUATIVE_INFO_STRUCTURE = 1 INFO_STRUCTURE_NOT_GENERATED = 2 NO_ANALYSIS_SELECTED = 3 INFO_STRUCTURE_DOES_NOT_EXIST = 4 ANALYSE_DOES_NOT_EXIST = 5 . " MCS_ANALYSE_CALL
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_e_reportname  TYPE SY-REPID ,
ld_i_mcinf  TYPE TMC4-MCINF ,
it_t_data  TYPE STANDARD TABLE OF STRING ,
wa_t_data  LIKE LINE OF it_t_data,
ld_e_mcapp  TYPE TMCAP-MCAPP ,
ld_i_stored_version  TYPE BOOLEAN ,
it_t_sel  TYPE STANDARD TABLE OF RSTISEL ,
wa_t_sel  LIKE LINE OF it_t_sel,
ld_e_mcana  TYPE TMC7-MCANA ,
ld_i_flg_no_submit  TYPE BOOLEAN ,
it_t_fields  TYPE STANDARD TABLE OF RSTIFIELDS ,
wa_t_fields  LIKE LINE OF it_t_fields,
ld_i_speri  TYPE TMC4-SPERI ,
it_t_drilldown  TYPE STANDARD TABLE OF MCDDOWN ,
wa_t_drilldown  LIKE LINE OF it_t_drilldown,
ld_i_flg_via_selscreen  TYPE BOOLEAN ,
it_t_figures  TYPE STANDARD TABLE OF MCS03 ,
wa_t_figures  LIKE LINE OF it_t_figures,
ld_i_periv  TYPE TMC4-PERIV ,
ld_i_mcana  TYPE TMC7-MCANA ,
ld_i_mcapp  TYPE TMC7-MCAPP ,
ld_i_vrsio  TYPE P44V-VRSIO ,
ld_i_reportname  TYPE SY-REPID ,
ld_i_flg_add_figures  TYPE BOOLEAN ,
ld_i_flg_anl_default  TYPE BOOLEAN ,
ld_i_call_planning  TYPE SY-DATAR .


SELECT single MCINF
FROM TMC4
INTO ld_i_mcinf.


"populate fields of struture and append to itab
append wa_t_data to it_t_data.
ld_i_stored_version = 'some text here'.

"populate fields of struture and append to itab
append wa_t_sel to it_t_sel.
ld_i_flg_no_submit = 'some text here'.

"populate fields of struture and append to itab
append wa_t_fields to it_t_fields.

SELECT single SPERI
FROM TMC4
INTO ld_i_speri.


"populate fields of struture and append to itab
append wa_t_drilldown to it_t_drilldown.
ld_i_flg_via_selscreen = 'some text here'.

"populate fields of struture and append to itab
append wa_t_figures to it_t_figures.

SELECT single PERIV
FROM TMC4
INTO ld_i_periv.


SELECT single MCANA
FROM TMC7
INTO ld_i_mcana.


SELECT single MCAPP
FROM TMC7
INTO ld_i_mcapp.


SELECT single VRSIO
FROM P44V
INTO ld_i_vrsio.

ld_i_reportname = 'some text here'.
ld_i_flg_add_figures = 'some text here'.
ld_i_flg_anl_default = 'some text here'.
ld_i_call_planning = 'some text here'.

SAP Documentation for FM MCS_ANALYSE_CALL


The function module acts as a general interface for calling up a standard analysis. You can use the selection screen to call up the ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name MCS_ANALYSE_CALL or its description.