Fonction SAP BAPI_COSTCENTER_GETLIST - List of Cost Centers Using Selection Criteria

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
COMPANYCODE BAPI0012_5-C_CODE C 4 X Company Code (From Value)
COMPANYCODE_TO BAPI0012_5-C_CODE_TO C 4 X Company Code (To Value)
CONTROLLINGAREA BAPI0012_5-CO_AREA C 4 X Controlling Area (From Value)
CONTROLLINGAREA_TO BAPI0012_5-CO_AREA_TO C 4 X Controlling Area (To Value)
COSTCENTER BAPI0012_5-COSTCTR C 10 X Cost Center (From Value)
COSTCENTERGROUP BAPI0012_5-COST_CENTER_GRP C 15 X Cost center group
COSTCENTER_TO BAPI0012_5-COSTCTR_TO C 10 X Cost Center (To Value)
DATE BAPI0012_5-DATE D 8 SY-DATUM X Selection Date: Key Date
DATE_TO BAPI0012_5-DATE D 8 X
PERSON_IN_CHARGE BAPI0012_5-INCHARGE C 20 X Person Responsible (From Value)
PERSON_IN_CHARGE_TO BAPI0012_5-INCHARGETO C 20 X Person Responsible (To Value)
PERSON_IN_CHARGE_USER_FROM BAPI0012_GEN-PERSON_IN_CHARGE_USER C 12 X User Responsible (From-Value)
PERSON_IN_CHARGE_USER_TO BAPI0012_GEN-PERSON_IN_CHARGE_USER C 12 X User Responsible (To-Value)

Paramètre Reférence Type Long. Description
RETURN BAPIRETURN u 452 Return Parameter

Paramètre Reférence Long. Facultatif Description
COSTCENTER_LIST BAPI0012_2 34 Return Table: Cost Center List

Functionality
Uses selection criteria for a key date to provide a list of all costcenters that meet this criteria. The list contains controlling area,cost center, and cost center name.

Caution: This method is out-of-date.
The GetDetail method is obsolete after Release 4.6. The functionalityis borrowed from the GetDetail1 method.
If you have already used this method, you should change over to the newmethod.
Otherwise, use the new GetDetail1 method.

Example
You want a list of all cost centers in controlling area 0001 andcompany code 0002 for the current date.
Function module call:
DATA: I_COSTCENTER_LIST LIKE BAPI0012_2 OCCURS 0 WITH HEADER LINE.
I_RETURN LIKE BAPIRETURN.
CALL FUNCTION 'BAPI_COSTCENTER_GETLIST'
EXPORTING CONTROLLINGAREA = "0001"
COMPANYCODE = "0002"
DATE = SY-DATUM
TABLES = I_COSTCENTER_LIST
IMPORTING RETURN = I_RETURN.

Notes
You require system authorization for object K_CSKS.
The selection criteria can be transferred as:

  • Individual values, for example parameter COMPANYCODE is filled

  • Intervals, for example parameters COMPANYCODE and COMPANYCODE_TO are
  • filled
    • Upper limits, for example parameter COMPANYCODE_TO (the system selects
    • all company codes <= COMPANY_CODE_TO)
      • As an alternative to intervals, you can also select using
      • Cost Center Group (interface parameterCOSTCENTERGROUP). If you have specified intervals and cost centergroups, the system evaluates only using cost center groups.
        If you do not enter any restricting criteria for the controlling areaand/or cost center, the system issues a list of all cost centers.
        Note that a selection can only be successful if it does not contain anycontradictions. For example, in a controlling area there should not beany cost centers from company codes that are not assigned to thecontrolling area.
        If no cost centers could be found by the system for the selectioncriteria entered, you can get information about the errors that haveoccurred by choosing the RETURN parameter.

        Description
        Return structure for errors and system messages.

        Description
        Parameter holding the value of the company code or the lowest value ofthe company code interval in which the SAP R/3 System searches for costcenters.
        For more information on company codes, see the corresponding dataelement documentation: Company Code.

        Value range
        Dictionary data type: CHAR (field length 4)

        Default
        No default.

        Description
        Parameter holding the highest value of the company code interval inwhich the SAP R/3 System searches for cost centers.
        For more information on company codes, see the corresponding dataelement documentation: Company Code.

        Value range
        Dictionary data type: CHAR (field length 4)

        Default
        No default.

        Description
        Parameter holding the value of the controlling area or the lowest valueof the controlling area interval in which the SAP R/3 System searchesfor cost centers.
        For more information on the controlling area, see the correspondingdata element documentation: Controlling Area.

        Value range
        Dictionary data type: CHAR (field length 4)

        Default
        No default.

        Description
        Parameter holding the highest value of the controlling area interval inwhich the SAP R/3 System searches for cost centers.
        For more information on the controlling area, see the correspondingdata element documentation: Controlling Area.

        Value range
        Dictionary data type: CHAR (field length 4)

        Default
        No default.

        Description
        Parameter holding the value of the cost center or the lowest value ofthe cost center interval.
        For more information on cost centers, see the corresponding dataelement documentation: Cost Center.

        Value range
        Dictionary data type: CHAR (field length 10)

        Default
        No default.

        Description
        As an alternative to intervals (From-to selection) you can also selecta cost center group.

        Description
        Parameter holding the highest value of the cost center interval.
        For more information on cost centers, see the corresponding dataelement documentation: Cost Center.

        Value range
        Dictionary data type: CHAR (field length 10)

        Default
        No default.

        Description
        Dates in which the SAP R/3 System searches for cost centers.
        For more information on the date, see the corresponding data elementdocumentation: From Date and To Date.

        Value range
        Dictionary data type: DATS (field length 8)

        Default
        Defaulted with the current system date (SY-DATUM).

        Description
        "To date" for the selection.

        Description
        Parameter holding the names of cost center managers or the lower levelof the cost center manager interval in which the SAP R/3 Systemsearches for cost centers.

        Value range
        Dictionary data type: CHAR (field length 20)

        Default
        No default.

        Description
        Parameter holding the higher level of the cost center manager intervalin which the SAP R/3 System searches for cost centers.

        Value range
        Dictionary data type: CHAR (field length 20)

        Default
        No default.

        Description
        User Responsible for Cost Center / From-Value for the Selection.

        Description
        User Responsible for Cost Center / To-Value for the Selection.

        Description
        Return table holding the keys (controlling area and cost center ID) ofall cost centers found, along with their names in the logon languageSY-LANGU.
        For more information on fields, see the corresponding data elementdocumentation: Cost Center and ControllingArea.