Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to create sales order using bapi( test purpose)

deviprasad_pothireddy
Active Participant
0 Likes
2,071

Hi all,

while i was creating sales order using the BAPI_SALESORDER_CREATEFROMDAT1 it is giving some error,

version 0 is not defined for the fiscal year ****.

I have given the fallowing parameters as input

ORDER_HEADER_IN

DOC_TYPE OR

SALES_ORG 1000

DISTR_CHAN 10

DIVISION 00

ORDER_PATNERS

PARTN_ROLE SP

PARTN_NUMB 1000

ORDER_ITEMSIN

MATERIAL M-13

I need to create sample sales order . Please help me how to create sales order with an example( for test purpose).

Regards

Deviprasad.

Hi all,

while i was creating sales order using the BAPI_SALESORDER_CREATEFROMDAT1 it is giving some error,

version 0 is not defined for the fiscal year ****.

I have given the fallowing parameters as input

ORDER_HEADER_IN

DOC_TYPE OR

SALES_ORG 1000

DISTR_CHAN 10

DIVISION 00

ORDER_PATNERS

PARTN_ROLE SP

PARTN_NUMB 1000

ORDER_ITEMSIN

MATERIAL M-13

I need to create sample sales order . Please help me how to create sales order with an example( for test purpose).

Regards

Deviprasad.

6 REPLIES 6
Read only

Former Member
0 Likes
1,468

Hi Deviprasad,

BAPI_SALESORDER_CREATEFROMDAT1 is obsolete as of 4.6C. Try using BAPI_SALESORDER_CREATEFROMDAT2.

Regards

Gareth

Read only

0 Likes
1,468

I have tested with the BAPI_SALESORDER_CREATEFROMDAT2

then

return message is ( type s, message-> sales_header_in has been processed succesful)

but the problem is, In export parameters there is no sales order number existing. i need this sales document number.

Please help me.

Regards,

Deviprasad

Read only

0 Likes
1,468

Hi

Should be in ORDER_KEYS-DOC_NUMBER and the export parameter SALESDOCUMENT.

Regards

Gareth

Read only

0 Likes
1,468

Devi,

Are you doing Commit after the BAPI is executed.

Please see the below text maintained in the BAPI documentation:

The BAPI does not have a database commit. This means that the

relevant application must leave the commit, in order that can be

carried out on on the database. The BAPI BAPI_TRANSACTION_COMMIT is

available for this.

Thanks

Read only

1,468

Refer to [Easy BAPI testing in SE37|http://dominiktylczynskien.wordpress.com/2011/07/06/easy-bapi-testing-in-se37/] You can easily test BAPI with commit in SE37.

Dominik Tylczynski

Read only

Former Member
0 Likes
1,468

Hi Prasad,

Try using BAPI_SALESORDER_CREATEFROMDAT2.

While creating sales order using FM: BAPI_SALESORDER_CREATEFROMDAT2, please make sure ORDER_ITEMS_IN, ORDER_ITEMS_INX, ORDER_SCHEDULES_IN, ORDER_SCHEDULES_INX.

Pricing Conditions will not be mandatory to create a sales order via BAPI.

As you were saying, you can create a sales order but not with items. Do populate the internal tables that i have specified above.

Also try to pass the item number internally, this will help you in identifying the schedule lines.

Regards,

Priyanka.