Sapass

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



Index

COPAPlanning

COPAPlanning


The business object CO-PA Planning allows the external user to
read planning data in Profitability Analysis and to write them back to system.


11-Dec-2005


Methods

Available Methods


  • GetData : Read Planning Data from Profitability Analysis [ BAPI_COPAPLANNING_GETDATA ]
  • PostData : Write Planning Data for Profitability Analysis [ BAPI_COPAPLANNING_POSTDATA ]

11-Dec-2005


GetData

GetData


This method can be used for reading planning data for Profitability Analysis.

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". 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

TYPEOFPROFITANALYSIS: 1

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 isthe internal representation of currency type "B0", whereas "1999001" is the internal representation of period "001.1999".


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

Table DATA:

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


PostData

PostData


You use this method to return planning data from Profitability Analysisback into the system. This overwrites existing planning data in thesystem (or, more precisely, the delta value between the old and new values is determined and updated as a line item).


You typically call up this method after reading planning data with theGetData method and making changes to it. To import the changed databack into the system, you fill the parameters SELECTEDFIELDS andSELECTION with data in the same way as you called up GetData. When data
is being written, these parameters determine how the delta valuebetween the planning data to be imported and the old planning data inthe system is determined: firstly, the old planning data in the systemis read in accordance with the values for the parameters SELECTEDFIELDS
and SELECTION, and then the delta for the data to be imported is created.

The data to be posted is imported using the table DATA. Since thistable is also used to read data with the GetData method, it should alsobe populated accordingly when data is imported. See also the documentation for the GetData method and for the parameter DATA for
this method.

Warning: Under certain circumstances, data that is not importedbut is already present in the system as an old value are canceled in this process.

If, for example, products A1 and A2 from plan version 001 are selected
in the selection criterion SELECTION but table DATA only contains planning data for product A1, the planning data for A2 that is inversion 001 and already in the system is canceled.


11-Dec-2005