Sapass

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



Index

COPAQuery

COPAQuery


The methods in the business object COPAQuery allow the external
user to read actual and planning data in Profitability Analysis.


11-Dec-2005


Methods

Available Methods


  • GetAccountBasedActualData : Read actual data from account-based Profitability Analysis [ BAPI_COPAQUERY_GETACC_ACTDATA ]
  • GetAccountBasedPlanningData : Read planning data from account-based Profitability Analysis [ BAPI_COPAQUERY_GETACC_PLANDATA ]
  • GetCostingBasedActualData : Read actual data from costing-based Profitability Analysis [ BAPI_COPAQUERY_GETCOST_ACTDATA ]
  • GetCostingBasedPlanningData : Read planning data from costing-based Profitability Analysis [ BAPI_COPAQUERY_GETCOST_PLANDAT ]

11-Dec-2005


GetAccountBasedActualData

GetAccountBasedActualData


This method is used to read actual data in account-based Profitability Analysis.

For more information and an example, see the documentation for COPAQuery.GetCostActualData (function moduleBAPI_COPAQUERY_GETCOST_ACTDATA).


11-Dec-2005


GetAccountBasedPlanningData

GetAccountBasedPlanningData


This method is used to read planning data in account-based Profitability Analysis.

For more information and an example, see the documentation for COPAQuery.GetCostPlanningData (function moduleBAPI_COPAQUERY_GETCOST_PLANDATA).



11-Dec-2005


GetCostingBasedActualData

GetCostingBasedActualData


This method is used for reading actual data for costing-based Profitability Analysis.

For this, the data source (summarization levels, the object level orline items) is selected automatically depending on which source isexpected to deliver the desired data most quickly. Summarization levels
are not locked against entry when data is read from them (this meansthat, if the summarization levels are updated at the same time as datais being read, inconsistencies can occur when the data is returned).

If data is read from line items, then the current structure is always taken.


All characteristic values have an internal representation (for enteringthe selection criterion as well as in the table ResultData)!

The module is not suitable for reading mass data! If the selection isnot sufficiently reduced, the process can terminate due to long
runtimes. If you need to read large amounts of data, you should choosethe appropriate selection criteria so that several callups are implemented to read data on a package basis.

It is important that you watch for messages in the Return parameter.


Example

You wish to read the sales volume and the revenue for all products indivision "01" and for the period "001.1999" through "012.1999". Theactual data is posted to operating concern "S001" with record type "F"and currency type "B0" for costing-based Profitability Analysis.


For this, the import parameters should be defined as follows:

OperatingConcern: S001

CurrencyType: B0

MaxRecords: 500 (for example)

Table SelectedFields:

FIELDNAME

VRGAR
PERIO
SPART
ARTNR
ABSMG
ABSMG_ME
ERLOS


Table Selection:

FIELDNAME|SIGN|OPTION|LOW |HIGH

VRGAR |I |EQ |F |
PERIO |I |BT |1999001 |1999012
SPART |I |EQ |01 |

Note: All values must be entered using internal representation. "1999001" is the internal representation for period "001.1999".

Table ResultData is then filled with the actual data for two products,for example, in the following way (if data were only found in the period "001.1999"):

Table ResultData:

RECORD_ID|FIELDNAME|VALUE |CURRENCY
000001 |VRGAR |F |
000001 |PERIO |1999001 |

000001 |SPART |01 |
000001 |ARTNR |A1 |
000001 |ABSMG |20 |
000001 |ABSMG_ME |KG |
000001 |ERLOS |1000 |DEM
000002 |VRGAR |F |
000002 |PERIO |1999001 |
000002 |SPART |01 |
000002 |ARTNR |A2 |
000002 |ABSMG |30 |
000002 |ABSMG_ME |ST



000002 |ERLOS |2000 |DEM


11-Dec-2005


GetCostingBasedPlanningData

GetCostingBasedPlanningData


This method is used for reading planning data for costing-based Profitability Analysis.

For this, the data source (summarization levels, the object level orline items) is selected automatically depending on which source isexpected to deliver the desired data most quickly. Summarization levels
are not locked against entry when data is read from them (this meansthat, if the summarization levels are updated at the same time as datais being read, inconsistencies can occur when the data is returned).

If data is read from line items, then the current structure is always taken.


All characteristic values have an internal representation (for enteringthe selection criterion as well as in the table ResultData)!

The module is not suitable for reading mass data! If the selection isnot sufficiently reduced, the process can terminate due to long
runtimes. If you need to read large amounts of data, you should choosethe appropriate selection criteria so that several callups are implemented to read data on a package basis.

It is important that you watch for messages in the Return parameter.


Example

From plan version "001", you wish to read the sales volume and therevenue for all products in division "01" and for the period "001.1999"through "012.1999". The planning data is posted to operating concern"S001" with record type "F" and currency type "B0" for costing-based Profitability Analysis.


For this, the import parameters should be defined as follows:

OperatingConcern: S001

MaxRecords: 500 (for example)

Table SelectedFields:

FIELDNAME

PALEDGER
VRGAR
VERSI
PERIO
SPART
ARTNR
ABSMG_ME
ERLOS
ABSMG


Table Selection:

FIELDNAME|SIGN|OPTION|LOW |HIGH

PALEDGER |I |EQ |01 |
VRGAR |I |EQ |F |
VERSI |I |EQ |001 |
PERIO |I |BT |1999001 |1999012
SPART |I |EQ |01 |

Note: All values must be entered using internal representation. "01" is
the internal representation for currency type "B0", whereas "1999001" is the internal representation for period "001.1999".

Table ResultData is then filled with the planning data for twoproducts, for example, in the following way (if data were only found in the period "001.1999"):


Table ResultData:

RECORD_ID|FIELDNAME|VALUE |CURRENCY
000001 |PALEDGER |01 |
000001 |VRGAR |F |
000001 |VERSI |001 |
000001 |PERIO |1999001 |
000001 |SPART |01 |
000001 |ARTNR |A1



000001 |ABSMG_ME |KG |
000001 |ERLOS |1000 |DEM
000001 |ABSMG |20 |
000002 |PALEDGER |01 |
000002 |VRGAR |F |
000002 |VERSI |001 |
000002 |PERIO |1999001 |
000002 |SPART |01 |
000002 |ARTNR |A2 |
000002 |ABSMG_ME |ST |

000002 |ERLOS |2000 |DEM
000002 |ABSMG |30 |


11-Dec-2005