SAP BAPI_COSTCENTER_GETDETAIL1 Function Module for Detail Information for Cost Center on Key Date (1)
BAPI_COSTCENTER_GETDETAIL1 is a standard bapi costcenter getdetail1 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Detail Information for Cost Center on Key Date (1) processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for bapi costcenter getdetail1 FM, simply by entering the name BAPI_COSTCENTER_GETDETAIL1 into the relevant SAP transaction such as SE37 or SE38.
Function Group: 0012
Program Name: SAPL0012
Main Program: SAPL0012
Appliation area: K
Release date: 08-Feb-1999
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_COSTCENTER_GETDETAIL1 pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'BAPI_COSTCENTER_GETDETAIL1'"Detail Information for Cost Center on Key Date (1).
EXPORTING
CONTROLLINGAREA = "Controlling Area
COSTCENTER = "Cost Center
* KEYDATE = SY-DATLO "Key Date
* MASTER_DATA_INACTIVE = ' ' "Master Record Inactive
* LANGUAGE = "Language in which Texts are Read
IMPORTING
COSTCENTERDETAIL = "Detailed Information on Cost Center
TABLES
RETURN = "Return Parameters, Especially Errors
* EXTENSIONIN = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
* EXTENSIONOUT = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPL0012_001 Exit One (Input) for CostCenter.CreateMultiple
EXIT_SAPL0012_002 Exit Two (Output) for CostCenter.CreateMultiple
EXIT_SAPL0012_003 Exit One (Input) for CostCenter.ChangeMultiple
EXIT_SAPL0012_004 Exit Two (Output) for CostCenter.ChangeMultiple
EXIT_SAPL0012_005 Exit One (Input) for CostCenter.CheckMultiple
EXIT_SAPL0012_006 Exit Two (Output) for CostCenter.CheckMultiple
EXIT_SAPL0012_007 Exit One (Input) for CostCenter.GetList1
EXIT_SAPL0012_008 Exit Two (Output) for CostCenter.GetList1
EXIT_SAPL0012_009 Exit One (Input) for CostCenter.GetDetail1
EXIT_SAPL0012_010 Exit Two (Output) for CostCenter.GetDetail1
IMPORTING Parameters details for BAPI_COSTCENTER_GETDETAIL1
CONTROLLINGAREA - Controlling Area
Data type: BAPI0012_GEN-CO_AREAOptional: No
Call by Reference: No ( called with pass by value option)
COSTCENTER - Cost Center
Data type: BAPI0012_GEN-COSTCENTEROptional: No
Call by Reference: No ( called with pass by value option)
KEYDATE - Key Date
Data type: BAPI0012_GEN-SOME_DATEDefault: SY-DATLO
Optional: Yes
Call by Reference: No ( called with pass by value option)
MASTER_DATA_INACTIVE - Master Record Inactive
Data type: BAPI0012_GEN-MASTER_DATA_INACTIVEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LANGUAGE - Language in which Texts are Read
Data type: BAPI0015_10Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_COSTCENTER_GETDETAIL1
COSTCENTERDETAIL - Detailed Information on Cost Center
Data type: BAPI0012_CCOUTPUTLISTOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_COSTCENTER_GETDETAIL1
RETURN - Return Parameters, Especially Errors
Data type: BAPIRET2Optional: No
Call by Reference: No ( called with pass by value option)
EXTENSIONIN - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
Data type: BAPIPAREXOptional: Yes
Call by Reference: Yes
EXTENSIONOUT - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
Data type: BAPIPAREXOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for BAPI_COSTCENTER_GETDETAIL1 Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lt_return | TYPE STANDARD TABLE OF BAPIRET2, " | |||
| lv_controllingarea | TYPE BAPI0012_GEN-CO_AREA, " | |||
| lv_costcenterdetail | TYPE BAPI0012_CCOUTPUTLIST, " | |||
| lv_costcenter | TYPE BAPI0012_GEN-COSTCENTER, " | |||
| lt_extensionin | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
| lv_keydate | TYPE BAPI0012_GEN-SOME_DATE, " SY-DATLO | |||
| lt_extensionout | TYPE STANDARD TABLE OF BAPIPAREX, " | |||
| lv_master_data_inactive | TYPE BAPI0012_GEN-MASTER_DATA_INACTIVE, " SPACE | |||
| lv_language | TYPE BAPI0015_10. " |
|   CALL FUNCTION 'BAPI_COSTCENTER_GETDETAIL1' "Detail Information for Cost Center on Key Date (1) |
| EXPORTING | ||
| CONTROLLINGAREA | = lv_controllingarea | |
| COSTCENTER | = lv_costcenter | |
| KEYDATE | = lv_keydate | |
| MASTER_DATA_INACTIVE | = lv_master_data_inactive | |
| LANGUAGE | = lv_language | |
| IMPORTING | ||
| COSTCENTERDETAIL | = lv_costcenterdetail | |
| TABLES | ||
| RETURN | = lt_return | |
| EXTENSIONIN | = lt_extensionin | |
| EXTENSIONOUT | = lt_extensionout | |
| . " BAPI_COSTCENTER_GETDETAIL1 | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_COSTCENTER_GETDETAIL1
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single CO_AREA FROM BAPI0012_GEN INTO @DATA(ld_controllingarea). | ||||
| "SELECT single COSTCENTER FROM BAPI0012_GEN INTO @DATA(ld_costcenter). | ||||
| "SELECT single SOME_DATE FROM BAPI0012_GEN INTO @DATA(ld_keydate). | ||||
| DATA(ld_keydate) | = SY-DATLO. | |||
| "SELECT single MASTER_DATA_INACTIVE FROM BAPI0012_GEN INTO @DATA(ld_master_data_inactive). | ||||
| DATA(ld_master_data_inactive) | = ' '. | |||
Search for further information about these or an SAP related objects