SAP Function Modules

COPCA_GET_DEFAULT_PRCTR_T8A30 SAP Function module







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

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


Pattern for FM COPCA_GET_DEFAULT_PRCTR_T8A30 - COPCA GET DEFAULT PRCTR T8A30





CALL FUNCTION 'COPCA_GET_DEFAULT_PRCTR_T8A30' "
  EXPORTING
    i_account =                 " pca_def_prctr-racct
*   i_company_code =            " pca_def_prctr-bukrs
*   i_valuation_area =          " pca_def_prctr-bwkey
*   i_business_area =           " pca_def_prctr-gsber
*   i_controlling_area =        " pca_def_prctr-kokrs
*   i_posting_date =            " accit-budat
*   i_prctr =                   " cepc-prctr
  IMPORTING
    e_prctr =                   " pca_def_prctr-prctr
  EXCEPTIONS
    INCOMPLETE_INPUT = 1        "
    ACCOUNT_NOT_INCLUDED = 2    "
    NO_CONTROLLING_AREA_FOUND = 3  "
    .  "  COPCA_GET_DEFAULT_PRCTR_T8A30

ABAP code example for Function Module COPCA_GET_DEFAULT_PRCTR_T8A30





The ABAP code below is a full code listing to execute function module COPCA_GET_DEFAULT_PRCTR_T8A30 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_prctr  TYPE PCA_DEF_PRCTR-PRCTR .


DATA(ld_i_account) = some text here

DATA(ld_i_company_code) = some text here

DATA(ld_i_valuation_area) = some text here

DATA(ld_i_business_area) = some text here

DATA(ld_i_controlling_area) = some text here

DATA(ld_i_posting_date) = 20210129

SELECT single PRCTR
FROM CEPC
INTO @DATA(ld_i_prctr).
. CALL FUNCTION 'COPCA_GET_DEFAULT_PRCTR_T8A30' EXPORTING i_account = ld_i_account * i_company_code = ld_i_company_code * i_valuation_area = ld_i_valuation_area * i_business_area = ld_i_business_area * i_controlling_area = ld_i_controlling_area * i_posting_date = ld_i_posting_date * i_prctr = ld_i_prctr IMPORTING e_prctr = ld_e_prctr EXCEPTIONS INCOMPLETE_INPUT = 1 ACCOUNT_NOT_INCLUDED = 2 NO_CONTROLLING_AREA_FOUND = 3 . " COPCA_GET_DEFAULT_PRCTR_T8A30
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 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_prctr  TYPE PCA_DEF_PRCTR-PRCTR ,
ld_i_account  TYPE PCA_DEF_PRCTR-RACCT ,
ld_i_company_code  TYPE PCA_DEF_PRCTR-BUKRS ,
ld_i_valuation_area  TYPE PCA_DEF_PRCTR-BWKEY ,
ld_i_business_area  TYPE PCA_DEF_PRCTR-GSBER ,
ld_i_controlling_area  TYPE PCA_DEF_PRCTR-KOKRS ,
ld_i_posting_date  TYPE ACCIT-BUDAT ,
ld_i_prctr  TYPE CEPC-PRCTR .


ld_i_account = some text here

ld_i_company_code = some text here

ld_i_valuation_area = some text here

ld_i_business_area = some text here

ld_i_controlling_area = some text here

ld_i_posting_date = 20210129

SELECT single PRCTR
FROM CEPC
INTO ld_i_prctr.

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