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

A Problem about BAPI (BAPI_SALESORDER_CREATEFROMDAT2)

Former Member
0 Likes
589

Hi, all.

Now i try to use BAPI to create order,following is part of my codes:

function=this.createFunction("BAPI_SALESORDER_CREATEFROMDAT2 ");

JCO.ParameterList input = function.getImportParameterList();

JCO.ParameterList table = function.getTableParameterList();

JCO.Structure ORDER_HEADER_IN = input.getStructure("ORDER_HEADER_IN");

ORDER_HEADER_IN.setValue("TA","DOC_TYPE");

ORDER_HEADER_IN.setValue("3000","SALES_ORG");

ORDER_HEADER_IN.setValue("10","DISTR_CHAN");

ORDER_HEADER_IN.setValue("00","DIVISION");

JCO.Table ORDER_PARTNERS = table.getTable("ORDER_PARTNERS");

ORDER_PARTNERS.setValue("SP","PARTN_ROLE");

ORDER_PARTNERS.setValue("3250","PARTN_NUMB");

JCO.Table ORDER_ITEMS_IN = table.getTable("ORDER_ITEMS_IN");

ORDER_ITEMS_IN.setValue("P104","MATERIAL");

ORDER_ITEMS_IN.setValue("10","ITM_NUMBER");

I ha already setup "ORDER_HEADER_IN"`s parameters.

But i still can`t create an order successfully.

And i got two message:

1.Plz enter sold-to party or ship-to party

2.Sales documents was not changed.

Can anyone help me solve this situation?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
554

hi Louis,

Checkout the link..,

http://www.henrikfrank.dk/abapexamples/Java/sapjava_createsalesorder.htm

hope it helps..,

regards,

Vinoth

4 REPLIES 4
Read only

Former Member
0 Likes
555

hi Louis,

Checkout the link..,

http://www.henrikfrank.dk/abapexamples/Java/sapjava_createsalesorder.htm

hope it helps..,

regards,

Vinoth

Read only

Former Member
0 Likes
554

Hi Louis,

Please refer this .

you might find a solution..

regards

satesh

Read only

Former Member
0 Likes
554

HI,

Have you made entries in the ORDER_HEADER_INX, ORDER_ITEMS_INX for each eantries in the ORDER_HEADER_IN, ORDER_ITEMS_IN.....

Check out the documentatoin of the FM in transaction SE37 to use how to use the FM.

Thanks,

Renjith

Read only

0 Likes
554

Hi,Renjith.

Can you tell what is ORDER_HEADER_INX`s functionality?

I already try to use ORDER_HEADER_INX and not to use.

There is no defference between them.

I still can create an order successfully.

Thx~~~ ^^

by Louis