Fonction SAP BS01_PO_CREATE - Create purchase order

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
PO_ADDRESS BAPIADDRESS u 1243 X Ordering Address for One-Time Vendor
PO_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
EXTENSIONIN BAPIPAREX 990 X Customer Enhancment Import
PO_CONTRACT_LIMITS BAPIESUCC 90 X Limits with Contract Reference
PO_ITEMS BS01MMITEM 1089 Table of PO Items
PO_ITEM_ACCOUNT_ASSIGNMENT BAPIEKKN 401 X Table of Account Assignments
PO_ITEM_SCHEDULES BS01MMSCHEDULE 108 Table of Schedule Lines
PO_ITEM_TEXT BS01MMITEMTX 153 X Table of Item Texts
PO_LIMITS BAPIESUHC 103 X Limits
PO_SERVICES BSMMESLLC 650 X Services
PO_SERVICES_TEXT BAPIESLLTX 158 X Text for Service Line
PO_SRV_ACCASS_VALUES BAPIESKLC 40 X Value/link to service account assignment
RETURN BAPIRET2 548 X Confirmations

Functionality
You can use this method to create purchase orders.

Notes
Transfer
The document header data in table PO_HEADER, at least, have totransferred as import parameter.
The item data can be transferred in table PO_ITEMS.
Account Assignments
If the account assignment category has been set in an item, you cantransfer account assignment data per purchase order item in thetransfer table PO_ITEM_ACCOUNT_ASSIGNMENT. The accountassignment category defines which objects relevant to controlling haveto be transferred in the account assignment data. If the accountassignment category is K, for example, a cost center has to betransferred.
If the item is to be ordered from a one-time vendor, the orderingaddress of this vendor has to be transferred in table PO_ADDRESS
.
Table PO_ITEM_SCHEDULES has to be transferred per item with thedelivery date etc.
Limits
You can transfer limit data for the purchase order item in tablesPO_LIMITS and PO_CONTRACT_LIMITS.
Services
You can transfer service data for the purchase order item in tablesPO_SERVICES and PO_SRV_ACCASS_VALUES.
Return
The purchase order number is transferred in parameter PURCHASEORDER
.
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, forexample, vendor number, document type and purchasing organization.
INCLUDE BAPI_DATAELEMENT

Description
If the indicator is set, incorrect items are ignored.
If you have defined customer fields in table ESLL, you can use thisparameter to transmit the data in these fields.

Description
This table contains the purchase requisition limits with refernce tothe contract.
INCLUDE BAPI_DATAELEMENT

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

Description
The table contains account assignment data for the purchase order item.
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 texts for the purchase order item.
    INCLUDE BAPI_DATAELEMENT

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

    Description
    The table contains the services and the outline layouts for thepurchase requisition.
    Youz can define a line as an outline line using field OUTL_IND. You canassign service lines to outline lines using fields PCKG_NO (serviceline) and SUBPCKG_NO (outline line).
    The hierarchy 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 can transfer texts for the service line in table PO_SERVICES_TEXT.You can transfer:

    • allowed text types, for example, line text, service text in field
    • TEXT_ID
      • the actual text lines in field TEXT_LINE

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

        Description
        The table contains the values for the account assignments on servicelevel and a link to the complete account assignemnt for the purchaseorder item (table PO_ITEM_ACCOUNT_ASSIGNMENT, field SERIAL_NO).
        The actual account assignment data (cost center etc.) is stored inaccount assignment table PO_ITEM_ACCOUNT_ASSIGNMENT and isidentified by this link.

        Description
        INCLUDE BAPI_TABLE

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