Fonction SAP BAPI_COPAPLANNING_GETDATA - Read CO-PA Planning Data

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
OPERATINGCONCERN BAPI1167-OPERATINGCONCERN C 4 Operating Concern
TYPEOFPROFITANALYSIS BAPI1167-TYPEOFPA C 1 Type of Profitability Analysis

Paramètre Reférence Long. Facultatif Description
DATA BAPI_COPA_DATA 91 Data
RETURN BAPIRET2 548 Messages
SELECTEDFIELDS BAPI_COPA_FIELD 30 Field List
SELECTION BAPI_COPA_SELECTION 133 Selection

Functionality
This method can be used for reading planning data for ProfitabilityAnalysis.

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-basedProfitability 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" isthe 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 |

Description
For information on the significance of the operating concern, see therelevant glossary definition:Operating concern.

Default

Description
Type of Profitability Analysis

Value range
= "1": Costing-based Profitability Analysis
= "2": Account-based Profitability Analysis

Description
Export table containing the data that has been read. The example thatis described in the documentation on methods shows you how the table isfilled with data.
Each logical data record consists of a number of table lines in thetable DATA and has a unique RECORD_ID. For each field in tableSELECTEDFIELDS and for each logical data record, there is an entry intable DATA. For currency fields, the appropriate currency is in thefield CURRENCY.

Description
Export table containing the error messages that have occurred.
INCLUDE 'COPA_PLAN_FIELDLIST' OBJECT DOKU ID TX
INCLUDE 'COPA_PLAN_SELECTION' OBJECT DOKU ID TX