Posted: Thu Sep 20, 2007 12:10 pm Post subject: BAPI_SALESORDER_SIMULATE
BAPI_SALESORDER_SIMULATE - Sales Order: Simulate Sales Order
Functionality
This method has the same interface definition as the BAPI_SALESORDER_CREATEFROMDAT1 function but differs from it in that here the sales order is not updated.
Here you can determine availability and pricing. This data is displayed in the ORDER_ITEMS_OUT table.
Code:
REPORT z_salesorder_simulate.
DATA: order_header_in LIKE bapisdhead,
order_items_in LIKE TABLE OF bapiitemin,
return LIKE bapireturn,
wa_order_items_in LIKE LINE OF order_items_in,
order_partners LIKE TABLE OF bapipartnr,
wa_order_partners LIKE LINE OF order_partners,
order_items_out LIKE TABLE OF bapiitemex,
wa_order_items_out LIKE LINE OF order_items_out.
* Fill order_header_in
order_header_in-doc_type = 'TA'.
* Fill order_items_in
wa_order_items_in-material = '000000000000000001'.
wa_order_items_in-req_qty = '1000'.
APPEND wa_order_items_in TO order_items_in.
* Fill order_items_in
wa_order_partners-partn_role = 'AG'.
wa_order_partners-partn_numb = '0000000001'.
* The return structure gives any error messages
WRITE: return-message.
* Print out the order items
LOOP AT order_items_out INTO wa_order_items_out.
WRITE: wa_order_items_out-material,
wa_order_items_out-short_text,
wa_order_items_out-subtotal_2.
ENDLOOP.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.