11-02-2007 10:55 AM
Hi,
I am using BAPI to create Purchase Orders. I am trying enter condition records programmaticakly. But it is showing error. If anybody knows. Pls let me know.
Thanx in advace.
S.GUNA
11-02-2007 11:01 AM
Hi,
Please refer to the FM documentation below.Hope it helps you.
Functionality
Function module BAPI_PO_CREATE1 enables you to create purchase orders. The BAPI uses the technology behind the Enjoy purchase order transaction ( ME21N).
Alternatively, the IDoc type PORDCR1 is available. The data from this IDoc automatically populates the interface parameters of the function module BAPI_PO_CREATE1.
Functionality in Detail
Authorization
The following authorization objects are checked when an Enjoy purchase order is created (activity 01):
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)
Controlling adoption of field values via X parameter
For most tables, you can determine via your own parameters in the associated X parameter in each case (e.g. PoItemX) whether fields are to be set initial, values inserted via the interface, or default values adopted (e.g. from Customizing or master records) (for example, it is not mandatory to adopt the material group from an underlying purchase requisition - you can change it with the BAPI).
Transfer
Header data
The header data of the Enjoy purchase order is transferred in the table PoHeader.
Item data
The item data of the Enjoy purchase order is stored in the table PoItem (general item data). The delivery schedule lines are stored in the table PoSchedule.
Use the table PoAccount to specify the account assignment information. If account assignments have been specified for services and limits, you show the relevant account assignment line in PoAccount in the table PoSrvAccessValues via the package number of the service or the limit.
Services and limits
Services, free limits and limits with contract reference can be specified in the tables PoServices, PoLimits, and PoContractLimits.
Conditions
Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. Price determination is reinitiated via the parameter CALCTYPE in the table PoItem.
Vendor and delivery address
The vendor's address can be specified individually in the table PoAddrVendor; the delivery address in the table PoAddrDelivery. If you do not make any individual specification, the fields will be populated via the central address management facility.
Note
In this method, the following restrictions apply with regard to addresses:
Addresses can only be created with this method - they cannot be changed. You can only change address data with the method BAPI_ADDRESSORG_CHANGE.
When you create addresses, they are not checked by the method. An Enjoy purchase order may therefore contain faulty address data.
Partner roles
The partners can be maintained individually via the table PoPartner (with the exception of the partner role "vendor").
Import/export data
Import/Export data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items.
Texts
Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText.
Version Management
You can make use of the Version Management facility via the table AllVersions.
Return
The PO number is returned in the parameter ExpPurchaseOrder. In addition, all information except the service and export/import tables is placed in the output structures.
Return messages
Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. When a PO has been created successfully, the PO number is also placed in the return table with the appropriate message.
Restrictions
With this function module, it is not possible to:
Create subcontracting components (you can only use existing ones)
Create configurations (you can only use existing ones)
Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))
Attach documents to the purchase order.
Thanks,
Sandeep.
11-02-2007 11:01 AM
Hi,
Please refer to the FM documentation below.Hope it helps you.
Functionality
Function module BAPI_PO_CREATE1 enables you to create purchase orders. The BAPI uses the technology behind the Enjoy purchase order transaction ( ME21N).
Alternatively, the IDoc type PORDCR1 is available. The data from this IDoc automatically populates the interface parameters of the function module BAPI_PO_CREATE1.
Functionality in Detail
Authorization
The following authorization objects are checked when an Enjoy purchase order is created (activity 01):
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)
Controlling adoption of field values via X parameter
For most tables, you can determine via your own parameters in the associated X parameter in each case (e.g. PoItemX) whether fields are to be set initial, values inserted via the interface, or default values adopted (e.g. from Customizing or master records) (for example, it is not mandatory to adopt the material group from an underlying purchase requisition - you can change it with the BAPI).
Transfer
Header data
The header data of the Enjoy purchase order is transferred in the table PoHeader.
Item data
The item data of the Enjoy purchase order is stored in the table PoItem (general item data). The delivery schedule lines are stored in the table PoSchedule.
Use the table PoAccount to specify the account assignment information. If account assignments have been specified for services and limits, you show the relevant account assignment line in PoAccount in the table PoSrvAccessValues via the package number of the service or the limit.
Services and limits
Services, free limits and limits with contract reference can be specified in the tables PoServices, PoLimits, and PoContractLimits.
Conditions
Conditions are transferred in the table PoCond; header conditions in the table PoCondHeader. Price determination is reinitiated via the parameter CALCTYPE in the table PoItem.
Vendor and delivery address
The vendor's address can be specified individually in the table PoAddrVendor; the delivery address in the table PoAddrDelivery. If you do not make any individual specification, the fields will be populated via the central address management facility.
Note
In this method, the following restrictions apply with regard to addresses:
Addresses can only be created with this method - they cannot be changed. You can only change address data with the method BAPI_ADDRESSORG_CHANGE.
When you create addresses, they are not checked by the method. An Enjoy purchase order may therefore contain faulty address data.
Partner roles
The partners can be maintained individually via the table PoPartner (with the exception of the partner role "vendor").
Import/export data
Import/Export data can be specified per item in the table PoExpImpItem. Foreign trade data can only be transferred as default data for new items.
Texts
Header and item texts can be transferred in the tables PoTextHeader and PoTextItem. Texts for services are imported in the table PoServicesText.
Version Management
You can make use of the Version Management facility via the table AllVersions.
Return
The PO number is returned in the parameter ExpPurchaseOrder. In addition, all information except the service and export/import tables is placed in the output structures.
Return messages
Messages are returned in the parameter Return. This also contains information as to whether interface data has been wrongly or probably wrongly (heuristical interface check) populated. When a PO has been created successfully, the PO number is also placed in the return table with the appropriate message.
Restrictions
With this function module, it is not possible to:
Create subcontracting components (you can only use existing ones)
Create configurations (you can only use existing ones)
Change message records (table NAST) and additional message data (this data can only be determined via the message determination facility (Customizing))
Attach documents to the purchase order.
Thanks,
Sandeep.