Delete a Condition from item of particular sales order.

I tried BAPI_SALESORDER_CHANGE
and passed the following code. But instead of deleting it updates the condition even though update flag is kept to D.
            move:     'x' to y_wa_condx-cond_type,
                        y_wa_konv-kschl to y_wa_cond-cond_type,
                       y_wa_konv-kbetr to y_wa_cond-cond_value,
                       'x' to y_wa_cond-cond_value.
            move 'D' to y_wa_condx-updateflag.
            append y_wa_cond to y_i_cond.
            append y_wa_condx to y_i_condx.
Any other FM can be used for deleting a condition?

<u>This</u> is the right FM for deleting conditions.
But u should not put 'x' to y_wa_condx-cond_type but the same value as for y_wa_cond-cond_type. See this thread for a sample code:
Re-Pricing in SALES ORDER using BAPI
regards

Similar Messages

  • Item condition for only one particular sales order type, manual condition.

    Hi Gurus
    We have one condition ZXXX, item condition and it should process manually for one particular order type, ZOR. it should not process for other document types like ZOR1 etc.
    i did create condition table with S.org/dis chn/div/ sales.doc type. and kept in access seq. and same in condition type ZXXX. and mainatined condition record as with sales area and doc type ZOR.
    condition type settings ate like item condition and manaula entries - no limitation.
    in pricing procedure i didnt checked manaul, mandoatry and statistic.
    but whn iam craeting in ZOR1 and giving manually condition ZXXX, its accepting but as per our condition record it should get only for ZOR... where iam missing the seeting, please suggest.
    Thanks
    Ramki

    Hi Ram,
    In my point of view i think so you have to create the new document pricing procedure.
    after creating that you have maintain new item catergory determination procedure using the new document pricing procedure created before.
    assign this document pricing procedure to your ZOR document type.
    now create new pricing procedure by copying the standard one.
    after that do the assigning procedure for the pricing procedure by using the new document pricing procedure.
    then try to create the order with ZOR and also with ZOR1
    Make sure that your condition type is not assign to any other pricing procedure.
    if it happens then let me know also.
    Suneet Prakash

  • Send all line items of a sales order to IPC along with condition lines data

    We wrote some pricing routines in R/3, where while doing he calculations for condition line item, we needed to pull in the material information for previous line items. So we exported vbap and imported it inside the routine to be able to have access to all the line items in the sales order. Now, we need to put in the same kind of logic in CRM/IPC. My question is what would be the equivalent of SAP's(import/export) commands for internal tables in case of IPC. I looked at the BADI CRM_COND_COM_BADI but still do not see how I can send all the line items  data to IPC. So I guess, the question comes down to, how do I send all the line items of the sales order (whole VBAP in R/3 terms) to IPC along with the condition line data? Can someone please help?
    Thanks

    Hi Vaibhav,
    If you can get the list of Sales orders which has deleted line items and force completion status. You can manage them in BI via lookup  or navigation attribute.
    Just my views I am sharing .
    Thanks,
    KDJ

  • Delete Multiple Records from Item Master

    Hi,
    We received wrong master data which has been uploaded and two groups have to be deleted. All the items in those particular groups have also to be deleted. Can anyone suggest how to delete multiple records from Item Master?
    Currently I am navigating through each Item and doing a Right Click + Remove. It is very painful given the huge number of records.
    Regards
    Sudatt

    Hi Sudatt.....
    I recommend you not to run any kind of delete or update SQL query as it harms DB.
    You can create your own front end application with the help of any technical consultant which can be
    achieved very easily. Else such problems create a big problem during upgradation to next version.......
    Regards,
    Rahul

  • BAPI:Create sales order from an existing open sales order for open items

    Dear All,
    Could any one suggest me any BAPI that can create sales order from an existing OPEN sales order for OPEN items. since we are closing all open orders and creating new orders with reference to existing open orders.   please suggest, its would be great help.
    Regards,
    Reddy

    hi suresh,
    we are changing tax procedure from formula to condition based, so this is the reason we have close all the open orders and recreate in TAXINN procedure, it is going to be large number of records( open orders), so....
    Regards,
    Reddy

  • Particular sales order of the same line item hv created multiple production

    sir,
    I am having a problem in MD04. A particular sales order of the same line item hv created multiple production order.and continously planning is going on... I didn't get why it happens.
    Will u please suggest me what should i do in this case?
    Regards
    Meenu

    Hello sir,
    yes, ofcourse, for the finished material have the BOM with some semifinished productes which are to be produced .
    In co02 , we can go through the collective production order.
    One more thing is that, in the multiple production order date(scheduling date) shows in forward(future dates).
    For ex:09-05-2010.
    Regards
    Meenu

  • Simple credit check - value need to be blocked from particular sales order to be post in f.35

    Dear Expert,
    I have a case here to find, the client uses simple credit check , we have different order types ( Example 6 order types), out of which we want to restrict the value of one order type to be posted in f.35 i.e the value should not effect credit limit used or open sales order.
    Is there any standard procedure by which this can be done or do we have to use userexit.
    Also can i know in which screen do we have to keep the userexits so that the value of the order type will not have impact on the f.35 or crdit limit used.
    Regards
    Abhishek Ojha

    Sorry small correction to my initial post.
    Even though you removed the credit group for the respective sales order type still system update the values subject to if the respective item category the "field credit active" active.
    Removing the credit group to sales order type controls whether you want to perform the credit check or not. And your requirement is not to update the particular sales order document values in FD32  so the actual control is credit active field for that particular item category.
    Since you have mentioned that you don't want to update that particular sales order document values( assuming that you are taking about receivable only).
    Please note sales order determines the item category,  so do as below.
    De select( un check) the credit active field in the item category which is determined based on the sales order type for  which you don't want to update credit values.
    Please test and update here.So far I did not check this in my system.
    thanks,
    Srinu.

  • Delivery doc creation for a selected line item of the Sales order

    Hi folks,
        Can any one help me in how to create a delivery order for a selected line item of the Sales order.My requirement is the request comes from the web browser where a sales document and details of the items are shown the user select one line item and request for delivery create of that particular SO doc.I have used couple of FM to create delivery but the delivery create is depend on the schedule line dates so iam unable to figure out where exactly i can distinguish between the line items.
    Example:
    SO:- 11193645
    Line item -1 has 2 schedule line 06/11
                                     06/13
    Line iteam-2 has 1 schedule line 06/12
    so if i try to create Delivery doc for date 06/12
    it creates partially for line 1 and line 2.
    but my requirement is i wanted to create SO for only line item 1 as i wanted to process Del Doc for only line item 1.
    If you have any idea please help me.

    hi ,
    You can develop a customised FM to process the Idoc data .
    1. Read the Idoc data into internal table for the line items which need to be delivered .
    2. Run BDC for transaction 'VL01N' ( delivery creation ) through which  eliminate the line items which are not in internal table and save the delivery document
    Note : Because in VL01N , you specify the sales document with respect to which you want to perform delivery hence automatically all items are copied to the delivery document .
    During BDC recording , select items by " MOVING TO TOP"
    and then deleting the selected item
    If you face problem in BDC recording , i can help u that too .

  • Purchase items report for sales orders - very important

    Hi Folks,
    Could you please guide me on how to create a report of "items purchased" for a particular "sales order". if i am able to include various fields of items purchased, like....quantity, item description, vendor name, item price, etc., it will be very useful.
    This report is required for a client, who assembles machines in a "make to order" scenario, and most of the BOM child items are "purchase items".

    Hello Krishna,
    Few things to note:
    Is the PO created from the SO.  Is YES, then you could use the base document ref at the POR1 table.
    OR
    Are the BOM components defined with a default vendor in the Item Master and if YES are the components always purchased from the same vendor.
    I am trying to see how to establish the relationship of the items between the PO and SO.
    Please give me the details and I could guide you further
    Thanks
    Suda

  • Condition type not determine in sales order

    I have condition record maintained for the condition type as per the order reason. When I create the sales order system is not reading the condition record so no condition type is getting determined. Pricing date from the sales order is within the validity period of condition record.Parmeters are also matching but still in the sales order condition type is not getting determine.
    Thanx
    PNU

    In that case, do update of pricing.
    To do that, Sales Order - Item data - Condition Tab - Click Update button and choose option B - Carry out new pricing.
    To know who manually remove this.
    Choose Enviroment from menu bar in sales order - choose Change for display of change in the doc.
    Regards
    JP

  • Different departure country per item in a sales order

    Hi all,
    I have a tricky issue.
    We need to set a different departure country on each item of a sales order.
    Departure country is one of the key elements used by SAP to find the right tax condition record. Usually you have either to type a country in header tab (in field "tax departure country") or specify a plant set in the departure country at item level.
    We use non-stocked materials to represent "services": they are in a plant, but we can't build a plant for each country involved.
    The solution we are considering : using a user-exit to specifiy the departure country (stemming for example from the country of the shipping partner) on each item of the order (not forgetting the customer tax classification). We can thus have several departure country on a single order.
    What do you think (better ideas ?) ? Which user-exit would be best ? We are thinking of subroutine USEREXIT_PRICING_PREPARE_TKOMK, but we are not sure this is the best.
    Any solution or alternative to all this is welcome.
    Thanks a lot in advance !
    Nicolas JOSEPH-CHARLES
    On behalf of Jean-Charles CHAGUE

    Go ahead and do it in there.
    I added the codes in there too.

  • How can we revise the pricing both at header and item level of sales order?

    Dear All,
      Now there's one issue of the pricing to me. i want to revise the pricing both at header and item level of sales order. but after i finished the cutomize and tested it, it's more different as i thought. i found that the pricing can revise at the one side only,for example, if i revise the pricing at item level and it's grey and can't be revised at the header. on the other hand, it's the same result what's happened at item.
      So, in my opinion, we can't revise the pricing both at header and item, right? if not, please give me more advices and teach me how to solve the problem. thanks a lot.

    Dear Lakshmipathi,
      Thanks a lot for your kindly and useful answer for me and I learn more for the pricing technology.
      I didn't notice the way that you reminded ago therefore I also saw the button at the condition tab. And your suggestion makes me know more.
      And I had tested the way that you said, I met with a question. Below is my opinion for my testing.
      I had created one SO and the pricing was $10, then I revised the pricing from 10 to 15 by VK11. It can't be updated automatically at SO and I must update it manually by clicking the "Update" button. This is OK for my testing, but I have another question to disturb you for the use of "Active" button. When I click the button and nothing is responsed, it's quite different what you said. So, please give more detail for the Active button. Thanks a lot.

  • Pending line item data in sales order

    Dear all,
    I get the pending sales order from VBUK but how i get the pending item details for that particular sales order. In VBAP all line items are displayed but i want only pending line items. Please help me if u know the answer.
    Thnks
    Puneet

    Thanks for your immediate help. Please tell me which field shows that this sales order no.'s line item  is pending or completed.  and also how i come to know about partial order delivered for particular line item.
    Regards
    Puneet

  • How to control Changing of item category in sales order Manually

    Hello Gurus,
    How to restrict manual changing of item category in sales order?
    Reason for it:
    When ever they want to give some free goods to customer , they are changing Item category in  Standard Sales order at item level  then deliverying free goods to  customer
    looking for your inputs
    Thanks in advance
    Regards
    Venkat

    Hello,
    There are two possible ways:
    1. In Item Caterogy Determination remove the Manual Item Categories so that system will determine the Item Category only from defined options.
    2. Use T-SHDO - create Screen Variant & make the item Category Feild as Display only.
    Hope this helps..
    Thanks,
    Jignesh Mehta

  • Production Order and Internal Order for each item of the sales order

    Hi
       I am developing Make To Order Report where I have to display the MTO Line Items and non MTO Line Items. For non MTO Line Items I have to display Internal order with Planned and Actual Costs and also Production Order with Planned and Actual Costs. Could anybody tell how to get the Internal order no and production order with Planned and Actual costs for each line item for a sales order.
    Thanks
    Naga

    Hi,
    You can get the Production orders, Planned orders, Internal orders generated for Sales order item from AFPO table (use fields KDAUF-Sales order number & KDPOS-Sales order item). Then to identify the order type use order category (AUTYP) from table AUFK.
    Once you have the Production/internal order, you can ge the cost from COSS and COSP table. Use the object number from AUFK to get the cost entries from COSS & COSP.
    You can use the following sample code as reference.
    Hope this is helps.. (Don't forget to mark it... )
    Form GET_COSTS                                                       *
    Get the material cost, labour hours and the labour cost for the      *
    sales order material.                                                *
    There are no interface parameters to be passed to this subroutine.   *
    FORM GET_COSTS.
      DATA V_OBJNR LIKE AUFK-OBJNR.
    DATA v_menge LIKE vbap-kwmeng.
      SELECT SINGLE OBJNR
        INTO V_OBJNR
        FROM AUFK
       WHERE AUFNR EQ AFPO-AUFNR.
      SELECT * FROM COSS
       WHERE OBJNR EQ V_OBJNR
         AND WRTTP IN ('01', '04'). " p_wrttp. "Labour Cost ( Plan, Actual)
        PERFORM GET_VALUES_FROM_COSS.
      ENDSELECT.
      SELECT * FROM COSP
       WHERE OBJNR EQ V_OBJNR
         AND WRTTP IN ('01', '04')         " p_wrttp
         AND KSTAR NE '0000510033'. " EQ p_kstar2.      "Material Cost
        PERFORM GET_VALUE_FROM_COSP.
      ENDSELECT.
    Get the unit cost of the production order by dividing the production
    cost by the order quantity. The result will be multiplied by the
    GL posting qunatity (Delivery quantity) to get the production cost
    for the quantity being deluivered.
      IF NOT AFPO-PSMNG IS INITIAL.
        OUT_REC-LABOUR_HOURS_ACT = OUT_REC-LABOUR_HOURS_ACT / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_HOURS_ACT =
                          OUT_REC-ADDNL_LABOUR_HOURS_ACT / AFPO-PSMNG.
        OUT_REC-LABOUR_HOURS_PLN = OUT_REC-LABOUR_HOURS_PLN / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_HOURS_PLN =
                         OUT_REC-ADDNL_LABOUR_HOURS_PLN / AFPO-PSMNG.
        OUT_REC-LABOUR_COST_ACT = OUT_REC-LABOUR_COST_ACT / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_COST_ACT =
                         OUT_REC-ADDNL_LABOUR_COST_ACT / AFPO-PSMNG.
        OUT_REC-LABOUR_COST_PLN = OUT_REC-LABOUR_COST_PLN / AFPO-PSMNG.
        OUT_REC-ADDNL_LABOUR_COST_PLN =
                         OUT_REC-ADDNL_LABOUR_COST_PLN / AFPO-PSMNG.
        OUT_REC-MATERIAL_COST_ACT = OUT_REC-MATERIAL_COST_ACT / AFPO-PSMNG.
        OUT_REC-ADDNL_MATERIAL_COST_ACT =
                         OUT_REC-ADDNL_MATERIAL_COST_ACT / AFPO-PSMNG.
        OUT_REC-MATERIAL_COST_PLN = OUT_REC-MATERIAL_COST_PLN / AFPO-PSMNG.
        OUT_REC-ADDNL_MATERIAL_COST_PLN =
                         OUT_REC-ADDNL_MATERIAL_COST_PLN / AFPO-PSMNG.
      ENDIF.
    Multiply the calculated Unit Production costs with the GL quantity to
    get the actual production cost of the quantity delivered.
    Calculation for Labour Hours
      OUT_REC-LABOUR_HOURS_ACT = OUT_REC-LABOUR_HOURS_ACT *
                                 OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_HOURS_ACT = OUT_REC-ADDNL_LABOUR_HOURS_ACT *
                                 OUT_REC-QUANTITY.
      OUT_REC-LABOUR_HOURS_PLN = OUT_REC-LABOUR_HOURS_PLN *
                                 OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_HOURS_PLN = OUT_REC-ADDNL_LABOUR_HOURS_PLN *
                                 OUT_REC-QUANTITY.
    Calculation for Material Cost
      OUT_REC-MATERIAL_COST_ACT = OUT_REC-MATERIAL_COST_ACT *
                                  OUT_REC-QUANTITY.
      OUT_REC-ADDNL_MATERIAL_COST_ACT =
          OUT_REC-ADDNL_MATERIAL_COST_ACT * OUT_REC-QUANTITY.
      OUT_REC-MATERIAL_COST_PLN = OUT_REC-MATERIAL_COST_PLN *
                                  OUT_REC-QUANTITY.
      OUT_REC-ADDNL_MATERIAL_COST_PLN =
          OUT_REC-ADDNL_MATERIAL_COST_PLN * OUT_REC-QUANTITY.
    Calculation for Labour cost
      OUT_REC-LABOUR_COST_ACT   = OUT_REC-LABOUR_COST_ACT *
                                   OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_COST_ACT = OUT_REC-ADDNL_LABOUR_COST_ACT *
                                  OUT_REC-QUANTITY.
      OUT_REC-LABOUR_COST_PLN   = OUT_REC-LABOUR_COST_PLN *
                                  OUT_REC-QUANTITY.
      OUT_REC-ADDNL_LABOUR_COST_PLN = OUT_REC-ADDNL_LABOUR_COST_PLN *
                                  OUT_REC-QUANTITY.
    Get the planned material cost from the total of the planned cost of
    the component materials in the production order confirmations.
      SELECT BWART MENGE MATNR SHKZG FROM AUFM
        INTO (AUFM-BWART, AUFM-MENGE, AUFM-MATNR, AUFM-SHKZG)
       WHERE AUFNR EQ AFPO-AUFNR.
        CHECK AUFM-BWART NE '101'.
        READ TABLE I_MBEW WITH KEY MATNR = AUFM-MATNR
                                   BWKEY = AFPO-DWERK.
        IF SY-SUBRC NE 0.
          SELECT MATNR BWKEY ZPLPR LPLPR PEINH
            FROM MBEW
            INTO I_MBEW
           WHERE MATNR EQ AUFM-MATNR
             AND BWKEY EQ AFPO-DWERK.
            APPEND I_MBEW.
          ENDSELECT.
        ENDIF.
        IF SY-SUBRC EQ 0.
          IF I_MBEW-ZPLPR NE 0.
            IF AUFM-SHKZG EQ 'H'.
              OUT_REC-PLANNED_MATERIAL_COST =
              OUT_REC-PLANNED_MATERIAL_COST +
                           ( I_MBEW-ZPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ELSE.
              OUT_REC-PLANNED_MATERIAL_COST =
              OUT_REC-PLANNED_MATERIAL_COST -
                           ( I_MBEW-ZPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ENDIF.
          ELSEIF I_MBEW-LPLPR NE 0.
            IF AUFM-SHKZG EQ 'H'.
              OUT_REC-CURRENT_MATERIAL_COST =
              OUT_REC-CURRENT_MATERIAL_COST +
                           ( I_MBEW-LPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ELSE.
              OUT_REC-CURRENT_MATERIAL_COST =
              OUT_REC-CURRENT_MATERIAL_COST -
                           ( I_MBEW-LPLPR * AUFM-MENGE / I_MBEW-PEINH ).
            ENDIF.
          ENDIF.
        ENDIF.
      ENDSELECT.
    Get the Future material cost per Unit by deviding the calculated
    Future material cost above with the goods reciept quantity to, then
    multiply the unit cost with the GL quantity to get the Future material
    Cost for the Quantity delivered. (Quantity in the entery from GLPCA
    Table).
      IF NOT AFPO-WEMNG IS INITIAL.
        OUT_REC-PLANNED_MATERIAL_COST =
           OUT_REC-PLANNED_MATERIAL_COST / AFPO-WEMNG * OUT_REC-QUANTITY.
        OUT_REC-CURRENT_MATERIAL_COST =
           OUT_REC-CURRENT_MATERIAL_COST / AFPO-WEMNG * OUT_REC-QUANTITY.
      ENDIF.
    ENDFORM.                               " GET_COSTS
    Form GET_VALUE_FROM_COSP                                             *
    Get the Material cost from COSP table.                               *
    There are no interface parameters to be passed to this subroutine.   *
    FORM GET_VALUE_FROM_COSP.
      FIELD-SYMBOLS: <FS> TYPE ANY.
      DATA: V_COMPONENT TYPE I.
    Cummulate the posting values of all the 16 period buckets as to get
    total production order cost. This is to handle the aprtial posting of
    prodction order values in diffrent periods.
      V_COMPONENT = 15.
      DO 16 TIMES.
        ADD 1 TO V_COMPONENT.
        ASSIGN COMPONENT V_COMPONENT OF STRUCTURE COSP TO <FS>.
        IF COSP-WRTTP EQ '04' AND COSP-KSTAR EQ P_KSTAR2.
          ADD <FS> TO OUT_REC-MATERIAL_COST_ACT.
        ELSEIF COSP-WRTTP EQ '04'.
          ADD <FS> TO OUT_REC-ADDNL_MATERIAL_COST_ACT.
        ELSEIF COSP-WRTTP EQ '01' AND COSP-KSTAR EQ P_KSTAR2.
          ADD <FS> TO OUT_REC-MATERIAL_COST_PLN.
        ELSEIF COSP-WRTTP EQ '01'.
          ADD <FS> TO OUT_REC-ADDNL_MATERIAL_COST_PLN.
        ENDIF.
      ENDDO.
    ENDFORM.                               " GET_VALUE_FROM_COSP
    Form GET_VALUES_FROM_COSS                                            *
    Get the Labour cost and Labour hours from the COSS table.            *
    There are no interface parameters to be passed to this subroutine.   *
    FORM GET_VALUES_FROM_COSS.
      FIELD-SYMBOLS: <FS1> TYPE ANY,
                     <FS2> TYPE ANY.
      DATA: V_COMPONENT1 TYPE I,
            V_COMPONENT2 TYPE I.
    Cummulate the posting values of all the 16 period buckets as to get
    total production order cost. This is to handle the aprtial posting of
    prodction order values in diffrent periods.
      V_COMPONENT1 = 15.
      V_COMPONENT2 = 111.
      DO 16 TIMES.
        ADD 1 TO: V_COMPONENT1, V_COMPONENT2.
        ASSIGN COMPONENT V_COMPONENT1 OF STRUCTURE COSS TO <FS1>.
        ASSIGN COMPONENT V_COMPONENT2 OF STRUCTURE COSS TO <FS2>.
        IF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ P_KSTAR1.
          ADD <FS1> TO OUT_REC-LABOUR_COST_ACT.
          ADD <FS2> TO OUT_REC-LABOUR_HOURS_ACT.
        ELSEIF COSS-WRTTP EQ '04'.
          ADD <FS1> TO OUT_REC-ADDNL_LABOUR_COST_ACT.
          ADD <FS2> TO OUT_REC-ADDNL_LABOUR_HOURS_ACT.
        ELSEIF COSS-WRTTP EQ '01' AND COSS-KSTAR EQ P_KSTAR1.
          ADD <FS1> TO OUT_REC-LABOUR_COST_PLN.
          ADD <FS2> TO OUT_REC-LABOUR_HOURS_PLN.
        ELSEIF COSS-WRTTP EQ '01'.
          ADD <FS1> TO OUT_REC-ADDNL_LABOUR_COST_PLN.
          ADD <FS2> TO OUT_REC-ADDNL_LABOUR_HOURS_PLN.
        ENDIF.
      ENDDO.
    ENDFORM.                               " GET_VALUES_FROM_COSS

Maybe you are looking for