Fonction SAP BAPI_COSTACTPLN_READPRIMCOST - Primary Cost Planning: Read

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
HEADERINFO BAPIPLNHDR u 68 Header Data

Paramètre Reférence Long. Facultatif Description
CONTRL BAPIPCPCTRL 15 X Control Data
COOBJECT BAPIPCPOBJ 70 Object List (Cost Center/Activity Type or Business Process)
INDEXSTRUCTURE BAPIACPSTRU 18 Assignment of Objects, Values and Control Data
PERVALUE BAPIPCPVAL 756 X Plan Values Per Period
RETURN BAPIRET2 548 Error Messages
TOTVALUE BAPIPCPTOT 172 X Plan Values Per Fiscal Year and Distribution Key

Functionality
This method reads primary plan costs.

Example
You want to know what costs were planned for cost element 400000 oncost center 4210, cost center 4220, activity type 110 and on businessprocess 1004210.
To find this out, you can make the following entries in the tables:
INDEXSTRUCTURE:
OBJECT_INDEX | VALUE_INDEX |
1 | 1 |
2 | 1 |
3 | 2 |
COOBJECT:
OBJECT_INDEX|COSTCENTER|ACTTYPE|ORDERID|WBS_ELEMENT|CO_BUSPROC
1 | 4210 | | | |
2 | 4220 | 110 | | |
3 | | | | | 1004210
TOTVALUE:
VALUE_INDEX|COST_ELEM|...
1 | 400000 |
2 | 400000 |
You do not need to specify TRANS_CURR if in HEADERINFO, the fieldPLAN_CURRTYPE as been set to "C" (controlling area currency) or "O"(object currency). If there are then data records for a cost element indifferent transaction currencies, the system returns a cumulated valueas it does in manual planning. If you enter the transaction currencyexplicity (PLAN_CURRTYPE = "T", TRANS_CURR filled), the system onlyreturns data records with the specified transaction currency.
The records are then read accordingly. Note that the VALUE_INDEX fieldin the INDEXSTRUCTURE table must be filled uniquely in a different wayfrom the write BAPIs. This means that each value may only appear onceso that the system can make a unique assignment of the values to beread to an object.

Description
The Header_Info structure contains the following fields:

  • CO_AREA - Controlling area

  • FISC_YEAR - Fiscal year

  • PERIOD_FROM - First period for which values are transferred

  • PERIOD_TO - Last period for which values are transferred

  • VERSION - Version in which the planning data is saved

  • DOC_HDR_TX - Document header text, only saved in integrated
  • planning
    • PLAN_CURRTYPE - Are the prices being planned in controlling area,
    • object or transaction currency?

      Value range

      • PERIOD_FROM, PERIOD_TO - the following must apply:

      • 1 <= PERIOD_FROM <= PERIOD_TO <= number of true posting periods
        • PLAN_CURRTYPE - the following values are allowed:

        • C - Planning in controlling area currency
          O - Planning in object currency
          T - Planning in transaction currency.

          Description
          This is where you transfer the control data.
          This data is as follows:

          • ATTRIB_INDEX - a unique key for the row that is referred to in the

          • INDEXSTRUCTURE table.
            • RECORD_QUANTITY - control indicator that shows if you
            • need to use actual quantities for recording data or not.
              • CELEM_ATTRIBUTE - cost element characteristics.
              • Description

                • OBJECT_INDEX - Index that uniquely identifies the row and thus the
                • object. The index must be greater than zero and must not appear twicein the table. If the index is not in INDEXSTRUCTURE, the system ignoresthe row.
                  • COSTCENTER - Cost center to be planned.

                  • ACTTYPE - Activity type, can only be filled together
                  • with COSTCENTER.
                    • CO_BUSPROC - Business process that is to be planned.

                    • ORDERID - Order that is to be planned.

                    • WBS_ELEMENT - WBS element that is to be planned.

                    • Only one object (COSTCENTER, CO_BUSPROC, ORDERID or WBS_ELEMENT) may befilled.

                      Description
                      The IDX_STRUCTURE table assigns the contents of the individual tablesto each other. An object must be used in each row that is in theOBJECT_INDEX field.
                      In addition, you can transfer a row with periodic values from thePER_VALUE table or with annual values from the TOT_VALUE table and arow with control data.
                      The VALUE_INDEX field refers to the values, and the ATTRIB_INDEX fieldto the control data.
                      If you do not want to transfer one of these, set the field to zero.

                      Value range
                      The OBJECT_INDEX field must only contain values that are also in theOBJECT_INDEX field in the OBJECT transfer table.
                      The VALUE_INDEX field must only contain values that are either in thePER_VALUE or TOT_VALUE transfer table in the VALUE_INDEX field.
                      The ATTRIB_INDEX field must only contain values that are in the CONTRLtransfer table in the ATTRIB_INDEX field.

                      Description
                      This is where you transfer the key information for the values that youwant to read. When the function module is processed, the system fillsthe values if they exist.
                      These are as follows:

                      • VALUE_INDEX - A unique key for the row that is referred to in the
                      • INDEXSTRUCTURE table. If the index is not in INDEXSTRUCTURE, the systemignores it.
                        • COST_ELEM - Cost element

                        • RESOURCE - Resources

                        • TRANS_CURRENCY_ISO - ISO Code for the transaction currency

                        • TRANS_CURR - Transaction currency

                        • UNIT_ISO - ISO Code of the unit of measure

                        • QUANTITY_UNIT - Unit of measure

                        • FIX_VAL_PER01-16 - Fixed values for periods 1-16

                        • VAR_VAL_PER01-16 - Variable values for periods 1-16

                        • FIX_QUAN_PER01-16 - Fixed quantities for periods 1-16

                        • VAR_QUAN_PER01-16 - Variable quantities for periods 1-16

                        • The system only includes the quantity fields for a specified unit ofmeasure.

                          Description
                          Return table that contains the error messages that were issued.

                          Description
                          This is where you transfer the key information for the values that youwant to read. When the function module is processed, the system fillsthe values if they exist.
                          These are as follows:

                          • VALUE_INDEX - A unique key for the row that is referred to in the
                          • INDEXSTRUCTURE table. If the index is not in INDEXSTRUCTURE, the systemignores the row.
                            • COST_ELEM - The cost element to be planned

                            • RESOURCE - The resource to be planned

                            • TRANS_CURRENCY_ISO - ISO code for the transaction currency

                            • TRANS_CURR - Transaction code

                            • UNIT_ISO - ISO Code for the unit of measure

                            • QUANTITY_UNIT - Unit of measure

                            • FIX_VALUE - Fixed value

                            • DIST_KEY_FIX_VAL - Distribution key for the fixed value required entry
                            • field
                              • VAR_VALUE - Variable value

                              • DIST_KEY_VAR_VAL - Distribution key for the variable quantity, required
                              • entry field
                                • FIX_QUAN - Fixed quantity

                                • DIST_KEY_FIX_QUAN - Distribution key for the fixed quantity, required
                                • entry field
                                  • VAR_QUAN - Variable quantity

                                  • DIST_KEY_VAR_QUAN - Distribution key for the variable quantity,
                                  • required entry field.
                                    The system only includes the quantity fields for specified units ofmeasure.