Change orders item price conditions

Hi all !!
I have to change/update orders item price condition in a report.
I think is possible calling the function CRM_ORDER_MAINTAIN but I do not manage to do that.
The CT_INPUT_FIELDS have these values:
REF_GUID = item guid
REF_KIND = 'B'
OBJECTNAME = 'PRIDOC'
Is it correct ?
Which others parameters have to be passed to the function?
Thanks in advance for your help!!
Elena

example:-
*& Report  ZSALESORDER_CHANGE
REPORT  ZSALESORDER_CHANGE MESSAGE-ID 38.
Selection Screen Definitions *
PARAMETERS: p_vbeln TYPE vbap-vbeln OBLIGATORY, "Order Number
p_posnr TYPE vbap-posnr OBLIGATORY, "Order Item
p_etenr TYPE vbep-etenr OBLIGATORY, "Schedule Line
p_reqqty TYPE bapischdl-req_qty OBLIGATORY. " Order Qty
Internal Tables/Structures/Variables for calling BAPI. *
DATA: i_hdr TYPE bapisdh1,
i_hdrx TYPE bapisdh1x,
i_ret TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
wa_ret TYPE bapiret2.
DATA: BEGIN OF i_sched OCCURS 10.
INCLUDE STRUCTURE bapischdl.
DATA: END OF i_sched.
DATA: BEGIN OF i_schedx OCCURS 10.
INCLUDE STRUCTURE bapischdlx.
DATA: END OF i_schedx.
START-OF-SELECTION Event *
START-OF-SELECTION.
*" Initialize internal tables.
REFRESH: i_sched, i_schedx, i_ret.
CLEAR: i_sched, i_schedx, i_ret.
*" Fill required ORDER_HEADER_IN data.
i_hdrx-updateflag = 'U'.
*" Fill required SCHEDULE_LINES data.
i_sched-itm_number = p_posnr.
i_sched-sched_line = p_etenr.
i_sched-req_qty = p_reqqty.
i_schedx-updateflag = 'U'.
i_schedx-itm_number = p_posnr.
i_schedx-sched_line = p_etenr.
i_schedx-req_qty = 'X'.
APPEND i_sched.
APPEND i_schedx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = p_vbeln
order_header_in = i_hdr
order_header_inx = i_hdrx
TABLES
return = i_ret
schedule_lines = i_sched
schedule_linesx = i_schedx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
LOOP AT i_ret.
WRITE / i_ret-message.
ENDLOOP.

