Application Development 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: 

BAPI_SALESORDER_CHANGE - Condition Value change

Former Member
0 Kudos

Hi Friends,

I want to change the Condition Value for the Condition Type = 'ZFRG' (Freight Condition), using BAPI_SALESORDER_CHANGE Function Module. I am passing the condition related changes to CONDITIONS_IN and CONDITIONS_INX Structures.

For Eg.,

Import Parameter

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

SALESDOCUMENT = '0000917608'.

ORDER_HEADER_INX = 'U'.

Table Parameter

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

CONDITIONS_IN-ITM_NUMBER = '000010'.

CONDITIONS_IN-COND_TYPE = 'ZFRG'.

CONDITIONS_IN-COND_VALUE = '50.00'.

CONDITIONS_IN-CURRENCY = 'USD'.

CONDITIONS_IN-CURR_ISO = 'USD'.

CONDITIONS_INX-ITM_NUMBER = '000010'.

CONDITIONS_INX-COND_TYPE = 'ZFRG'.

CONDITIONS_INX-UPDATEFLAG = 'U'.

CONDITIONS_INX-COND_VALUE = 'X'.

CONDITIONS_INX-CURRENCY = 'X'.

When i pass the above structure to BAPI_SALESORDER_CHANGE, a new line item in Conditions Tab is getting added for the Condition_Type 'ZFRG', instead of changing the value for the existing condition type 'ZFRG'.

Is there any other Field needs to be added in the Condition Structure, to change the existing value for the condition type 'ZFRG'?

Thanks in Advance,

Vijay G

4 REPLIES 4

Jelena
Active Contributor
0 Kudos

Have you tried passing the line number (POSNR) in ORDER_ITEM_IN and ORDER_ITEM_INX with ORDER_ITEM_INX-UPDATEFLAG = 'U'? It doesn't seem to be required but sometimes helps.

Also just a wild thought - check if ZFRG condition may be changed at all. I have a feeling that if it's not configured as a "manual condition" and cannot be manually changed, say, on VA02, then you won't be able to change it with BAPI.

If that's the case then maybe deleting it first ('D') and inserting the new value ('I') will help...

Former Member
0 Kudos

Hi Vijay,

It is not simple to change the pricing condition....

When you try to change the pricing condition check for the following;

1. All the Line Item condition will be considered as header level and will be grayed out so you not change the value, you have to delete the condition type in header and re-insert it into line item....

You can check this when you try to create a sales order with referecne with Quotation, Contract, refe. sales order.... try using some of the routine to manuplate the records... but this is very tickey will trigger for all the condition type and line iems....

If the hint is useful… Say thanks by reward….

Regards,

Prabhu Rajesh

Former Member

Hi,

This seems to work. You need to get the following values from table KONV and pass it to the BAPI

Table: KONV (KONV-KNUMV = VBAK-KNUMV)

MANDT KNUMV KPOSN STUNR ZAEHK KAPPL KSCHL KDATU KRECH

300 0000944592 000010 941 01 V ZCOH 01/29/2008 A

AND pass to the following BAPI parameters:

SALESDOCUMENT 5188332

ORDER_HEADER_INX

UPDATEFLAG U

CONDITIONS_IN

ITM_NUMBER 000010

COND_ST_NO 941

COND_COUNT 01

COND_TYPE ZCOH

COND_VALUE 9.700000000

CONDITIONS_INX

ITM_NUMBER 000010

COND_ST_NO 941

COND_COUNT 01

COND_TYPE ZCOH

UPDATEFLAG U

COND_VALUE X

CURRENCY

The above solution worked for me.

Hope this helps (maybe for future reference)!

Former Member
0 Kudos

Hi Riza Tapel ,

Your solution has worked. Thanks.

Regards,

Gurhan Gurbuz