SAP Function Modules

CNPOC_CALCULATE SAP Function module - Calculate POC values and Earned values







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

Associated Function Group: CNPOC
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM CNPOC_CALCULATE - CNPOC CALCULATE





CALL FUNCTION 'CNPOC_CALCULATE' "Calculate POC values and Earned values
  EXPORTING
*   project_definition =        " proj-pspid    Project Definition
*   wbselement =                " prps-posid    Work Breakdown Structure Element (WBS Element)
*   network =                   " aufk-aufnr    Order Number
*   activity =                  " vornr         Operation/Activity Number
    progress_version =          " versn_ev      Progress Version
    period =                    " to_p          Last Period
    year =                      " gjahr         Fiscal Year
*   with_hierarchy =            " ps_hiera      Parameters including hierarchy
*   with_orders =               " ps_incor      Parameters including all orders
  TABLES
    et_return =                 " bapiret2      Return Parameter
    .  "  CNPOC_CALCULATE

ABAP code example for Function Module CNPOC_CALCULATE





The ABAP code below is a full code listing to execute function module CNPOC_CALCULATE 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:
it_et_return  TYPE STANDARD TABLE OF BAPIRET2,"TABLES PARAM
wa_et_return  LIKE LINE OF it_et_return .


SELECT single PSPID
FROM PROJ
INTO @DATA(ld_project_definition).


SELECT single POSID
FROM PRPS
INTO @DATA(ld_wbselement).


SELECT single AUFNR
FROM AUFK
INTO @DATA(ld_network).

DATA(ld_activity) = 'Check type of data required'.
DATA(ld_progress_version) = 'Check type of data required'.
DATA(ld_period) = 'Check type of data required'.
DATA(ld_year) = 'Check type of data required'.
DATA(ld_with_hierarchy) = 'Check type of data required'.
DATA(ld_with_orders) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_et_return to it_et_return. . CALL FUNCTION 'CNPOC_CALCULATE' EXPORTING * project_definition = ld_project_definition * wbselement = ld_wbselement * network = ld_network * activity = ld_activity progress_version = ld_progress_version period = ld_period year = ld_year * with_hierarchy = ld_with_hierarchy * with_orders = ld_with_orders TABLES et_return = it_et_return . " CNPOC_CALCULATE
IF SY-SUBRC EQ 0. "All OK 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_project_definition  TYPE PROJ-PSPID ,
it_et_return  TYPE STANDARD TABLE OF BAPIRET2 ,
wa_et_return  LIKE LINE OF it_et_return,
ld_wbselement  TYPE PRPS-POSID ,
ld_network  TYPE AUFK-AUFNR ,
ld_activity  TYPE VORNR ,
ld_progress_version  TYPE VERSN_EV ,
ld_period  TYPE TO_P ,
ld_year  TYPE GJAHR ,
ld_with_hierarchy  TYPE PS_HIERA ,
ld_with_orders  TYPE PS_INCOR .


SELECT single PSPID
FROM PROJ
INTO ld_project_definition.


"populate fields of struture and append to itab
append wa_et_return to it_et_return.

SELECT single POSID
FROM PRPS
INTO ld_wbselement.


SELECT single AUFNR
FROM AUFK
INTO ld_network.

ld_activity = 'Check type of data required'.
ld_progress_version = 'Check type of data required'.
ld_period = 'Check type of data required'.
ld_year = 'Check type of data required'.
ld_with_hierarchy = 'Check type of data required'.
ld_with_orders = 'Check type of data required'.

SAP Documentation for FM CNPOC_CALCULATE


POC values and Earned values can be calculated by executing this RFC. But the Commit work should be done explicitly by calling ...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 CNPOC_CALCULATE or its description.