SAP Function Modules

MC_PG_ANTEILE SAP Function module







MC_PG_ANTEILE 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 MC_PG_ANTEILE into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM MC_PG_ANTEILE - MC PG ANTEILE





CALL FUNCTION 'MC_PG_ANTEILE' "
  EXPORTING
*   bis_datum = '        '      " sy-datum      To-date for planned value selection
*   i_dialog = 'X'              " rmcp2-awahl   "X" means that a dialog is carried out
*   i_fixkz = ' '               " pgan-fixkz    Consideration of FIXKZ for 'X'
*   i_operation = '1'           " char01        Single-level or multi-level
    i_plobo =                   " pgan-plobo    Planning object
*   i_vrsio = '   '             " p445x-vrsio   Version
    sav_gstru =                 " tmc4-gstru    Table name
*   sav_kennzahl = '                  '  " idatf-field  Key figure
*   von_datum = '        '      " sy-datum      Start date for planning value selection
  IMPORTING
    e_ok_code =                 " syucomm
  TABLES
    t_mcpgan =                  " mcpgan        Transfer table
  EXCEPTIONS
    ALL_SHARES_ZERO = 1         "               All proportions are 0 %
    NO_ACTIVE_VERSION = 2       "               No active version for member materials
    NO_MEMBER_FOUND = 3         "               Planning object has no members
    NO_PLOB_FOUND = 4           "               Planning object does not exist
    .  "  MC_PG_ANTEILE

ABAP code example for Function Module MC_PG_ANTEILE





The ABAP code below is a full code listing to execute function module MC_PG_ANTEILE 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_ok_code  TYPE SYUCOMM ,
it_t_mcpgan  TYPE STANDARD TABLE OF MCPGAN,"TABLES PARAM
wa_t_mcpgan  LIKE LINE OF it_t_mcpgan .

DATA(ld_bis_datum) = '20210129'.

DATA(ld_i_dialog) = some text here

SELECT single FIXKZ
FROM PGAN
INTO @DATA(ld_i_fixkz).

DATA(ld_i_operation) = '20210129'.

SELECT single PLOBO
FROM PGAN
INTO @DATA(ld_i_plobo).


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


SELECT single GSTRU
FROM TMC4
INTO @DATA(ld_sav_gstru).


DATA(ld_sav_kennzahl) = some text here
DATA(ld_von_datum) = '20210129'.

"populate fields of struture and append to itab
append wa_t_mcpgan to it_t_mcpgan. . CALL FUNCTION 'MC_PG_ANTEILE' EXPORTING * bis_datum = ld_bis_datum * i_dialog = ld_i_dialog * i_fixkz = ld_i_fixkz * i_operation = ld_i_operation i_plobo = ld_i_plobo * i_vrsio = ld_i_vrsio sav_gstru = ld_sav_gstru * sav_kennzahl = ld_sav_kennzahl * von_datum = ld_von_datum IMPORTING e_ok_code = ld_e_ok_code TABLES t_mcpgan = it_t_mcpgan EXCEPTIONS ALL_SHARES_ZERO = 1 NO_ACTIVE_VERSION = 2 NO_MEMBER_FOUND = 3 NO_PLOB_FOUND = 4 . " MC_PG_ANTEILE
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 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_ok_code  TYPE SYUCOMM ,
ld_bis_datum  TYPE SY-DATUM ,
it_t_mcpgan  TYPE STANDARD TABLE OF MCPGAN ,
wa_t_mcpgan  LIKE LINE OF it_t_mcpgan,
ld_i_dialog  TYPE RMCP2-AWAHL ,
ld_i_fixkz  TYPE PGAN-FIXKZ ,
ld_i_operation  TYPE CHAR01 ,
ld_i_plobo  TYPE PGAN-PLOBO ,
ld_i_vrsio  TYPE P445X-VRSIO ,
ld_sav_gstru  TYPE TMC4-GSTRU ,
ld_sav_kennzahl  TYPE IDATF-FIELD ,
ld_von_datum  TYPE SY-DATUM .

ld_bis_datum = '20210129'.

"populate fields of struture and append to itab
append wa_t_mcpgan to it_t_mcpgan.

ld_i_dialog = some text here

SELECT single FIXKZ
FROM PGAN
INTO ld_i_fixkz.

ld_i_operation = '20210129'.

SELECT single PLOBO
FROM PGAN
INTO ld_i_plobo.


SELECT single VRSIO
FROM P445X
INTO ld_i_vrsio.


SELECT single GSTRU
FROM TMC4
INTO ld_sav_gstru.


ld_sav_kennzahl = some text here
ld_von_datum = '20210129'.

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 MC_PG_ANTEILE or its description.