Fonction SAP BS01_PO_CREATE_OLD - Create purchase order

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
HEADER_ADD_DATA_RELEVANT BAPIMMPARA-SELECTION C 1 X Indicator: Additional Data (Header) Relevant
ITEM_ADD_DATA_RELEVANT BAPIMMPARA-SELECTION C 1 X Indicator: Additional data (item) relevant
PO_ADDRESS BAPIADDRESS u 1243 X Ordering Address for One-Time Vendor
PO_HEADER BAPIEKKOC u 73 Order header data
PO_HEADER_ADD_DATA BAPIEKKOA u 168 X Additional Data: PO Header
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 BAPIEKPOC 541 Table of PO Items
PO_ITEM_ACCOUNT_ASSIGNMENT BAPIEKKN 401 X Table of Account Assignments
PO_ITEM_ADD_DATA BAPIEKPOA 52 X Additional Data: PO Item
PO_ITEM_SCHEDULES BAPIEKET 108 Table of Schedule Lines
PO_ITEM_TEXT BAPIEKPOTX 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 BAPIRETURN 452 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 are trasnferred in table PoHeader and theitem data in table PoItems. If the account assignemnt categoryis set in an item, account assignemnt data can be transferred per POitem in the transfer table PoItemAccountAssignm. The accountassignemnt category determines which objects that are relevant to costaccounting have to be transferred in the account assignment data. Forexample, 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
    Only set the indicator if you want to transfer fields fromPoHeaderAddData. This indicator is not set in the standardsystem settings.

    Description
    Only set the indicator is you want to transfer fields fromPoHeaderAddData. This indicator is not set in the standardsystem settings.

    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
    You should only transfer this parameter if you want to transferexisting purchase orders from an external system to the SAP System.
    If parameter HeaderAddDataRelevan is set, all the fieldsfrom PoHeaderAddData are trasnferred to the purchase order, evenif some fields contain initial values.
    Example:
    The Incoterms are filled with "FOB Hamburg" in the vendor master recordfor vendor number 4711.

    • If you want to create a new purchase order with this method, do not set
    • parameter HeaderAddDataRelevan. The Incoterms in the purchaseorder are then transferred from the vendor master record (FOB Hamburg).
      • If you want to copy an old purchase order with this method and if no
      • Incoterms are stored in the old PO, set the parameter
        HeaderAddDataRelevan. Fields INCOTERMS1 and INCOTERMS2 aretransferred with initial values (blank) in parameter
        PoHeaderAddData. This means that the data from the vendor masterrecord is overwritten.
        Please note that you have to transfer all the data in the old PO inPoHeaderAddData, since all the fields are transferred tothe new purchase order.

        Description
        If the indicator is set, incorrect items are ignored.

        Description
        The table contains purchase requisition limits with reference to thecontract.
        INCLUDE BAPI_DATAELEMENT

        Description
        The table contains purchase order item data, for example, materialnumberm item category and plant.
        INCLUDE BAPI_DATAELEMENT

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

        Description
        You should only transfer this parameter if you want to transferexisting purchase orders from an external system to the SAP system.
        If the parameter ItemAddDataRelevant has been set, allethe fields from PoItemAddData are transferred to the purchaseorder, even if certain fields contain initial values.
        Please read the documentation for parameter PoHeaderAddData.
        INCLUDE BAPI_DATAELEMENT

        Description
        For each transferred item, you must transfer at least one entry in thistable since, for example, the delivery date (DELIV_DATE) is not in theitem data.
        You cantransfer the date 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
          This table contains the services and the outline layouts for the POrequisition.
          You can use the field OUTL_IND to define a line as an outline line. Youcan assign the service lines to the outline lines using fields PCKG_NO(service line) 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 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.

            Description
            INCLUDE BAPI_TABLE

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