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

Error in BAPI_SALESORDER_CHANGE

Former Member
0 Likes
1,082

hi SDNers,

Iam using BAPI_SALESORDER_CHANGE to change items of the SO-updating the values for pricing-conditions of the items.

for ex:ZDC1,ZDS2.

The problem is after the BAPI is run,I see only the first condition type ZDC1 two times in the item of the SO.

can any one suggest the potential cause of the error;if I had missed out filling any mandatory structure required!

The piece of the condition structure I populated.

i_conditions_in-itm_number = itab-posnr.

i_conditions_in-cond_type = 'ZDC1'.

i_conditions_in-cond_value = w_kbetr.

i_conditions_in-cond_p_unt = '1'.

append i_conditions_in.

i_conditions_in-itm_number = itab-posnr.

i_conditions_in-cond_type = 'ZDS2'.

i_conditions_in-cond_value = u_kbetr.

i_conditions_in-cond_p_unt = '1'.

append i_conditions_in.

i_conditions_inx-itm_number = itab-posnr.

i_conditions_inx-cond_type = 'ZDC1'.

i_conditions_inx-updateflag = 'U'.

i_conditions_inx-cond_value = 'X'.

i_conditions_inx-cond_p_unt = 'X'.

append i_conditions_inx.

i_conditions_inx-itm_number = itab-posnr.

i_conditions_inx-cond_type = 'ZDS2'.

i_conditions_inx-updateflag = 'U'.

i_conditions_inx-cond_value = 'X'.

i_conditions_inx-cond_p_unt = 'X'.

append i_conditions_inx.

w_kbetr,u_kbetr are calculated values.

Thanks in Advance.

Mahendhar

5 REPLIES 5
Read only

Former Member
0 Likes
866

I couldnt find any problem with the code. Maybe try passing the currency and ignore Condition pricing unit(COND_P_UNT). Try this way and see if this can help you.

Also try changing the sales order manually via VA02 and adding these two condition types and see if you are successful.

Kind Regards

Eswar

Read only

0 Likes
866

any suggestions please.

Read only

Former Member
0 Likes
866

Hi,

Try using COND_COUNT field in condition_in table.

'01' for 'ZDC1'

'02' for 'ZDS2'

Also in conditions_inx mark the COND_COUNT flag 'X'

Hope this helps you.

Regards,

Roshan

Read only

0 Likes
866

Hi Roshan,

Thanks for the reply,

A search in SDN has made me understand that we have to set the 'LOGIC_SWITCH-COND_HANDLE' to 'X'.But am using version 4.5 B,where I cannot find this parameter.

Any one confirm me if this is the cause of my error,if yes any workaround possible for my case.

Thanks

Mahendhar Reddy

Read only

Former Member
0 Likes
866

followed a work around to do with bdc ,as the prior versions of SAP doesn't allow these features with sales order change bapi.