Similar Messages

  • User-exit in VA01/VA02 to add order item and condition price

    Hi experts,
       I have an urgent requirement to add an order item and pricing for VA01/VA02 when certain logic are met. Do you know a user-exit in VA01/VA02 to add sales order item and condition price for an order?
    I am currently using user-exit USEREXIT_SAVE_DOCUMENT_PREPARE but I can only add the required order item to xvbap but I also need to add a condition code and condition price for the added item (in xkomv). Your response are very much appreciated.
    Thanks in advance!

    Hi Leo,
      Check out few more exits:
    Exit Name           Description
    SDTRM001            Reschedule schedule lines without a new ATP check
    V45A0001            Determine alternative materials for product selection
    V45A0002            Predefine sold-to party in sales document
    V45A0003            Collector for customer function modulpool MV45A
    V45A0004            Copy packing proposal
    V45E0001            Update the purchase order from the sales order
    V45E0002            Data transfer in procurement elements (PRreq., assembly)
    V45L0001            SD component supplier processing (customer enhancements)
    V45P0001            SD customer function for cross-company code sales
    V45S0001            Update sales document from configuration
    V45S0003            MRP-relevance for incomplete configuration
    V45S0004            Effectivity type in sales order
    V45W0001            SD Service Management: Forward Contract Data to Item
    V46H0001            SD Customer functions for resource-related billing
    V60F0001            SD Billing plan (customer enhancement) diff. to billing plan
    SDAPO001            Activating Sourcing Subitem Quantity Propagation
    Reward points if this helps.
    Manish

  • I do not obtain to change value in price conditions bapi CHANGE_SALES_ORDER

    Hi all,  
    We are developing a new solution using this RFC to maintain Sales Orders from the Legacy System.
    In some situations, it will be necessary to change values of the Item Price Conditions in Sales Orders already created, in order to attend a Legacy Systems requests.
    We tried to use the follow keys, but without a good result:
    IX_KONVKOMX-UPDKZ = D (Delete) - Doesn't works
    IX_KONVKOMX-UPDKZ = U (Update) - Insert a new line in Pricing
    IX_KONVKOMX-UPDKZ = I (Insert) - Works as U (Update)
    Could you please clarify why the key "U" doesn't works as Update and
    if there is any way to make this kind of modification?
    I verified you vary answers in this forum, but none was useful.
    Thanks a lot

    example:-
    *& Report  ZSALESORDER_CHANGE
    REPORT  ZSALESORDER_CHANGE MESSAGE-ID 38.
    Selection Screen Definitions *
    PARAMETERS: p_vbeln TYPE vbap-vbeln OBLIGATORY, "Order Number
    p_posnr TYPE vbap-posnr OBLIGATORY, "Order Item
    p_etenr TYPE vbep-etenr OBLIGATORY, "Schedule Line
    p_reqqty TYPE bapischdl-req_qty OBLIGATORY. " Order Qty
    Internal Tables/Structures/Variables for calling BAPI. *
    DATA: i_hdr TYPE bapisdh1,
    i_hdrx TYPE bapisdh1x,
    i_ret TYPE bapiret2 OCCURS 0 WITH HEADER LINE,
    wa_ret TYPE bapiret2.
    DATA: BEGIN OF i_sched OCCURS 10.
    INCLUDE STRUCTURE bapischdl.
    DATA: END OF i_sched.
    DATA: BEGIN OF i_schedx OCCURS 10.
    INCLUDE STRUCTURE bapischdlx.
    DATA: END OF i_schedx.
    START-OF-SELECTION Event *
    START-OF-SELECTION.
    *" Initialize internal tables.
    REFRESH: i_sched, i_schedx, i_ret.
    CLEAR: i_sched, i_schedx, i_ret.
    *" Fill required ORDER_HEADER_IN data.
    i_hdrx-updateflag = 'U'.
    *" Fill required SCHEDULE_LINES data.
    i_sched-itm_number = p_posnr.
    i_sched-sched_line = p_etenr.
    i_sched-req_qty = p_reqqty.
    i_schedx-updateflag = 'U'.
    i_schedx-itm_number = p_posnr.
    i_schedx-sched_line = p_etenr.
    i_schedx-req_qty = 'X'.
    APPEND i_sched.
    APPEND i_schedx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = p_vbeln
    order_header_in = i_hdr
    order_header_inx = i_hdrx
    TABLES
    return = i_ret
    schedule_lines = i_sched
    schedule_linesx = i_schedx.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    LOOP AT i_ret.
    WRITE / i_ret-message.
    ENDLOOP.

  • System resets the sales order item price changes after save in VA02.

    Hi All,
    We have implemented automatic credit control at sales order level.
    System is blocking the sales order once saved in VA01.
    But if I do any changes in prices at item level in VA02 and save before credit releasing the sales order then system agian reset to the original prices from pricing condition records.
    Can any body tell me why this is happening? I should able to change the sales order prices manually before releasing the sales order credit block. Is it possible?
    Regards,
    Kartheek.

    Like Lakshmipathi said, you should be able to change the prices in the order even if the order is under credit limit block.
    Please check the condition types which are being changed . In the condition type definition( T Code V/06) for the field Manual Changes - the value should be either "Manual entry has priority" or "....should allow to change manually...".
    Also in your pricing procedure ( T Code V/08) , against your pricing procedure , please select the value for pricing type as ..."copy manual conditions and redetermine others".
    Hope this helps
    Regards
    Sai

  • Setting Sales Order Item Price

    When adding an item to a Sales Order - No matter what I set the price of the item to - it is changed to the price on the price list for the Business Partner.
    Is there a workaround?
    SAPbobsCOM.Documents salesOrder = (SAPbobsCOM.Documents)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);
    salesOrder.GetByKey(Convert.ToInt32(asl.cmbSalesOrder.SelectedValue));
    salesOrder.Lines.Add();
    salesOrder.Lines.ItemCode = txtItemCode.Text;
    salesOrder.Lines.ItemDescription = txtItemDescription.Text;
    salesOrder.Lines.VatGroup = cmbVATCode.SelectedValue.ToString();
    salesOrder.Lines.Quantity = Convert.ToDouble(txtQuantity.Text);
    salesOrder.Lines.WarehouseCode = mbWarehouse.SelectedValue.ToString();
    if (cmbProject.SelectedValue.ToString() != String.Empty)
         salesOrder.Lines.ProjectCode = asl.cmbProject.SelectedValue.ToString();
    if (GLAccountCode != String.Empty)
         salesOrder.Lines.COGSAccountCode = GLAccountCode;
         salesOrder.Lines.AccountCode = GLAccountCode;
    salesOrder.Lines.CostingCode = cmbProfitCentre.SelectedValue.ToString();
    salesOrder.Lines.COGSCostingCode = cmbCostCentre.SelectedValue.ToString();
    *salesOrder.Lines.Price = Convert.ToDouble(txtPrice.Text);*
    // ** Free Of Charge Item
    if (freeOfCharge == true)
         salesOrder.Lines.LineTotal = 0;
    if (salesOrder.Update() != 0)
         ErrorForm.ShowError(this, company.GetLastErrorDescription());
    else
         LoadJobDetail();

    Use the other price fields (like 'unit price').
    The field 'price' is a calculated field and is ignored when you set it.

  • Change sales order item price even if it is partially delivered and billed

    Dear All,
    I have make to order scenario in the industry where the material prices fluctuates a lot.
    In make to order scenario, we sometimes gives the partial delivery to the customer. And once this takes place, the pricing of such items is gred out in sales order.
    As the material prices fluctuates during downward flow, we need to somehow change the sales order price for that item as customer will pay the price according to current date which is less than the price in the sales order during first partial delivery quantity. But as piricing is gred out we no longer change the sales order price.
    The major issue we are facing of credit management as it is getting credit block and we are no longer to proceed further. So kindly request to provide work around for this issue.
    Regards
    Sagar

    Hello Lakshmi,
    Currently we are stuck at PGI due to credit management activation such that if credit limit is exceeded then system will not allow to do PGI thus VTFL wont be useful.
    Also in such instance we are everytime changing the credit limit for such customer and once PGI and billing is done we again set the credit limit to appropriate value, which is not good workaround for end user.
    Please provide good solution if possible.
    Regards
    Sagar

  • URGENT: Help to Change Ordered Items

    I'd just made an online order (Order No: W224606857) but want to change items that I ordered. 
    However, I can't find the order record that I made yesterday by login the Apple ID. 
    I just can check the order status login by order no and the email....how can I do?

    You can't modify online orders. Just cancel your current order and reorder.   
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101

  • Sales item price condition pricing date from contract

    Hi SAP Gurus,
    I have requirement as following.
    When we create a sales order if any contract is available it should be populated in a diaglog box, and when user select a one , we keep this as a z-field in the sales order header level, so far fine.
      And the requirement includes the pricing date for one of pricing condition should be the first delivery date(schedulelinedate).
      We have the condition records with the pricing date as document date, we cannt keep commited delivery date as pricingdate(komv-kdatu).
       So i need a solution, thru i can modify the KOMV-KDATU
    for the condition type,with the first schedule line date.
       could anybody knows how to modify the KOMV structure values?????
      The quick answer will be highly apreciated?
    Thanks & Regards,
    Praveen

    Were you able to resolve. I'm running into the same problem

  • ME22N change Exchange rate type at price condition level

    Hello,
    In ME22N exchange rate type is 'M' by default. When a price condition has currency different than purchase order this 'M' rate is used.
    Now I need to change this 'M' rate but for particular price conditions (and exchange rate type can be different for each price condition). Don't ask me why:-) This requirement comes from business consultant and he knows that there is no user exit for this. I need to modify standard. The problem concerns items price conditions.
    I'm not asking you for a complete solution, but maybe you can give me a hint where to start? What is the function module which perform price calculation (where exchange rate is used) in ME22N.
    I tried to change KOMK-KURST in price condition rule (the procedure which is called to check if price condition has to be calculated or not). It is called for each price condition and I know a name of price condition. But I think the exchange rate type is read at the beginning and stays unchanged even I changed KURST.
    I also found function module READ_EXCHANGE_RATE, which has rate type 'M' by default. I could put my modification in place where it is called. But it is not called when I press button Update price. It is only called when I change the currency of condition and press enter. This FM is called in few places in ME22N but not when I'm refreshing prices. Maybe during a refresh it has already an exchange rate? If so, READ_EXCHANGE_RATE could be a solution, but... It is not called when price conditions are created for the very first time (when I create PO item). Maybe system calls different FM?
    I also tried to use trace (ST05) to see where systems reads from TCURR, but I think some buffers are used and TCURR is not in trace.
    So now I'm stuck hoping for your help.
    Best regards
    Rafal

    Prabhu Peram wrote:
    Hello Rafal ,
    >
    > still im trying to understand your requirements , anyhow if you change/propose new exchange rate at header level , then system wont put type as 'M'.
    >
    The problem is that if I set a new exchange rate type, it will be the same for all price conditions. My requirement is to have different exchange rate type for each price condition. The pricing procedure will loop at each price condition, and depending on condition name I need to have different exchange rate type.
    Example:
    condition XMER is in EUR and must be converted to USD (factor should be 1,234)
    condition XMET is in EUR and must be converted to USD (factor should be 1,567)
    Now the factor is the same for all price conditions.
    I have found interesting table XKOMV. It contains price conditions and there is a field with factor value. Now I will look for the place where this table is filled with data or for the place where I can modify factor values before XKOMV is used in pricing procedure.
    Best regards
    Rafal

  • Sales order - net price value - what table

    In what table is stored the Net Price Value (Sales order item level, Conditions tab, column Amount, name Net price Value ( structure KOMV-KBETR)
    Thanks.

    Hello,
    You have to check KONV with Condition record no = VBAK-KNUMV.
    Then match the line item number with KONV-KPOSN to get all the price conditions for each item (Note KINAK = space will get only active price conditions)
    If you need the total sum of amount for all line items then you can check VBAP-NETWR.
    Hope this helps,
    Regards
    Shiva

  • Create/Update of Price conditions - PR00

    Hi folks
    I hope U know the right Function Module. Normally we use
    transaction MM02 to insert/update price conditions via view
    "Sales: Sales Org. Data 1". Here we push the button "Conditions
    and have the posability to enter/change the PR00 price condition.
    So far so good.
    But which Function Module do I have to use if want to do the same from within a background ABAP program??
    Maybe BAPI_MATERIAL_SAVEDATA?? And how to?
    Best regards
    and have a nice weekend
    Carsten :o)

    Hi there,
    check thist thread.
    BAPI_PRICES_CONDITIONS
    Kind regards,
    J.

  • Changing Price Conditions in Sales Order with SD_SALESDOCUMENT_CHANGE

    Hello there!
    I need to change the value of a price condition in a sale order ;I'm using the f.m.  SD_SALESDOCUMENT_CHANGE.
    It doesnt' work as I want, 'cause it creates an other price conditions instead of just changing the price value of the actual one.
    Waiting for your tips,
    thanks.
    This is how my code looks like:
    PARAMETER: p_vbeln LIKE vbak-vbeln.
    data: st_order_header_inx   TYPE  bapisdhd1x,
            st_conditions LIKE bapicond,
            st_conditionsx LIKE bapicondx,
            tb_conditions TYPE TABLE OF bapicond,
            tb_conditionsx TYPE TABLE OF bapicondx,
            tb_return TYPE TABLE  OF  bapiret2.
    st_order_header_inx-updateflag = 'U'.
      st_conditions-itm_number = '0010'.
      st_conditions-cond_type = 'PR00'.
      st_conditions-cond_updat = 'X'.
      st_conditions-cond_value = '100'. "Value I want to enter
      APPEND st_conditions TO tb_conditions.
    st_conditionsx-itm_number = '0010'.
      st_conditionsx-cond_type = 'PR00'.
      st_conditionsx-updateflag = 'U'.
      st_conditionsx-cond_value = 'X'.
      APPEND ls_conditionsx TO tb_conditionsx.
    CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'
        EXPORTING
        salesdocument                = p_vbeln
          order_header_inx          = st_order_header_inx
        TABLES
          return                           = tb_return
          conditions_in               = tb_conditions
          conditions_inx              = tb_conditionsx  .

    Get the conditions records first from the Sales Order with BAPI BAPISDORDER_GETDETAILEDLIST
    CALL FUNCTION 'BAPISDORDER_GETDETAILEDLIST'
      EXPORTING
        i_bapi_view          = lw_bapi_view
      TABLES
        sales_documents      = lt_order
        order_conditions_out = lt_conditions_out.
    Then populate the conditions internal table with the data that you get from the previous code
    move-corresponding lw_conditions_out to lw_order_conditions_in.
    lw_order_conditions_in-cond_value = '100'   " the value that you want to modify
    APPEND lw_order_conditions_in TO lt_order_conditions_in.
    CLEAR lw_order_conditions_inx.
    lw_order_conditions_inx-itm_number = lv_kposn.
    lw_order_conditions_inx-cond_st_no = lw_conditions_out-cond_st_no.
    lw_order_conditions_inx-cond_count = lw_conditions_out-cond_count.
    lw_order_conditions_inx-cond_type  = lw_conditions_out-cond_type.
    lw_order_conditions_inx-updateflag = 'U'.
    lw_order_conditions_inx-cond_value = lc_x.
    APPEND lw_order_conditions_inx TO lt_order_conditions_inx.
    You didn't populate the fields cond_st_no and -cond_count. Then just call BAPI SD_SALESDOCUMENT_CHANGE to change the Sales order.
    Hope that helps.
    Erwin

  • Change the Purchase Order : Item - Conditions value

    Hi,
    How to change the Purchase Order : Item - Conditions value.
    In my PO, Item conditions shows the SKTO - Cash Discount value is 0. I want to change the Discount value 10.
    How can i change it??

    Hi,
    Goto the Transaction code MN05 and give the CONDITION TYPE SKTO and change the value
    MN05 is the Transaction code for Purchase order  condition types.
    Please check and revert back if you need more details.
    regards,
    santosh

  • ABAP: How to add a Price Condition Item to an order item

    Hi experts,
       Is it possible to add a Price Condition Item to an order item by BAPI or Function in sap crm? (like: 0k04 10 USD 1 EA)

    Hi,
    You need to use CRM_ORDER_MAINTAIN and have to use structure IT_PRIDOC to update or add new pricing data.
    But do remember, you have to call FM 'BAPI_TRANSACTION_COMMIT' once you are done with call to FM CRM_ORDER_MAINTAIN, else all your updation will remain in buffer and will have no effect in Database, which will let u feel as if things are not working they should be.
    Best Regards,
    Pratik Patel
    <b>Reward with Points!</b>

  • When material price changed (sd item conditions)

    Hi all,
    when material price changed in the time that is used in an sd order and when this order's delivery has been created..
    the order's item's material's price has been changed before invoice printed(assume item as 10 and material assume as 600300)
    i need to update that order with the new price of the material.
    Even this can be done backward. I mean you may have an order that amount is 100,000(with different item no's) and send this at 20 times and may print 20 different delivery for this order. And order can be on January and you still send the janu's order at May. Whenever you send the delivery you have to update the respective item's price not others.
    All in all i want to update the order's price item by item...
    please write any way to solve this.
    Thanks..

    Hi,
    it does not matter if the BADI is already implemented. You can add your additional logic there. If you put break points in all methods of BADI implementation and run ME2xN then you will see when is each method called. You are right that here is no BADI method SET_DATA. What I meant is that you get a reference to PO item (type IF_PURCHASE_ORDER_ITEM_MM) in BADI method PROCESS_ITEM. This interface has to methods GET_DATA and SET_DATA. Using these methods you can get current item fields and change them according to your needs.
    Cheers

Maybe you are looking for