SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

BAPI_SALESORDER_SIMULATE



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SD
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Thu Sep 20, 2007 12:10 pm    Post subject: BAPI_SALESORDER_SIMULATE Reply with quote

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'.
 
APPEND wa_order_partners TO order_partners.
 
* Execute Function Module BAPI_SALESORDER_SIMULATE
CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'
  EXPORTING
    order_header_in           = order_header_in
  IMPORTING
    return                    = return
  TABLES
    order_items_in            = order_items_in
    order_partners            = order_partners
    order_items_out           = order_items_out.
 
* 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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> SD All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
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.