Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> Bapi>ControllingArea



Index

ControllingArea

ControllingArea


The business object Controlling area is a self-contained unit
within an organization for which you can perform complete, closed cost controlling.


A controlling area may include single or multiple company codes that
may use different currencies. These company codes must use the same operative chart of accounts.


All internal allocations refer exclusively to objects in the same controlling area.


11-Dec-2005


Methods

Available Methods


  • Find : Derive controlling area from company code [ BAPI_CONTROLLINGAREA_FIND ]
  • GetDetail : Controlling area: Details [ BAPI_CONTROLLINGAREA_GETDETAIL ]
  • GetList : Read cost accounting area [ BAPI_CONTROLLINGAREA_GETLIST ]
  • GetPeriod : For controlling area: Posting date -> Period, fiscal year [ BAPI_CONTROLLINGAREA_GETPERIOD ]
  • GetPeriodLimits : For controlling area: First and last day of period [ BAPI_COAREA_GETPERIODLIMITS ]
  • GetRelatedCompCodes : Determine Company Codes Assigned to one Controlling Area [ BAPI_COAREA_GET_RELATED_CCODES ]

11-Dec-2005


Find

Find


This method provides the company code with the controlling areaassigned to it. If the company code does not exist an appropriate errormessage is transferred to the RETURN paramter. If no controlling areahas been assigned to the company code, the initial value (space) is
assigned to the CONTROLLINGAREAID parameter. No error message exists inthe RETURN structure, because this situation is valid from a business perspective.

Example

  1. DATA: CONTROLLINGAREAID        LIKE BAPI0004_2-CO_AREA ,
          COMPANYCODEID            LIKE BAPI0002_2-CO_AREA ,

          RETURN                   LIKE BAPIRETURN         .
    COMPANYCODEID  = '0001'.
    CALL FUNCTION 'BAPI_CONTROLLINGAREA_FIND'
         EXPORTING
             COMPANYCODEID          = COMPANYCODEID

         IMPORTING
             CONTROLLINGAREAID      = CONTROLLINGAREAID
             RETURN                 = RETURN
         EXCEPTIONS
             OTHERS                 = 1 .

Notes

To find existing controlling area keys, use the method Companycode.GetList (BAPI_COMPANYCODE_GETLIST).


Messages are sent to parameter RETURN. The parameter documentation includes the return values and their meaning.


11-Dec-2005


GetDetail

GetDetail


Supplies the following details about a controlling area:

  • Name
  • Currency
  • Chart of accounts
  • Fiscal year variant
  • Example

    DATA: CONTROLLINGAREAID LIKE BAPI0004_2-CO_AREA ,
    CONTROLLINGAREA_DETAIL LIKE BAPI0004_2 ,

    RETURN LIKE BAPIRETURN .

    CONTROLLINGAREAID = '0001'.

    CALL FUNCTION 'BAPI_CONTROLLINGAREA_GETDETAIL'
    EXPORTING
    CONTROLLINGAREAID = CONTROLLINGAREAID
    IMPORTING
    CONTROLLINGAREA_DETAIL = CONTROLLINGAREA_DETAIL
    RETURN = RETURN

    EXCEPTIONS
    OTHERS = 1 .

    Notes

    You require system authorization for object S_TABU_DIS and table class KC.

    You can determine existing controlling area keys with ControllingArea.GetList (BAPI_CONTROLLINGAREA_GETLIST).


    Messages are returned in parameter RETURN. You can find the return values and their meanings in the parameter documentation.


    11-Dec-2005


    GetList

    GetList


    Method offering a list of existing controlling areas.

    Example

    DATA: RETURN LIKE BAPIRETURN ,
    CONTROLLINGAREA_LIST LIKE BAPI0004_1 OCCURS 0 WITH HEADER LINE.

    CALL FUNCTION 'BAPI_CONTROLLINGAREA_GETLIST'
    IMPORTING
    RETURN = RETURN
    TABLES

    CONTROLLINGAREA_LIST = CONTROLLINGAREA_LIST
    EXCEPTIONS
    OTHERS = 1 .

    Notes

    You require authorization for object S_TABU_DIS and table class KC.

    Messages send via parameter RETURN. See the parameter documentation for more information on return values and their uses.


    You can find additional information for an individual controlling area with the method ControllingArea.GetDetail(BAPI_CONTROLLINGAREA_GETDETAIL).


    11-Dec-2005


    GetPeriod

    GetPeriod


    This method returns the corresponding fiscal year and the posting period for a controlling area and a posting date.


    11-Dec-2005


    GetPeriodLimits

    GetPeriodLimits


    Method returning a complete date for the first and last days of aperiod in a controlling area, fiscal year, and period. If the givenperiod is a special period, the last posting period is also included.


    11-Dec-2005


    GetRelatedCompCodes

    GetRelatedCompCodes


    The ControllingArea.GetRelatedCompCodes method (BAPI_COAREA_GET_RELATED_CCODES) determines all the company codesassigned to one controlling area.

    Example

    DATA: CONTROLLINGAREAID LIKE BAPI0004_3-CO_AREA ,
    RELATED_COMPANYCODES LIKE BAPI0004_3 OCCURS 0,

    RETURN LIKE BAPIRETURN .

    CONTROLLINGAREAID = '0001'.

    CALL FUNCTION 'BAPI_COAREA_GET_RELATED_CCODES'
    EXPORTING
    CONTROLLINGAREAID = CONTROLLINGAREAID
    IMPORTING
    RETURN = RETURN
    TABLES

    RELATED_COMPANYCODES = RELATED_COMPANYCODES .

    Notes

    You require authorization for object S_TABU_DIS and table class KC.

    You can determine the existing key for the controlling area using theControllingArea.GetList (BAPI_CONTROLLINGAREA_GETLIST) method.


    Messages are are issued in the RETURN parameter. In this parameterdocumentation you can find the return values and their meaning.

    If no company codes have been assigned, the RETURN parameter is initial and the RELATED_COMPANYCODES table contains no entries.


    11-Dec-2005