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

BAPI_SALESORDER_CREATEFROMDAT2 - Problem with price

Former Member
0 Likes
941

Hi

I'm trying to create a Sales Document with the BAPI_SALESORDER_CREATEFROMDAT2 with SE37, i don't know what is missing, because it gives me the order number but when i call the BAPI_TRANSACTION_COMMIT, it doesn't create the document, the result of the BAPI_SALESORDER_CREATEFROMDAT2 is next:

S V4233SALES_HEADER_IN has been processed successfully

S V4233SALES_ITEM_IN has been processed successfully

W V1555The sales document is not yet complete: Edit data

S V1311Pedido Nacional 0000281711 has been saved

I feel the problem is in the parameters i'm sending, because i'm creating a sales order with VA01, and when debugging the BAPI and VA01, comparing table XVBAP at BAPI and VA01, i have difference at XVBAP-KWMENG and XVBAP-NETWR, at the BAPI'S table i don't have data, and at the VA01 transaction i have it, i give the parameters i'm sending so maybe somebody can help me.

<b>ORDER_HEADER_IN</b>

DOC_TYPE

SALES_ORG

DISTR_CHAN

DIVISION

REQ_DATE_H

PURCH_DATE

INCOTERMS1

PMNTTRMS

PRICE_DATE

PURCH_NO_C

<b>ORDER_ITEMS_IN</b>

MATERIAL

PLANT

TARGET_QTY

TARGET_QU

INCOTERMS1

ROUTE

<b>ORDER_PARTNERS</b>

PARTN_ROLE

PARTN_NUMB

And that's all.

Thanks

Best Regards.

Soraya Cervantes

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
593

warning does not matter. it shd create the order.

did u execute BAPI_TRANSACTION_COMMIT in separate window or using test sequence in se37

How to use test sequence

========================

In se37

from menu...

function modules->test->test sequence

1 : BAPI_SALESORDER_CREATEFROMDAT2

2 : BAPI_TRANSACTION_COMMIT

then fill the data & execute....

once u execute BAPI_SALESORDER_CREATEFROMDAT2

then go back once and once again press F8 to execute BAPI_TRANSACTION_COMMIT in sequence...

Plz reward points if helpful...

regards

gv

4 REPLIES 4
Read only

former_member221770
Contributor
0 Likes
593

Soraya,

You need to pass in the Pricing COnditions via the ORDER_CONDITIONS_IN and ORDER_CONDITIONS_INX parameters.

eg.


tbl_bapicond-itm_number = '000010'.
tbl_bapicond-cond_type  = 'ZP01'.
tbl_bapicond-cond_value = '100'.
append tbl_bapicond.

tbl_bapicondx-itm_number  = '000010'.
tbl_bapicondx-cond_type   = 'ZP01'.
tbl_bapicondx-update_flag = 'U'.
tbl_bapicondx-cond_value  = 'X'.
append tbl_bapicondx.

Hope this helps.

Cheers,

Pat.

PS. Kindly assign Reward Points to the posts you find helpful.

Read only

0 Likes
593

Hi !!

Thanks, i passed ORDER_CONDITIONS_IN, but anyway it didn't create the order ok, but, now the only thing i made was to take off the INCOTERMS1 and PMNTTRMS from the ORDER_HEADER_IN, and it works ok!, now i have to call the BAPI_TRANSACTION_COMMIT.

Thanks Patrick!

Greetings

Soraya

Read only

Former Member
0 Likes
594

warning does not matter. it shd create the order.

did u execute BAPI_TRANSACTION_COMMIT in separate window or using test sequence in se37

How to use test sequence

========================

In se37

from menu...

function modules->test->test sequence

1 : BAPI_SALESORDER_CREATEFROMDAT2

2 : BAPI_TRANSACTION_COMMIT

then fill the data & execute....

once u execute BAPI_SALESORDER_CREATEFROMDAT2

then go back once and once again press F8 to execute BAPI_TRANSACTION_COMMIT in sequence...

Plz reward points if helpful...

regards

gv

Read only

0 Likes
593

Hi Venkat

I did it and it works ok!!, now i can see the document i created by the BAPI_SALESORDER_CREATEFROMDAT2 at VA02!!

Thanks Venkat!

Greetings

Soraya