Fonction SAP BAPI_REQUIREMENT_CREATE - Create Requirement Coverage Request

Paramètre Reférence Type Long. Description
ITEM BAPIEBAN-PREQ_ITEM N 5 Item Number
NUMBER BAPIEBAN-PREQ_NO C 10 Number of Requirement Coverage Request

Paramètre Reférence Long. Facultatif Description
REQUIREMENT_ACCOUNT_ASSIGNMENT BAPIEBKN 485 X Account Assignment Data of Requirement Coverage Request
REQUIREMENT_ITEMS BAPIEBAN 1084 Item Data of Requirement Coverage Request
REQUIREMENT_ITEM_TEXT BAPIEBANTX 153 X Text Lines for Requirement Coverage Request
RETURN BAPIERRORS 443 Error Log

Exception Description
NO_OBJECT_ID Not Possible to Assign a Number

Functionality
You can use this method to create requirement coverage requests. Arequirement coverage request may be:

  • a purchase requisition,

  • if the requirement cannot be covered on the desired date by existingstocks on hand in the warehouse or stores, or
    • a reservation,

    • if adequate stocks are on hand.
      As of SAP Release 4.0A, use the method CreateFromData of thebusiness objects PurchaseRequisition and MaterialReservation
      .

      Notes
      The following authorization objects are checked:

      • M_BANF_BSA,,Document type in requisition

      • M_BANF_EKG,,Purchasing group in requisition

      • M_BANF_EKO,,Purchasing org. in requisition

      • M_BANF_WRK,,Plant in requisition

      • M_RES_BWA,,Reservations: Movement type

      • M_MRES_WWA,,Reservations: Plant
      • Data transfer
        Item data
        The item data of the requirement coverage request is passed on in thetable RequirementItems, whereby at least the following data isnecessary:

        • Item counter (PREQ_ITEM field)

        • Material number (MATERIAL field)

        • The following can also be passed on as an alternative to the materialnumber:
          Material group (MAT_GRP field) and
          Short text (short description) (SHORT_TEXT field) and
          Unit of measure (UNIT field) and
          Price (C_AMT_BAPI field) and
          Purchasing group (PUR_GROUP field)
          If the material number is passed on, the material group, short text etc.are taken from the material master record.
          • Requested quantity (QUANTITY field)

          • Requested date (DELIV_DATE field in the format YYYYMMDD) and date
          • category (DEL_DATCAT field)
            If the current date is passed on, the date category must be '1'.Alternative categories are '2' (week format) or '3' (month format); heretoo, DELIV_DATE must be passed on in the format YYYMMDD and is thenadjusted accordingly when displayed.
            • Object type (RES_REQ_ID field)

            • If a purchase requisition is to be created, this field must contain 'X'.In the case of a reservation it must be 'Y'.
              The following fields are also necessary. If they are not passed on inthe method, the specifications are taken from the relevant user masterrecord (parameter values). Note that they must at all events beavailable.
              • Document type for purchase requisitions (DOC_TYPE field)

              • Parameter ID BSA
                • Plant (PLANT field)

                • Parameter ID WRK
                  • Storage location (STORE_LOC field)

                  • Parameter ID LAG
                    Account assignments
                    Account assignment data for each requirement coverage request item (costcenter field COST_CTR) can be passed on in the transfer tableReqAccountAssignment.
                    If it is not passed on, costs are assigned to the cost center stored inthe user master record (parameter ID CNT). A precondition for this isthat the account assignment category (field ACCTASSCAT) that is passedon is not SPACE.
                    If the account assignment category is not passed on, a purchaserequisition item without account assignment is generated.
                    SAP user master record
                    The parameter ID BWA (movement type for reservations) must be maintainedin the relevant user master record.

                    Return
                    The method then returns the object number (parameter NUMBER) under whichthe requirement coverage request was created. The parameter ITEM ispresent for technical reasons and is always returned with its initialvalue.
                    If errors have occurred, these are shown in the Return table.
                    Number assignment
                    If no external object number was passed on (table RequirementItems
                    , PREQ_NO field), the number is assigned internally by the method. Aprecondition for internal number assignment is that the number rangeobject RESB (reservations) is adjusted in Customizing for InventoryManagement in the SAP System as follows:

                    • Change the interval with the number 01 to 0000000001 to 0019999999

                    • Add a new interval with the number 10 from 0090000000 to 0099999999.

                    • You can maintain the number range in the Implementation Guide (IMG):
                      Define Number Assignment for Reservations

                      This adjustment is necessary because in the standard system the sameinterval has also been created for the external assignment of purchaserequisition numbers. This means that one and the same number can beassigned for reservations and purchase requisitions. For example, justone number is assigned if both lines that are to be saved as purchaserequisitions and lines that are to be saved as reservations are to betransferred in the table RequirementItems.

                      Description
                      This parameter is required for technical reasons only (the item numberis defined in the Business Object Repository as a key field for theobject PurchaseRequisition) and is always passed on with itsinitial value.

                      Description
                      Both a purchase requisition and a reservation can be stored under therequirement coverage request number.

                      Value range
                      Dictionary data type: CHAR (field length length 10)

                      Description
                      This table contains the account assignment data relating to arequirement coverage request item.

                      Description
                      This table contains the item data of a requirement coverage request.

                      Description
                      In the table RequirementItemText you pass on texts for thepurchase requisition item. You can pass on the following:

                      • in field TEXT_ID, the allowed text types (e.g. item or delivery texts)

                      • in field TEXT_FORM, a SAPscript format key

                      • in field TEXT_LINE, the actual text lines

                      • If TEXT_ID is empty, an item text is always generated. If TEXT_FORM isempty, the standard format key * is assigned.

                        Description
                        This table contains all error messages issued.

325382BAPI_REQUISITION_CREATE: no planning file entry