Fonction SAP BS01_PURCHASE_DOCUMENT_CREATE - Purchase Document Creation

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
DOCUMENT_CATEGORY BS01MMHEAD-DOC_CAT C 1
DOC_ADDRESS BAPIADDRESS u 1243 X Ordering Address for One-Time Vendor
DOC_HEADER BS01MMHEAD u 478 Order header data
SKIP_ITEMS_WITH_ERROR BAPIMMPARA-SELECTION C 1 'X' X Indicator: Skip faulty items

Paramètre Reférence Type Long. Description
PURCHASEORDER BAPIEKKOC-PO_NUMBER C 10 Purchase Order Number

Paramètre Reférence Long. Facultatif Description
DOC_CONTRACT_LIMITS BAPIESUCC 90 X Limits with Contract Reference
DOC_ITEMS BS01MMITEM 1089 Table of PO Items
DOC_ITEM_ACCOUNT_ASSIGNMENT BAPIEKKN 401 X Table of Account Assignments
DOC_ITEM_SCHEDULES BS01MMSCHEDULE 108 Table of Schedule Lines
DOC_ITEM_TEXT BS01MMITEMTX 153 X Table of Item Texts
DOC_LIMITS BAPIESUHC 103 X Limits
DOC_SERVICES BSMMESLLC 650 X Services
DOC_SERVICES_TEXT BAPIESLLTX 158 X Text for Service Line
DOC_SRV_ACCASS_VALUES BAPIESKLC 40 X Value/link to service account assignment
EXTENSIONIN BAPIPAREX 990 X Customer Enhancment Import
RETURN BAPIRET2 548 X Confirmations

Functionality
You can create purchase orders (PO) with this method.

Notes
The following authorization objects with activity 01 (create) arechecked:

  • M_BEST_BSA,,Document type in PO

  • M_BEST_EKG,,Purchasing group in PO

  • M_BEST_EKO,,Purchasing organization in PO

  • M_BEST_WRK,,Plant in PO

  • Transfer
    The PO header data is transferred in table PoHeader and the itemdata in table PoItems. If the account assignemnt category is setin an item, account assignemnt data can be transferred per PO item inthe transfer table PoItemAccountAssignm. The account assignmentcategory determines which objects that are relevant to cost accountinghave to be transferred in the account assignment data. For example, K =a cost center has to be transferred.
    If the item is to be ordered from a one-time vendor, this orderingaddress must transferred in table PoAddress.
    Table PoItemSchedules has to be transferred per item with thedelivery date etc.
    Limits
    You can transfer limit data for the PO item in tables PoLimitsand PoContractLimits.
    Services
    You can transfer service data for the PO item in tables POServices
    and POSrvAccAssValues.
    Please read the documentation for the parameters, especially forPoHeaderAddData, HeaderAddDataRelevant, PoItemAddData
    and ItemAddDataRelevant.
    Return
    The PO number is returned in parameter Number.
    Return messages
    INCLUDE BAPI_RET

    Description
    INCLUDE BAPI_KEYFIELD

    Description
    This parameter contains the ordering address for the one-time vendor.
    INCLUDE BAPI_DATAELEMENT

    Description
    This parameter contains general purchase order header data such asvendor number, document type and purchasing organization.
    INCLUDE BAPI_DATAELEMENT

    Description
    If this indicator has been set, incorrect items are ignored.

    Description
    The table contains the purchase requisition limits with reference tothe contract.
    INCLUDE BAPI_DATAELEMENT

    Description
    The table contains purchase order item data such as material number,item category and plant.
    INCLUDE BAPI_DATAELEMENT

    Description
    The table contains the account assignment data for the purchase orderitem.
    INCLUDE BAPI_DATAELEMENT

    Description
    At least one entry in this table must be transferred per itemtransferred since, for example, the delivery date (DELIV_DATE) is notin the item data.
    You can transfer the data type in the internal or external display:

    • Internal (DEL_DATCAT, for example, 1 for current date)

    • External (DEL_DATCAT_EXT, for example, T for current date)

    • INCLUDE BAPI_DATAELEMENT

      Description
      The table contains the texts for the purchase order item.
      INCLUDE BAPI_DATAELEMENT

      Description
      The table contains the limits for the purchase order.
      INCLUDE BAPI_DATAELEMENT

      Description
      The table contains the services and the outline layouts for thepurchase requisition.
      You can define a field as an outline line using field OUTL_IND.Assigning service lines to the outline lines takes place using fieldsPCKG_NO (service line) and SUBPCKG_NO (outline line).
      The hierarchcy for the outline is represented by fields LINE_NO andHI_LINE_NO. Field HI_LINE_NO links to field LINO_NO of the superioroutline.
      INCLUDE BAPI_DATAELEMENT

      Description
      You transfer data for the service line in table PoItemText. Youcan transfer:

      • the allowed text types such as line text, service text in field TEXT_ID

      • a SAPScript format key in field TEXT_FORM

      • the actual text lines in field TEXT_LINE

      • If TEXT_ID is empty, a line text is created. If FORMAT_COL is empty,the standard format key * is assigned.

        Description
        The table contains the values of the account assignments on servicelevel and a link to the overall account assignment for the purchaseorder item (table PoItemAccountAssignm, field SERIAL_NO).
        The actual account assignment data (cost center etc.) is stored in theaccount assignemnt table PoItemAccountAssignm and are identifiedvia this link.
        If you have defined customer fields in table ESLL, you can use thisparameter to transmit the data in these fields.

        Description
        INCLUDE BAPI_TABLE

        Value range
        Type,,ID,,Number,,Message
        E,,W5,,061,,An error has occurred in enhancement &
        ,,,,,,(pleae check)