Delete pricing conditions line using BAPI_SALESORDER_CHANGE

Hi experts.
I've read the forum and OSS about this topic and don't have clear if it's possible to delete a price condition position (using BAPI). Using tx. VA02 I can delete pricing conditions, that's why I think should be possible.
We have a sales order created, and depending on the sold-to-party we have some discounts: RA00 (% discount) or RB00 (absolute discounts).
In some cases we need to insert/update or delete these pricing conditions. For insert/update, we don't have any problem using
BAPI_SALESORDER_CHANGE and setting the appropiate updateflag.
But... what would be the procedure to delete a discount, for example, RA00 fixed on a sales order? Has the logic_switch be informed specially?
        wa_cond-itm_number = lt_cond-itm_number.
        wa_cond-cond_type  = lt_cond-cond_type.
        APPEND wa_cond TO i_cond.
        wa_condx-itm_number = lt_cond-itm_number.
        wa_condx-cond_type  = lt_cond-cond_type.
        wa_condx-updateflag = 'D'.
        APPEND wa_condx TO i_condx.
Lots of thanks.
Javier

I am not positive on being able to delete a pricing condition through program.
Online when you try to change the pricing, SAP suggests us to redetermines the Pricing rather than just changing the values. And also the pricing condition config also plays a role... I think there was a setting which says Pricing condition to be manual which means you can add or delete the conditoin.

