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

Update Amount through bapi BAPI_SALESORDER_CREATEFROMDAT2

sivaganesh_krishnan
Contributor
0 Likes
1,729

Hi ,

Can anyone could tell me on how to insert amount for a particular material inorder to create sales order through  BAPI_SALESORDER_CREATEFROMDAT2.

Could you please tell me which field should i pass the value.

Regards,

Sivaganesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,561

Hi,

Try this code for conditions update,its worked for me

    WA_ORDER_COND-ITM_NUMBER = WA_INP_ITEM-POSNR.

    WA_ORDER_COND-COND_TYPE = 'PR00'.

    WA_ORDER_COND-COND_VALUE = WA_INP_ITEM-KBETR.

    WA_ORDER_COND-CURRENCY = 'USD'.

    WA_ORDER_COND_INX-ITM_NUMBER = WA_INP_ITEM-POSNR.

    WA_ORDER_COND_INX-COND_TYPE = 'PR00'.

    WA_ORDER_COND_INX-COND_VALUE = 'X'.

    WA_ORDER_COND_INX-CURRENCY = 'X'.

    WA_ORDER_COND_INX-UPDATEFLAG = 'X'.

    APPEND WA_ORDER_COND TO IT_ORDER_COND.

    APPEND WA_ORDER_COND_INX TO IT_ORDER_COND_INX.

8 REPLIES 8
Read only

engswee
Active Contributor
0 Likes
1,561

Hi Sivaganesh

You need to pass this in the  ORDER_CONDITIONS_IN parameter.

From the screenshot, looks like the order is using condition type PR00, so your entries should be


ORDER_CONDITIONS_IN-ITM_NUMBER = '000010'

ORDER_CONDITIONS_IN-COND_TYPE = 'PR00'

ORDER_CONDITIONS_IN-COND_VALUE = <amount_value>

Rgds

Eng Swee

Read only

0 Likes
1,561

hi ,

Thanks for your reply.

I am already passing those values but still the same issue prevails .

Read only

engswee
Active Contributor
0 Likes
1,561

Hi Sivaganesh

The BAPI works for me fine when I pass in those parameters. The issue might be dependent on the customizing/configuration on your system. Have you tried entering the amount directly from VA01? Are there any errors in the return table when you execute the BAPI?

One more thing I can think of is to pass in the currency ORDER_CONDITIONS_IN-CURRENCY.

Otherwise, you will just have to debug the BAPI to figure out why it's not working.

Rgds

Eng Swee

Read only

sivaganesh_krishnan
Contributor
0 Likes
1,561

Can anyone guide me on how to solve this issue ?

Read only

Former Member
0 Likes
1,562

Hi,

Try this code for conditions update,its worked for me

    WA_ORDER_COND-ITM_NUMBER = WA_INP_ITEM-POSNR.

    WA_ORDER_COND-COND_TYPE = 'PR00'.

    WA_ORDER_COND-COND_VALUE = WA_INP_ITEM-KBETR.

    WA_ORDER_COND-CURRENCY = 'USD'.

    WA_ORDER_COND_INX-ITM_NUMBER = WA_INP_ITEM-POSNR.

    WA_ORDER_COND_INX-COND_TYPE = 'PR00'.

    WA_ORDER_COND_INX-COND_VALUE = 'X'.

    WA_ORDER_COND_INX-CURRENCY = 'X'.

    WA_ORDER_COND_INX-UPDATEFLAG = 'X'.

    APPEND WA_ORDER_COND TO IT_ORDER_COND.

    APPEND WA_ORDER_COND_INX TO IT_ORDER_COND_INX.

Read only

sivaganesh_krishnan
Contributor
0 Likes
1,561

hi guys,

Thanks for your support. Both the answers where most helpfull . But the problem that i made is that i passed the condition switch . By removing those import parameter i was able to get the desired output.

Regards,

Sivaganesh

Read only

0 Likes
1,561

Hi Sivaganesh

Glad to hear that your issue has been resolved.

For clarity's sake, can you explain what you mean by "i passed the condition switch"? Do you mean you initially populated X parameter for the condition (ORDER_CONDITIONS_INX) ?

Please also remember to close the thread.

Rgds

Eng Swee

Read only

0 Likes
1,561

sorry Eng Swee Yeoh . I just misspelled the words, I was passing the Logic Switch value as import parameter into the bapi. After removing this it worked.

Regards,

Sivaganesh