SAP Function Modules

FC_PRCTR_COCD_FROM_CEPC SAP Function module







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

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


Pattern for FM FC_PRCTR_COCD_FROM_CEPC - FC PRCTR COCD FROM CEPC





CALL FUNCTION 'FC_PRCTR_COCD_FROM_CEPC' "
  EXPORTING
    e_kokrs =                   " cepc-kokrs
    e_date =                    " sy-datum
*   e_from_date =               " sy-datum
  IMPORTING
    i_number_prctr =            " sy-index
    i_number_cocd =             " sy-index
    i_number_combinations =     " sy-index
  TABLES
    it_prctr_cocd =             " fcinpca001
  EXCEPTIONS
    ZERO_ENTRIES = 1            "
    NO_RCOMP = 2                "
    .  "  FC_PRCTR_COCD_FROM_CEPC

ABAP code example for Function Module FC_PRCTR_COCD_FROM_CEPC





The ABAP code below is a full code listing to execute function module FC_PRCTR_COCD_FROM_CEPC 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_i_number_prctr  TYPE SY-INDEX ,
ld_i_number_cocd  TYPE SY-INDEX ,
ld_i_number_combinations  TYPE SY-INDEX ,
it_it_prctr_cocd  TYPE STANDARD TABLE OF FCINPCA001,"TABLES PARAM
wa_it_prctr_cocd  LIKE LINE OF it_it_prctr_cocd .


SELECT single KOKRS
FROM CEPC
INTO @DATA(ld_e_kokrs).

DATA(ld_e_date) = '20210129'.
DATA(ld_e_from_date) = '20210129'.

"populate fields of struture and append to itab
append wa_it_prctr_cocd to it_it_prctr_cocd. . CALL FUNCTION 'FC_PRCTR_COCD_FROM_CEPC' EXPORTING e_kokrs = ld_e_kokrs e_date = ld_e_date * e_from_date = ld_e_from_date IMPORTING i_number_prctr = ld_i_number_prctr i_number_cocd = ld_i_number_cocd i_number_combinations = ld_i_number_combinations TABLES it_prctr_cocd = it_it_prctr_cocd EXCEPTIONS ZERO_ENTRIES = 1 NO_RCOMP = 2 . " FC_PRCTR_COCD_FROM_CEPC
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 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_i_number_prctr  TYPE SY-INDEX ,
ld_e_kokrs  TYPE CEPC-KOKRS ,
it_it_prctr_cocd  TYPE STANDARD TABLE OF FCINPCA001 ,
wa_it_prctr_cocd  LIKE LINE OF it_it_prctr_cocd,
ld_i_number_cocd  TYPE SY-INDEX ,
ld_e_date  TYPE SY-DATUM ,
ld_i_number_combinations  TYPE SY-INDEX ,
ld_e_from_date  TYPE SY-DATUM .


SELECT single KOKRS
FROM CEPC
INTO ld_e_kokrs.


"populate fields of struture and append to itab
append wa_it_prctr_cocd to it_it_prctr_cocd.
ld_e_date = '20210129'.
ld_e_from_date = '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 FC_PRCTR_COCD_FROM_CEPC or its description.