Skip to Content
author's profile photo Former Member
Former Member

BAPI_SALESORDER_CHANGE - Condition Value change

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Oct 05, 2007 at 08:07 PM

    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...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 25, 2010 at 12:33 AM

    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)!

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 06, 2007 at 05:42 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 14, 2010 at 01:31 PM

    Hi Riza Tapel ,

    Your solution has worked. Thanks.

    Regards,

    Gurhan Gurbuz

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.