Similar Messages

  • How to migrate pricing condition data using lsmw

    Hello All,
                 can any one explain how to migrate pricing condition data using lsmw.
    the scenario is we are trying to extend the pricing conditions from one sales area to other sales area on a combination of sales organization, distribution channel and division.

    Hi Sreedhar Kodali
    Pricing conditions can be extended with the following options:-
    1)  Customer / material with release status
    2)  Sales Org / Dist. Channel / Cust group / Material
    3)  Price List category / Currency / material with release status
    4)  Material with release status
    Assuming that your pricing condition in one sales area is different to another, first you have to create LSMW recording to extend the sales area and then pricing conditions can be uploaded accordingly.
    Thanks
    G. Lakshmipathi

  • Deleting pricing conditions using FM /AFS/VBAK_SALESDOCUMENT_CHANGE

    Hi all,
    following the instructions in oss note 593246 I have succesfully implemented code to delete a discount condition from a sales order using FM /AFS/VBAK_SALESDOCUMENT_CHANGE. But now I also want to delete a condition from a sales order position which has an item which has the AFS 'price by size' characteristic (an item with a shirt for example,  with 10 pieces, which are divided in 3 smalls, 4 mediums and 3 large).
    Using the same code that was succesful earlier, it deletes the discount condition, but also all standard pricing conditions, making the pricing in the order invalid obviously.
    Has anyone else had this problem? And more importantly: has anyone found a way to do this succesfully?
    Thanks in advance
    Arjan

    update:
    setting the condition to value zero is possible I found... so at least I have that option. But deleting would be the tidy solution, so any help is still aprreciated.
    If there is anyone also struggleing with this AFS module and pricing, I can share the code I am using to update to zero or delete (when the material is not price by size-ed.

  • Delete pricing condition using FM crm_order_maintain

    Hi experts
    I need to delete an order pricing condition using the FM crm_order_maintain but i can't do it....
    somebody can help me with the code for do this?
    Thanks in advance
    Marco

    Do one thing,,,
    Go to CRMD_ORDER
    Open the transaction in change mode
    Go to the Pricing condition tab
    put /H in transaction code box
    delete the pricing condition manually from the transaction
    Put break point on CRM_ORDER_MAINTAIN function module...
    debugger will stop at the function module...
    check the data in all tables at this time and try to pass the same...it should work..

  • Delete Pricing Condition IN Sales Order

    Hello Forum,
    Does anyone know how to delete a specific pricing condition in a Sales Order.
    In a sales order for each line item there are multiple pricing conditions. I need to delete a specific price condition 'ZZZZ' for instance then how do I go about it?
    This is what I have been able to find out so far.
    1. Does NOT seem to be possible by BDC because there is no way to position the cursor on the particular condition record I require.
    2. Although there is BAPI_SALESORDER_CHANGE, SAP via an OSS note specifies that this BAPI CANNOT be used to delete  condition records.
    3. None of the PRICING function modules seems to work for deletion. I did find out a function module PRICING_DELETE_LINE but this seems to rely on being called via SAP Standard function.
    I have tried searching for some means to do this and I hope that someone on this forum can give me some help on the same.
    Regards,

    Hi Peter,
    Your reference to OSS Note 593246 saved me from hitting my head to the wall, I had almost given up. Thanks a lot.
    Here is the code, in case any one needs to add or change a condition type on the sales order.
    REPORT ytest.
    DATA:lt_conditions_in TYPE STANDARD TABLE OF bapicond,
         lt_conditions_inx TYPE STANDARD TABLE OF bapicondx,
         lt_return TYPE STANDARD TABLE OF bapiret2,
         ls_logic_switch TYPE bapisdls,
         ls_order_header_inx TYPE bapisdh1x,
         ls_conditions_in TYPE bapicond,
         ls_conditions_inx TYPE bapicondx.
    ls_order_header_inx-updateflag = 'U'.
    ls_logic_switch-cond_handl = 'X'.
    ls_conditions_in-itm_number = '000010'.
    ls_conditions_in-cond_type = 'PR00'.
    ls_conditions_in-cond_value = '21.11'.
    ls_conditions_in-currency = 'USD'.
    APPEND ls_conditions_in TO lt_conditions_in.
    ls_conditions_inx-itm_number = '000010'.
    ls_conditions_inx-cond_type = 'PR00'.
    ls_conditions_inx-updateflag = ' '.
    ls_conditions_inx-cond_value = 'X'.
    ls_conditions_inx-currency = 'X'.
    APPEND ls_conditions_inx TO lt_conditions_inx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
       salesdocument               = '0000053232'
      ORDER_HEADER_IN             =
       order_header_inx            = ls_order_header_inx
      SIMULATION                  =
      BEHAVE_WHEN_ERROR           = ' '
      INT_NUMBER_ASSIGNMENT       = ' '
       logic_switch                = ls_logic_switch
    TABLES
       return                      = lt_return
      ORDER_ITEM_IN               =
      ORDER_ITEM_INX              =
      PARTNERS                    =
      PARTNERCHANGES              =
      PARTNERADDRESSES            =
      ORDER_CFGS_REF              =
      ORDER_CFGS_INST             =
      ORDER_CFGS_PART_OF          =
      ORDER_CFGS_VALUE            =
      ORDER_CFGS_BLOB             =
      ORDER_CFGS_VK               =
      ORDER_CFGS_REFINST          =
      SCHEDULE_LINES              =
      SCHEDULE_LINESX             =
      ORDER_TEXT                  =
      ORDER_KEYS                  =
      conditions_in               =  lt_conditions_in
      conditions_inx              =  lt_conditions_inx
      EXTENSIONIN                 =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait          = 'X'
          IMPORTING
           return         =
    Regards
    Amit Maole

  • Mass delete pricing condition type

    Hi experts,
    I have a requirement to delete a pricing condition type e.g. ZA01 (manual input) which was entered twice by users to all sales orders not billed about 1000 and 3000 item lines. What is the best way to delete without incurring errors later during billing?  It's very easy to identify i.e. to delete all ZA01 without any amount entered.
    Thanks.
    Regards
    PSK

    Hi,
    I can think of this: get a program built to do this activity.
    build it flexible to delete any such CType for any S-Org--so it can be r-used later.
    Not sure if t-code MASS can help here?
    Regards,
    Raghu.

  • Deleting Sales Order Details using BAPI_SALESORDER_CHANGE And Reinserting

    Hi All,
    I need to <b>change a Sales Order</b> in such a way that I would <b>delete all the existing Line Items</b> of that SO And <b>then reinsert new Line Items</b> as generally is the practice of saving a document.(Update Header-Delete Old Item Entries-Reinsert New Present Entries).
    I coded a small test program in ABAP using the <b>BAPI_SALESORDER_GETLIST And BAPI_SALESORDER_CHANGE</b>.
    In order to affect the Qty I have to update the Schedule Parameter also of the BAPI_SALESORDER_CHANGE Function.But this causes a new entry in VBEP.
    eg:
    <b>Before BAPI Calls</b>
    SO-Number:9001
    Header:9001,etc......
    Detail:ItemNo=10,Material=xyz,TargetQty=100,etc..
    Scedule:ItemNo=10,Scheduleline=1,Req_Qty=100,etc...
    I coded the program such that
    1.I <b>Get the List of Items</b> using BAPI_SALESORDER_GETLIST.
    2.Call the <b>BAPI_SALESORDER_CHANGE</b> filling appropraite   values in Parameters <b>with UpdateFlag = 'D'</b>
    3.<b>Insert new values</b> in OrderItems And Schedule Parameters
    say:
    Detail:ItemNo=10,Material=xyz,TargetQty=25,etc..
    Scedule:ItemNo=10,Scheduleline=1,Req_Qty=25,etc...
    4.<b>Call the BAPI_SALESORDER_CHANGE</b> filling appropraite values in Parameters <b>with UpdateFlag = 'I'</b>
    <b>The output now becomes.</b>Header:9001,etc......
    Detail:ItemNo=10,Material=xyz,TargetQty=100,etc..
    Scedule:ItemNo=10,Scheduleline=1,Req_Qty=100,etc...
    ItemNo=10,Scheduleline=2,Req_Qty=25,etc...
    Now After Commit when I see my <b>SO it shows me a qty of
    125</b>.
    I am attaching the code for your analysis.
    Thanx in advance.
    *& Report  ZSM_CHANGESALESORDER                                        *
    REPORT  ZSM_CHANGESALESORDER                    .
    DATA:
    For Calling the GetList BAPI Function
      CUSTOMER_NUMBER LIKE  BAPI1007-CUSTOMER,
      SALES_ORGANIZATION LIKE  BAPIORDERS-SALES_ORG,
      IT_SALES_ORDERS LIKE TABLE OF BAPIORDERS,
      WA_SALES_ORDERS LIKE LINE OF IT_SALES_ORDERS,
      IT_RETURN LIKE TABLE OF BAPIRETURN,
      WA_RETURN LIKE LINE OF IT_RETURN.
    For Calling the ChangeFromData BAPI Function
    DATA:
      SALESDOCUMENT LIKE  BAPIVBELN-VBELN,
      WA_ORDER_HEADER_IN LIKE  BAPISDH1,
      WA_ORDER_HEADER_INX LIKE BAPISDH1X,
      IT_ORDER_ITEM_IN LIKE TABLE OF BAPISDITM ,
      WA_ORDER_ITEM_IN LIKE LINE OF IT_ORDER_ITEM_IN,
      IT_ORDER_ITEM_INX LIKE TABLE OF BAPISDITMX ,
      WA_ORDER_ITEM_INX LIKE LINE OF IT_ORDER_ITEM_INX,
      IT_SCHEDULE_LINES LIKE TABLE OF BAPISCHDL ,
      WA_SCHEDULE_LINES LIKE LINE OF IT_SCHEDULE_LINES,
      IT_SCHEDULE_LINESX LIKE TABLE OF BAPISCHDLX ,
      WA_SCHEDULE_LINESX LIKE LINE OF IT_SCHEDULE_LINESX,
      IT_RETURN_CHG LIKE TABLE OF BAPIRET2,
      WA_RETURN_CHG LIKE LINE OF IT_RETURN_CHG.
    DATA:
      IT_RETURN_CT LIKE BAPIRET2.
    PARAMETERS:
      P_SO LIKE VBAK-VBELN,
      P_CUSTNO LIKE  BAPI1007-CUSTOMER,
      P_SORG LIKE BAPIORDERS-SALES_ORG.
    START-OF-SELECTION.
      SALESDOCUMENT = P_SO.
      CUSTOMER_NUMBER = P_CUSTNO.
      SALES_ORGANIZATION = P_SORG.
    Retrieve the Existing Sales Order details for that Sales Order.
      PERFORM GETREQSODETAILS.
    Delete the Existing Sales Order details from that Sales Order.
      PERFORM DELETEOLDSODETAILS.
    Insert New details for that Sales Order.
       PERFORM ADDNEWSODETAILS.
    END-OF-SELECTION.
      PERFORM COMMITTRANS.
    *&      Form  GetReqSODetails
    FORM GETREQSODETAILS .
      CALL FUNCTION 'BAPI_SALESORDER_GETLIST'
        EXPORTING
          CUSTOMER_NUMBER    = CUSTOMER_NUMBER
          SALES_ORGANIZATION = SALES_ORGANIZATION
        IMPORTING
          RETURN             = WA_RETURN
        TABLES
          SALES_ORDERS       = IT_SALES_ORDERS.
    *delete the Sales Order Details of Sales Orders other than the req.One
      IF NOT IT_SALES_ORDERS[] IS INITIAL.
        SORT IT_SALES_ORDERS BY SD_DOC.
        LOOP AT IT_SALES_ORDERS INTO WA_SALES_ORDERS.
          IF WA_SALES_ORDERS-SD_DOC NE SALESDOCUMENT.
            DELETE IT_SALES_ORDERS.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " GetReqSODetails
    *&      Form  deleteOldSODetails
    FORM DELETEOLDSODETAILS .
      DATA: IRECCOUNT TYPE I.
      IRECCOUNT = 1.
    *Clear all the Inernal Tables And Work Areas
    *and Update the SO Header Index
      PERFORM CLEARDATA.
      PERFORM SOHEADERINDEX.
      LOOP AT IT_SALES_ORDERS INTO WA_SALES_ORDERS.
    *Fill the Order Details Index Internal Table
        PERFORM FILLSODELETEDTLS_INDEX_PARAM
        USING WA_SALES_ORDERS-ITM_NUMBER 'D'.
    *Fill the Order Scedule Index Internal Table
        PERFORM FILLSODELETESCH_INDEX_PARAM
        USING WA_SALES_ORDERS-ITM_NUMBER IRECCOUNT 'D'.
      ENDLOOP.
    *call the Sales Order Change Fumction to delete the Existing Data
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          SALESDOCUMENT    = SALESDOCUMENT
          ORDER_HEADER_INX = WA_ORDER_HEADER_INX
        TABLES
          RETURN           = IT_RETURN_CHG
          ORDER_ITEM_INX   = IT_ORDER_ITEM_INX
          SCHEDULE_LINESX  = IT_SCHEDULE_LINESX.
    ENDFORM.                    " deleteOldSODetails
    *&      Form  SOHeaderIndex
    FORM SOHEADERINDEX .
      WA_ORDER_HEADER_INX-UPDATEFLAG = 'U'.
    ENDFORM.                    " SOHeaderIndex
    *&      Form  FillSODeleteDtls_Index_param
    FORM FILLSODELETEDTLS_INDEX_PARAM
    USING VALUE(P_ITM_NUMBER) VALUE(P_FLAG).
      WA_ORDER_ITEM_INX-ITM_NUMBER = P_ITM_NUMBER.
      WA_ORDER_ITEM_INX-UPDATEFLAG = P_FLAG.
      APPEND WA_ORDER_ITEM_INX TO IT_ORDER_ITEM_INX.
    ENDFORM.                    " FillSODeleteDtls_Index_param
    *&      Form  FILLSODELETEsch_Index_PARAM
    FORM FILLSODELETESCH_INDEX_PARAM
    USING VALUE(P_ITM_NUMBER) VALUE(P_RECCOUNT) VALUE(P_FLAG).
      WA_SCHEDULE_LINESX-ITM_NUMBER = P_ITM_NUMBER.
      WA_SCHEDULE_LINESX-SCHED_LINE = P_RECCOUNT.
      WA_SCHEDULE_LINESX-UPDATEFLAG = P_FLAG.
      APPEND WA_SCHEDULE_LINESX TO IT_SCHEDULE_LINESX.
    ENDFORM.                    " FILLSODELETEsch_Index_PARAM
    *&      Form  addnewSODETAILS
    FORM ADDNEWSODETAILS .
      DATA: IRECCOUNT TYPE I, ITEMNO TYPE I.
      IRECCOUNT = 1.
    *Clear all the Inernal Tables And Work Areas
    *and Update the SO Header Index
      PERFORM CLEARDATA.
      PERFORM SOHEADERINDEX.
      WHILE IRECCOUNT <= 1.
        ITEMNO = IRECCOUNT * 10.
    *Fill the New Order Details in the Internal Table
        PERFORM FILLSODTLDATA USING ITEMNO 'TEST FG' 37 .
    *Fill the Order Details Index Internal Table
        PERFORM FILLSODELETEDTLS_INDEX_PARAM USING ITEMNO 'I'.
    *Fill the New Schedule Details in the Internal Table
        PERFORM FILLSOSCHDATA USING ITEMNO IRECCOUNT 37 .
    *Fill the Order Scedule Index Internal Table
        PERFORM FILLSODELETESCH_INDEX_PARAM
        USING ITEMNO IRECCOUNT 'I'.
        IRECCOUNT = IRECCOUNT + 1.
      ENDWHILE.
    *call the Sales Order Change Fumction to Insert New Data
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          SALESDOCUMENT    = SALESDOCUMENT
          ORDER_HEADER_INX = WA_ORDER_HEADER_INX
        TABLES
          RETURN           = IT_RETURN_CHG
          ORDER_ITEM_IN    = IT_ORDER_ITEM_IN
          ORDER_ITEM_INX   = IT_ORDER_ITEM_INX
          SCHEDULE_LINES   = IT_SCHEDULE_LINES
          SCHEDULE_LINESX  = IT_SCHEDULE_LINESX.
    ENDFORM.                    " addnewSODETAILS
    *&      Form  clearData
    FORM CLEARDATA .
      CLEAR WA_ORDER_HEADER_INX.
      CLEAR WA_ORDER_ITEM_INX.
      REFRESH IT_ORDER_ITEM_INX.
      CLEAR WA_SCHEDULE_LINESX.
      REFRESH IT_SCHEDULE_LINESX.
      CLEAR WA_RETURN.
      REFRESH IT_RETURN.
      CLEAR WA_ORDER_ITEM_IN.
      REFRESH IT_ORDER_ITEM_IN.
      CLEAR WA_SCHEDULE_LINES.
      REFRESH IT_SCHEDULE_LINES.
    ENDFORM.                    " clearData
    *&      Form  FILLSODTLDATA
    FORM FILLSODTLDATA  USING    VALUE(P_ITEMNO) VALUE(P_MATERIAL)
    VALUE(P_TARGET_QTY) .
      WA_ORDER_ITEM_IN-ITM_NUMBER = P_ITEMNO.
      WA_ORDER_ITEM_IN-MATERIAL = P_MATERIAL.
      WA_ORDER_ITEM_IN-TARGET_QTY = P_TARGET_QTY.
      APPEND WA_ORDER_ITEM_IN TO IT_ORDER_ITEM_IN.
    ENDFORM.                    " FILLSODTLDATA
    *&      Form  FILLSOschDATA
    FORM FILLSOSCHDATA  USING    VALUE(P_ITEMNO)
                                 VALUE(P_RECCOUNT)
                                 VALUE(P_REQ_QTY)  .
      WA_SCHEDULE_LINES-ITM_NUMBER = P_ITEMNO.
      WA_SCHEDULE_LINES-SCHED_LINE = P_RECCOUNT.
      WA_SCHEDULE_LINES-REQ_QTY = P_REQ_QTY.
      APPEND WA_SCHEDULE_LINES TO IT_SCHEDULE_LINES.
    ENDFORM.                    " FILLSOschDATA
    *&      Form  committrans
    FORM COMMITTRANS .
      DATA:SUCCESSFLAG(1).
      LOOP AT IT_RETURN_CHG INTO WA_RETURN_CHG.
        IF WA_RETURN_CHG-TYPE = 'S'
              AND WA_RETURN_CHG-ID = 'V1'
              AND WA_RETURN_CHG-NUMBER = 311
              AND SUCCESSFLAG IS INITIAL.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
            EXPORTING
              WAIT   = 'X'
            IMPORTING
              RETURN = IT_RETURN_CT.
          SUCCESSFLAG = 'X'.
        ENDIF.
      ENDLOOP.
      IF SUCCESSFLAG IS INITIAL.
        WRITE: 'SORRY SOME ERROR'.
      ELSE.
        WRITE: 'SUCCESSFUL'.
      ENDIF.
    ENDFORM.                    " committrans

    Thanx wolfgang,
    I needed that info.
    As I had mentioned in the earlier posts, I want to delete the old Sales Order Item Details,
    Schedule Details,Basic Price data And Reinsert data in the same.
    I am giving u the algo that I have used.
    1.<b>Get the SalesOrder Details</b> for a particular Sales Order using BAPI_SALESORDER_GETLIST(para:customer & sales Org and then deleting unwanted SO data).
    2.<b>Delete</b> the Sales Order <b>Item Details,Schedule Details</b> using BAPI_SALESORDER_CHANGE.
    3.<b>Commit</b> Transaction(<b>If I dont use this commit Error comes in Step No.7 while Commiting</b>)
    using BAPI_TRANSACTION_COMMIT.
    4.Check <b>Return Table</b> of both BAPI_SALESORDER_CHANGE and BAPI_TRANSACTION_COMMIT.
    5.if Step No.4 is <b>Not okay</b> <b>then Rollback</b>(BAPI_TRANSACTION_TRANSACTIN) <b>and Exit</b> <b>else move to step 6</b>.
    6.<b>Add New</b> Sales Order <b>Item Details,Schedule Details, Basic Price</b> using BAPI_SALESORDER_CHANGE.
    7.<b>Commit Transaction</b> using BAPI_TRANSACTION_COMMIT.
    8.<b>Check Return</b> Log of both BAPI_SALESORDER_CHANGE and BAPI_TRANSACTION_COMMIT.
    9.if Step No.9 is okay then Exit else Rollback(BAPI_TRANSACTION_TRANSACTIN) and move to step 10.
    10.Add Old Sales Order Item Details,Schedule Details, Basic Price from Data available in Internal
    table(Filled in step.1 ) using BAPI_SALESORDER_CHANGE.
    11.Commit Transaction using BAPI_TRANSACTION_COMMIT.
         This <b>works fine in 1 server in which I get the message of Incomplete Data,etc...when I make a Sales Order from va01</b>.
    But in another server where I dont this message,I get <b>error in step  7 or 11 as per the flow</b>.
    The return structure of BAPI_TRANSACTION_COMMIT contains error with Message 'Updating was not possible'. Also the message 'Updation was terminated' cms frm the SAP server.  
         What could be the reason?
    Thanx in advance

  • Need to add new condition type using   BAPI_SALESORDER_CHANGE

    Hi all,
    I am using BAPI_SALESORDER_CHANGE to add new condition type for an order item.
    I am able to add it, but problem here is, that i want that condition type to be manually changable. Here, in BAPI, after execution, condition type field becomes disable.
    My code is as follows:
                    MOVE 'B' TO wa_logic-pricing.
                      MOVE 'X' TO wa_logic-cond_handl.
                      wa_cond-itm_number = wa_vbap-posnr.
    *                  wa_cond-cond_st_no = it_konv1-stunr.
    *                  wa_cond-cond_count = it_konv1-zaehk.
                      wa_cond-cond_type =  it_discount-kschl.
                      wa_cond-CONDORIGIN = 'C'.
                      APPEND wa_cond TO i_cond.
                      CLEAR: wa_cond.
                      wa_condx-itm_number = wa_vbap-posnr.
    *                  wa_condx-cond_st_no = it_konv1-stunr.
    *                  wa_condx-cond_count = it_konv1-zaehk.
                      wa_condx-cond_type =  it_discount-kschl.
                      wa_condx-updateflag = 'I'.
                      wa_condx-COND_VALUE = 'X'.
                      APPEND wa_condx TO i_condx.
                      CLEAR: wa_condx.
    FORM f_update_order .
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = salesdocument
          order_header_in  = wa_headerdata
          order_header_inx = wa_headerdatax
          logic_switch     = wa_logic
        TABLES
          return           = it_return
          order_item_in    = i_itemdata
          order_item_inx   = i_itemdatax
          conditions_in    = i_cond
          conditions_inx   = i_condx.
      IF NOT it_return[] IS INITIAL.
        PERFORM f_commit_or_rollback.
      ENDIF.
    ENDFORM.
    Please let me know, if it could be achievable.
    Best regards,
    Meena
    Moderator Message: Corrected the code tags. You need to use flower brackets.
    Edited by: kishan P on Aug 25, 2010 6:04 PM

    Hi,
    This is the demo code i am writing:
    Even Change manual entry field in BAPI did not helped me.
    [code]REPORT  ZTESTM1.
    data: l_knumv type knumv.
    DATA: it_return        TYPE STANDARD TABLE OF bapiret2,         "Internal table for t_txt_ret
           wa_return        type  bapiret2.
    data: begin of it_konv occurs 0.
           include structure konv.
           data: end of it_konv.
    data: logic_switch type standard table of    BAPISDLS,
          wa_logic type BAPISDLS.
    data:itemdata type STANDARD TABLE OF BAPISDITM,
          wa_item type   BAPISDITM.
    data : salesorder type BAPIVBELN-VBELN.
    data:itemdatax type STANDARD TABLE OF BAPISDITMx,
          wa_itemx type   BAPISDITMx.
    data: wa_header type BAPISDH1,
          wa_headerx type BAPISDH1X.
    data: i_cond type STANDARD TABLE OF BAPICOND,
          wa_cond type BAPICOND.
    data: i_condx type STANDARD TABLE OF BAPICONDX,
          wa_condx type BAPICONDX.
    move '0060008601' to salesorder.
    move '000010'  TO wa_item-itm_number.
    append wa_item to itemdata.
    move ' '  to wa_header-BILL_BLOCK.
    move   'U'  to wa_headerx-UPDATEFLAG.
    move  'X' to wa_headerx-BILL_BLOCK.
    MOVE: 'U'  to wa_itemx-UPDATEFLAG,
         '000010'  TO wa_itemx-itm_number.
         append wa_itemx to itemdatax.
    move 'B' to wa_logic-PRICING.
    move 'X' to wa_logic-COND_HANDL.
    select single knumv from vbak into l_knumv where vbeln = '0060008601'  .
    select * from konv into table it_konv where knumv = l_knumv  and kposn = '000010'.
          wa_cond-ITM_NUMBER = it_konv-kposn.
          wa_cond-cond_type = 'Z550'.
          wa_cond-CONDCHAMAN = 'X'.
           append wa_cond to i_cond.
           clear: wa_cond.
    wa_condx-ITM_NUMBER = it_konv-kposn.
    wa_condx-COND_TYPE = 'Z550'.
    wa_condx-UPDATEFLAG = 'L'.
    append wa_condx to i_condx.
    clear: wa_condx.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
      EXPORTING
        salesdocument               = salesorder
       ORDER_HEADER_IN             = wa_header
        order_header_inx            = wa_headerx
       LOGIC_SWITCH                = wa_logic
      tables
        return                      = it_return
       ORDER_ITEM_IN               = itemdata
       ORDER_ITEM_INX              = itemdatax
       CONDITIONS_IN               =   i_cond
       CONDITIONS_INX              =   i_condx
      EXTENSIONIN                 =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.[code]
    Thank you.
    Meena

  • Table for Deleted Pricing Condition

    Dear SD Guru's,
    Good Day.
    I would like to ask what is the table i can use to show all the pricing condition that is flagged for deletion? and with the deletion date.
    Currently I am using KONP, but there is no deletion date field there?
    Any ideas?
    Hoping for your positive feed backs.
    Thank you.

    Hi Tina,
    Check this if it useful
    Enter transaction: OY18 ? Then choose the option: Evaluate Logs.
    Enter table: NACH,then Specify the time interval for which you want to run the analysis. Choose the option: "Tables" in the Evaluate for - area.
    If you get the message "No logs found for selected period" and you know for a fact that there were changes, execute /nsu53.
    Regards,
    Madhu.

  • Delete header condition line in a sales order!

    Hi guys,
    I tried deleting condition line (under condition tab) for a line item using BAPI_SALES_ORDER_CHANGE. It works fine.
    I also need to delete condition line at header of sales order. If any one has a idea ...can you please share??
    Thanks & Regards
    HImayat.

    Hi Madhu,
    I have passed this way.
    ls_ordcond_inx-updateflag = 'D'.
    ls_switch-cond_handl = 'X'.
    ls_ordcond_in-itm_number  = '000000'."for header
    ls_ordcond_inx-itm_number = '000000'.
    ls_ordcond_in-cond_type   = ls_xref-value1.(I have passed condition type) here
    ls_ordcond_inx-cond_type  = ls_xref-value1.
    APPEND ls_ordcond_in  TO lt_ordcond_in.
    APPEND ls_ordcond_inx TO lt_ordcond_inx
    lv_bape_vbak-vbeln        = iv_vbeln.
      lv_bape_vbak-zzmdisc      = ls_vbak-zzmdisc
      lv_extensionin-structure  = lc_bape_vbak.
      lv_extensionin-valuepart1 = lv_bape_vbak+0(240).
      lv_extensionin-valuepart2 = lv_bape_vbak+240(170).
      APPEND lv_extensionin TO lt_extensionin.
      CLEAR lv_extensionin.
    *   BAPE_VBAKX
      lv_bape_vbakx-vbeln       = iv_vbeln.
      lv_bape_vbakx-zzmdisc     = 'X'.
      lv_extensionin-structure  = lc_bape_vbakx.
      lv_extensionin-valuepart1 = lc_bape_vbakx. 
      APPEND lv_extensionin TO lt_extensionin.
      CLEAR lv_extensionin
    Then call to BAPI..
    Still doesnt seem to be working...anything am missing??

  • Delete pricing condition records : vk12

    When i mark a record as deleted in vk12, there add a tick in DeletionID column. I was told the record would be deleted after database reorgnization.
    I want to ask, when will DB reorgnize? Would the deleted records be active before DB reorginze?
    Can anybody help me?
    Thanks a lot

    hi Yimeng,
    In v/06 for your condition type check the field delete from DB
    If you set this field as A or B,then only you will be able to delete the condition record permanently via VK12.Otherwise you can only set deletion indicator. after u set the indicator in v/06, then goto
    vk12 and set the record as delete.so the first one controls the actions in vk12.
    condition record can be deleted in two ways
    1.physical deletion
    2.marked for deletion.
    The customizing can be done at the condition type maintainance in V/06,
    u have three options
    1.physical deletion with pop up
    2.physical deletion without pop-up
    3.mark for deletion.
    select an option there and in condition record in VK12, select the record and
    and delete with the deletion indicator.
    SAP recommends physical deletion
    reward if it is useful
    bye MCM

  • Pricing condition issue using Variant Configuration

    Hi Gurus,
    I have created reference characteristic 'z_price' , with a reference table SDCOM and field VKOND and has values X and Y.
    Assigned this characteristic to Class type 300.
    \Also assigned dependency type procedure to the characteristic values X and Y.
    $self.z_price = 'X' for X and similarly for 'Y'
    created condition record VA00 for the characteristic values X and Y.
    For X value 100$ and Y value is 200$.
    So when i simulated or testing by creating a sales order, the net value is showing as '0' (Zero).
    Is there any configuration required to change to make this effect in to consideration.
    I assigned objectdepencies to configuration profile and did a test run, still it was not showing up.
    I also checked pricing procedures and pricing procedure has condition type VA00.
    So dont know what exactly i am missing here. Any one please guide me what are the other steps should i have to follow.
    Note: configurable material is already used in production client , so i am trying to upgrade that material to pricing.
    Thanks,
    Naveen.
    Thanks in advance,
    Quantum.

    HI Gina.
    Thanks for your reply.
    I have entered values in VK30 after your reply, but i dont see any changes after those entries.
    Would you describe me, what exactly the use of VK30 Tcode, as i see i have to enter the description for the value.
    Do i have to use these description somewhere in Object dependencies to trigger the Price?Please suggest.
    Thanks,
    Quantum.

  • Tracking deleted pricing condition records

    Hello,
    I Have a condition record for a condition type with a  particular price of USD 100 with validity date from 1.10.09 to 30.10.09.
    Now we create another condition record for the same condition type with a new price of USD 50 with same valid date from 1.10.09 to 30.10.09..
    So now the systems delete the old condition reocord of USD 100.This is standard sap.
    Now I want to know is there any way of tracking the deleted condition records like  the ones the system has deleted. If there is no standard report and if we have to develop a Z report, then how to develop that since the tables do not contain the old conditon records.
    regards
    sachin

    Hi,
    Yes, from the condition table that you are going to maintain the condition records (check the condition table assigned to the access sequence, from the condition type), we will get all the condition records maitained for specific combination/material
    Now go to se16 and enter the condition table name and give the proper selection criteria then you will get all the condition record numbers maintained to your selection with validity dates. then you can go to KONP and pass the condition record and you can get the condition values for that particular combination with proper validity dates.
    (Actually from VK13/VK12 based on validity date that we have mentioned in the selection screen will display the condition record valid on that paricular date, from the system those condition records will not be deleted at all)
    OR
    There are two possible methods of displaying change documents:
    Choose Environment -> Changes -> For condition record.
    Change data for the selected condition record(s) will be displayed.
    Choose Environment -> Changes -> Report.
    A selection screen will appear where you can choose multiple criteria for displaying change documents. The result of the selection report is displayed.
    Regards,
    Satya

  • LSMW with PIR line deletion of condition pricing .. possible ? how?

    Hi,
    May I ask your opinion of using LSMW to delete one PIR condition line item of one particular period? Is this possible via LSMW?
    For example,
    PB00--12.12.2001-to---12.12.2010-30--DKK
    PB00--13.12.2010-to---12.12.2099-30--DKK
    PB00--13.12.2099-to---12.12.3000-30--DKK (I want to delete this line)
    if possible, may I know if the method is A) Standard Batch/Direct Input, OR, B) Batch Input Recording?
    Personally, I think it should be A method, because I don't think LSMW is able to recognize which period line condition I want to delete during ME12 recording of deletion, am I right?
    If method A is possible, is there a particular field that I can use to represent the deletion of the line?
    Please share your experience.
    thanks
    Tuff

    Hi Nijamu,
    Do you mean I use the recording method (i.e. the B method I mentioned earlier), and do a recording by deleting the line condition I wanted to delete;
    Next I put in all the pricing condition line item (ie. which consists of all the VALID-TO on year 3000) which I wanted to delete in excel and later tab limited file.
    The above will work?
    But may I ask, when LSMW look at my file, will it recognize the line base on my file and delete the correct pricing line item?? because it is important it does not delete all the pricing condition line item or delete the WRONG line item..
    please double confirm, but I will try with few test. but please dobulec confirm to me .. thanks.
    tuff

  • Pricing condition deletion in CRM

    Hello!
    We're trying to delete pricing condition using CRMXIF_CONDITION_SEL_DELETE, but we are able to delete only a number of condition records at once.
    I've read the documentation  for this FM, but  i still can't understand how to delete particulary one pricing condition from condition table.
    Can anybody help me?
    Tnank you!

    Hi,
    I used function module 'CRMXIF_CONDITION_SEL_DELETE' to delete condition records. Below is the sample code,
    Data:  ls_data           TYPE bapi_ct_sel_opt_msg,
           lt_range          TYPE TABLE OF bapi_ct_cond_rec_sel_range,
           ls_range          TYPE bapi_ct_cond_rec_sel_range,
           lt_return         TYPE bapirets,
           lt_ret            TYPE bapiret2.
        ls_data-object_representation   = 'E'.
        ls_data-sel_opt-ct_application  = 'CRM'.
        ls_data-sel_opt-object_task     = 'D'.
          ls_range-fieldname    = 'ZZOPPORTUNITY_GUID'.
          ls_range-r_sign       = 'I'.
          ls_range-r_option     = 'EQ'.
          ls_range-r_value_low  = lv_guid.   
          APPEND ls_range TO lt_range.
          ls_range-fieldname    = 'KSCHL'.
          ls_range-r_sign       = 'I'.
          ls_range-r_option     = 'EQ'.
          ls_range-r_value_low  = 'ZZNE'.    "cond type
          APPEND ls_range TO lt_range.
          ls_data-sel_opt-range = lt_range.
    CALL FUNCTION 'CRMXIF_CONDITION_SEL_DELETE'
          EXPORTING
            data   = ls_data
          IMPORTING
            return = lt_return.
    * Committing the transaction
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          IMPORTING
            return = lt_ret.
    Regards,
    Arun

Maybe you are looking for