Sapass

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



Index

PurchaseReqItem

PurchaseReqItem


No description is available


11-Dec-2005


Methods

Available Methods


  • CreateFromData : Create requirement coverage request [ BAPI_REQUIREMENT_CREATE ] (Obsolete in 40A)
  • GetList : Read requirement coverage request [ BAPI_REQUIREMENT_GET_LIST ] (Obsolete in 40A)
  • Release : Release purchase requisition [ BAPI_REQUISITION_RELEASE ]
  • ResetRelease : Cancel release of purchase requisitions [ BAPI_REQUISITION_RESET_RELEASE ]
  • SingleReleaseNoDialg : Release purchase requisition [ BAPI_REQUISITION_RELEASE ] (Obsolete in 46A)

11-Dec-2005


CreateFromData

CreateFromData


Method of creating a requirement coverage request. The latter can be

  • a purchase requisition,
    if the requirement cannot be satisfied 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 the business 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 the table RequirementItems, whereby at least the following data is necessary:

  • Item counter (field PREQ_ITEM)

  • Material number (field MATERIAL)
    The following can also be given as an alternative to the material number:
  • Material group (field MAT_GRP) and
  • Short text (short description) (field SHORT_TEXT) and

  • Unit of measure (field UNIT) and
  • Price (field C_AMT_BAPI) and
  • Purchasing group (field PUR_GROUP)
  • If the material number is passed on, the material group, short text etc. are taken from the material master record.


  • Requested quantity (Feld QUANTITY)
  • Requested date (field DELIV_DATE in the format YYYYMMDD) and date type (field DEL_DATCAT)
    If the current date is passed on, the date type must be '1'. Alternative types are '2' (week format) or '3' (month format); here
    too, DELIV_DATE must be passed on in the format YYYMMDD and is then adjusted accordingly when displayed.
  • Object type (field RES_REQ_ID)
    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 be available.

  • Document type for purchase requisitions (field DOC_TYPE)
    Parameter ID BSA

  • Plant (Feld PLANT)
    Parameter ID WRK
  • Storage location (field STORE_LOC)
    Parameter ID LAG
  • Account assignments

    Account assignment data for each requirement coverage request item(cost center field COST_CTR can be passed on in the transfer table ReqAccountAssignment.


    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 passed on is not SPACE.

    If the account assignment category is not passed on, a purchase requisition item without account assignment is generated.


    SAP user master record

    The parameter ID BWA (movement type for reservations) must be maintained in the relevant user master record.

    Return

    The method then returns the object number (parameter NUMBER) underwhich the requirement coverage request was created. The parameter ITEM
    is present for technical reasons and is always returned with its initial value.

    If errors have occurred, these are shown in the table Return.

    Number assignment

    If no external object number was passed on (table RequirementItems, field PREQ_NO), the number is assigned
    internally by the method. A precondition for internal number assignmentis that the number range object RESB (reservations) is adjusted in theCustomizing facility of the Inventory Management component of the R/3 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 same
    interval 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 purchase
    requisitions and lines that are to be saved as reservations are to be transferred in the table RequirementItems.


    11-Dec-2005


    GetList

    GetList


    This method allows you to generate the following lists:

  • Case 1: All requirement coverage requests (purchase requisitions and reservations) created by a certain user.
  • Case 2: All purchase requisitions that have to be released with a certain release code and group (collective release).

  • As of Release 4.0A, use the methods GetItems and GetItemsForRelease of the business object PurchaseRequisition.

    Notes

  • Case 1:
  • The following authorization objects are checked:


  • M_BANF_BSA Document type in purchase requisition
  • M_BANF_EKG Purchasing group in requisition
  • M_BANF_EKO Purchasing org. in requisition

  • M_BANF_WRK Plant in purchase requisition
  • M_MRES_BWA Reservations: movement type
  • M_MRES_WWA Reservations: plant
  • The user name must be given in the parameter Requisitioner/requester.


    The selection date can be given via the parameter Date. If adate exists, only those requirement coverage requests that were entered on or after this date are selected.

    At least one of the options OpenItems or ClosedItems must
    be set. It is also possible for both to be set, in which case both open and closed requirement coverage requests are selected.

    The result is delivered in the table ItemData.

  • Case 2:

    The authorization object M_EINK_FRG is checked.


    Here the transfer parameters described under case 1 need not be filled. Instead, the release code must be given in the parameterReleaseCode, and the release group in parameter ReleaseGroup.
    The parameter ItemsForRelease determines whether only the requisitions that are still to be released or those that have already
    been released are listed. The latter is useful, for example, if a list is to be generated for the purpose of cancelling releases.
    The result is delivered in the table ItemData.

  • 11-Dec-2005


    Release

    Release


    This method enables you to release (signify approval of) purchase requisitions item by item.

    This is necessary if a purchase requisition item satisfies the conditions defined in a release strategy

    Example: all purchase requisition items with a value exceeding $10,000 must be released (approved) before they can be issued.


    The requisition number and item and the release code must be passed on.The new release status and the new release indicator are returned.

    Messages are returned in the parameter return. The parameterdocumentation shows the return codes and their meanings.


    If you wish to release all the items of a purchase requisition at the same time, use the Release method for the business object PurchaseRequisition.

    Notes

    Authorization object M_EINK_FRG is checked.


    Further Information

    For further information, refer to the MM Purchasingdocumentation (section on release procedure) and the Implementation Guide (IMG) for Purchasing (under Set up releaseprocedure with classification).


    11-Dec-2005


    ResetRelease

    ResetRelease


    This method can be used to cancel the release (= revoke approval) ofpurchase requisitions. The requisition number/item and the release codemust be passed on. The release status and the release indicator that were valid before the release are then returned.


    Notes

    Authorization object M_EINK_FRG is checked.

    Further Information

    For further information, refer to the MM Purchasing documentation.


    11-Dec-2005


    SingleReleaseNoDialg

    SingleReleaseNoDialg


    This method enables you to release (signify approval of) purchase requisitions item by item.

    This is necessary if a purchase requisition item satisfies the conditions defined in a release strategy

    Example: all purchase requisition items with a value exceeding $10,000 must be released (approved) before they can be issued.


    The requisition number and item and the release code must be passed on.The new release status and the new release indicator are returned.

    Messages are returned in the parameter return. The parameterdocumentation shows the return codes and their meanings.


    If you wish to release all the items of a purchase requisition at the same time, use the Release method for the business object PurchaseRequisition.

    Notes

    Authorization object M_EINK_FRG is checked.


    Further Information

    For further information, refer to the MM Purchasingdocumentation (section on release procedure) and the Implementation Guide (IMG) for Purchasing (under Set up releaseprocedure with classification).


    11-Dec-2005