Showing results for 
Search instead for 
Did you mean: 

Create POS Sales Orders

Former Member
0 Kudos

Hi all

can anyone send me the codes for creating POS sales order via BAPI.

my Z* program should have the following featuer.:

1. Feature to get executed with read data from FILE and to get executed with read data from Z-Table

2. Create the SAP Sales Orders; Calling a BAPI: BAPI_SALESORDER_CREATEFROMDAT2 with respective parameters

3. Capture the messages returned by the BAPI

4. If Sales order created successfully, capture the new order number and report it

5. If any sales order creation fails, capture the data for that Sales order and insert the same in Z-table. And report the respective errors.

6. The data in Z-table that can be verified and reprocessed with step 1, here the successful records will be deleted from the z-table

7. If file is processed successfully, move it to the Archive folder in SAP Apps Server

any help from anyone..

will wait of reply

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi all,,

can someone offer me the sample code for bapi for creating sales order


Former Member
0 Kudos


1. first you upload the file into internal file

2. define tables and structures as like in bapi for ex

create_order_bapisdhd1 LIKE

bapisdhd1,item_data_bapisdhd LIKE bapisdhd


3 in the itab you have all the values, using string / some manipulations assign all the fields to the relevant bapi structure / table

then call the bapi



order_header_in = create_order_bapisdhd1


salesdocument = created_order_number


return = create_order_bapiret2

order_items_in = create_order_bapisditm

order_schedules_in = create_order_bapischdl

order_partners = create_order_bapiparnr

order_text = create_order_bapisdtext.

in the importing - sales document you have the sales document number if the sales order created successfully.

else in the return you have all the error message for the sales order creation using return you can find out the whether sales order created successfull or not.

then move all the error order details to another internal table (say itab_error )

then finaly move the itab_error tab to application server using open dataset and transfer statements