Sales order exit - changing pricing conditions

Hi Gurus
    We have an issue where a customer was given $0 pricing on an item within their price list, but when an order is created, the system prices the item at List Price.   Upon investigation, it was discovered that SAP cannot maintain pricing at $0 because the item categories are looking for a net value. We decided that we would create a user exist that would change the item category on the items and price that item as u201Cfree of chargeu201D for these customers. We did work on the user exit u201Csave_document_prepareu201D and were able to change the item category in sales order screen but the pricing  conditions shows net values in that tab. The question here is how to update the pricing conditions when we change the item category for each item
Thanks
Ganesh

Hi Ganesh,
For this Goto the User-Exit MV45AFZZ & From there Goto FORM USEREXIT_MOVE_FIELD_TO_VBAP.
Now here write your condition.
The data(Pricing details) is available in XKOMV. and The Item is in VBAP...
Now Check if the Item & Customer are same in a Simple If Condition.. If same the Clear XKOMV[]. Thats it..  
It Clears Teh Pricing Conditions all to 0.
If you still have Net value & Netprice,, Then Clear the NETWR & NETPR fields As well in Header(VBAK) & Item(VBAP) as well..
Thanks & Regards,
Dileep .C

Similar Messages

  • SAP report showing sales orders on which pricing conditions have been chang

    Is there a SAP report that shows a list of sales orders on which pricing conditions have been changed.
    My knowledge is:
    Review pricing condition transaction data table (‘KONV’) helps is some way.

    Hi Ashish,
    I don't know any such a report, but I guess you can play arround with table CDPOS.
    Change doc. object = VERKBELEG
    Table Name = KONVC.
    Actually this will take lot of time.
    Thanks,
    Mandar

  • Workflow identification in Sales Order Exit

    Hi,
    In my Sales order exit, under some conditions Iam raising an error message, when the order is being created in background this order will move to workflow. Now if any one process this order through the workflow i want to allow the order to get posted with out raising my exception.
       So I would like to know how I can identify whether my order is being posted through the workflow or directly, in the Sales order exit code.
    Thanks in advance friends,
    Anvitha.

    Hi friends,
    Thanks for your response.
    Checking whether the order is posted in Background or foreground doesn't solve my problem, because my order may be posted in Background or foreground. But when the order is processed through workflow, the processing option depends on the configuration of the Workflow object type. So SY-BATCH doesn't serve my purpose.
       Coming to using SY-UNAME, I observed that the value during the Order process through Workflow is the UserID who process it. So i can't distinguish it.
    Friends, any one had any other option to identify whether the order is being posted through Workflow.
    please help me out.
    Regards,
    Anvitha.

  • How to change pricing Conditions in Sales order in change sales order bapi

    Hi Experts,
    How to change pricing Conditions in Sales order in change sales order bapi.
    I have used the 2 function modules bapi-changesalesorder and sd salesdocument change, But it is creating the new record , instead of changing the existing one, Could please assist regarding the same
    Thanks in Advance .
    NLN

    HI NLN
      I have just tried on my system and managed to overwrite the existing price by passing the following parameters.
      <b>Import Paramters:</b>
         SALESDOCUMENT - Sales Document Number
         ORDER_HEADER_INX - UPDATEFLAG as <b>'U'</b>.
         LOGIC_SWITCH - Import Structure - Pass 'X' to LOGIC_SWITCH-COND_HANDL.
      <b>Tables:</b>
         CONDITIONS_IN - ITM_NUMBER,
                         COND_COUNT, -> Condition counter same as KONV-ZAEHK generally it is <b>'01'</b>
                         COND_TYPE,
                         COND_VALUE,
                         CURRENCY.
         CONDITIONS_INX - ITM_NUMBER,
                          COND_COUNT,
                          COND_TYPE,
                          UPDATEFLAG as <b>'U'</b>,
                          CURRENCY.
       Hope i have clarified your query.
    Kind Regards
    Eswar

  • How can we change Pricing condition price date

    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

    Hi Praveen,
    You can use user exit "USEREXIT_PRICING_PREPARE_TKOMK" to change Pricing Condition Table at header level & "USEREXIT_PRICING_PREPARE_TKOMP" at item level. These exits are present in include "MV45AFZZ" of Sales Order program "SAPMV45A".
    Cheers,
    Gajendra

  • How to update cost related condition type amount in sales order without disturbing other condition types.

    Hi ,
    How to updae only one item condition  ZYV0 value in sales order. If I can see we have several options from pricing type to update condition types but here My requirement is to update only one condition amount .If I can see other pticing types they will update all condition types .
    -Exclusive option is checked for all the tables maintained in access sequence,
    Below options were not worked for me.
    -In condition type ----> Condition category has been updated with "D"(Tax) pricing type-"G" to update in sales order
    - This option worked for me but  condition category  "F"(frieght) and pricing type -H but in conditions tab when I update two condition amounts are activated for one condition type like below.
    ZYV0--30 % (old condition record value updated in sales order)
    ZYV0- 50% (updated condition record)
    Regards

    Hi Rita,
    Tried with condition category "u" and updated with pricing type "U" . It works as same I used old logic.
    with condition categories "D" and "F" it will update old and new condition record values in sales order.
    ZYV0--30 % (old condition record value updated in sales order)
    ZYV0- 50% (updated condition record)
    I have updated  here existing condition record value from 30 % to 50 % validity periods are not changed.
    Regards

  • Need to pull INITIAL(vbap)net price of  Sales Order, after changing viaVA02

    Hi Experts,
    Mine is differetnt requirement..........
    I created a my_Sales_order_12345678 with 2 items, as follows,(all following values/entries r for my_Sales_order_12345678)
    line item_10---->net_value_netpr = $100
    line item_20---->net_value_netpr = $200
    Then the VBAP entries as r as follows,
    POSNR -
    >NETPR
    10----
    > $100
    20----
    > $200
    I changed first time as via VA02 tx, as
    line item_10---->net_value_netpr = $300
    line item_20---->net_value_netpr = $400
    Then the VBAP entries as r as follows,
    POSNR -
    >NETPR
    10----
    > $300
    20----
    > $400
    I changed second time as via VA02 tx, as
    line item_10---->net_value_netpr = $500
    line item_20---->net_value_netpr = $600
    Then the VBAP entries as r as follows,
    POSNR -
    >NETPR
    10----
    > $500
    20----
    > $600
    My requirement: for some reason, I need the initial values, I mean
    the VBAP entries of,
    POSNR -
    >NETPR
    10----
    > $100
    20----
    > $200
    I tried with CDHDR & CDPOS tbls, but no use? So, from Where Can I get/pull them??
    thanq
    Edited by: Srinivas on Jan 24, 2008 12:22 AM

    hi sirnivas..
    Thanq you for the points..these are the first i ever recieved..
    if you are working on peice of code which can get the price history do me a favour if you have finished the code just explain it to me who did u  do that...
    i have been working on an object from last two weeks to get the latest price...
    the thing is even though the price for condition items has been changed it wont get updated in the Sales orders unless new pricing fot the document is done...
    so i have to get all the sales orders who condition items price has been changed and display them in an ALV...so if you can get the exact old values...for the conditions i guess the opposite also can be done.....
    Here i have suggestion for you...in condition items there is a process called SCHEMA ( pricing Schema) which you can see using Condition Analysis button at the bottom of the condition item window...
    you can see all the price changes to the condition when you parse the tree structure of the procedure..EXAMPLE :- R0000 etc...
    so some Sales orders if the Schema has been changed all the existing condition are replaced by New ones from the changed Schema...so i guess that would play an important role in deciding the Price of Sales order...
    I know this is bit long but .....if you did finsish your program do let me know how you did it...
    Thankyou very much and good luck.

  • Sales order Price change while releasing the credit block using VKM3

    Hi,
    Please advice me on the following issue I am facing:
    I am creating a sales order, which is having automatic pricing. The price is getting picked up using the condition records correctly in the order. The pricing condition can be manually changed in the order (setting according to the condition type).
    So I am changing the price manually in the sales order (system determined price $230 and I changed it to $270) and saved the order. Cross checked the order while saving to make sure the price of the order is now $270.
    As the customer credit limit is exhausted, the system blocked the sales order (credit block). I released the sales order using VKM3, but when I checked the sales order, the system reset the price back to $230 (condition record value).
    Is this a standard SAP behavior?
    My requirement is: the system should not change the value back to the original condition value while releasing the sales order using VKM3.
    Please guide..
    Regards,
    Prasanth

    In the condition type definition T Code V/06, fin your manual condition type definition- for the field "Manual Entries" - Have option C "Manual entry has priority".
    In the pricing procedure, T Code V/08 in the initial screen - for your pricing procedure - under the column "pricing Type" have Option C - copy manual pricing elements and redetermine others.
    Try with these settings. Hope this helps
    Regards
    Sai

  • Sale order showing a discount condition type twice in conditions Tab

    Dear Experts,
    Sale order showing a discount condition type twice in conditions Tab.
    Could you resolve my issue?
    Thanks in advance.
    Regards,
    Ravi

    Hi,
        In the Sales order, go to Conditions and in the Pricing 'Analysis' , check for where the system is determining the two values of this discount condition. It may be possible that it is determining from two condition tables.
    Also in the access sequence of this condition type, please make sure that the 'exclusive' indicator is checked for the condition tables.
    Please check if it helps.
    Thanks,
    Saurabh

  • Credit block in Sales order create/change

    Hi Experts,
    while creation/change of sales order,If sales order net value is zero or 0.01 no credit checks.in other words greater than 0.01 netvalue of so, it shoud undergo credit checks.( Means Header->Status, Credit status = 'Not Approved". )
    Actually i am trying to write logic in routine 901 ( include RVKMP901).but i am unable to reach the requirment.Can anybody how i can reach above requirment.
    Regards
    Jaya Reddy

    Hello,
    you could use code similar to this:
      CHECK: xvbak-netwr < ls_zkredit-wert.
    else no credit check
      vbap-cmpnt = ' '.
      MOVE charx TO bypass-security.
      MOVE charx TO bypass-static_limit.
      MOVE charx TO bypass-dynamic_limit.
      MOVE charx TO bypass-documentvalue.
      MOVE charx TO bypass-critical_fields.
      MOVE charx TO bypass-reviewdate.
      MOVE charx TO bypass-open_items.
      MOVE charx TO bypass-oldest_op.
      MOVE charx TO bypass-dunning_level.
      MOVE charx TO bypass-user1.
      MOVE charx TO bypass-user2.
      MOVE charx TO bypass-user3.
    The ls_credit-wert is a local field which is set from a table according to Sales order Type/ Salesorg/ Payment-condition
    Regards Wolfgang

  • How to ATP check when sold to party in sales order is changed?..

    Dear SD Gurus,
       I have one issue with ATP check in my current project where I need to change the the Sold to party of the sales order for a valid business case. We are using production allocation method for ATP check which reduces the Open PA qty once the sales order is saved.
    In the above scenario, once the Sold to party in sales order is changed, it redetermines everything and also goes through a ATP check which is cusing as an issue as it would again reduce the open PA qty for the same items in sales order for which are already taken into account. It would either reduce the open qty or propose the next date if it is no more available on that day.
    This is a big issue for us. Also it deleted the texts that are maintained.
    Does anyone know how to stop the ATP check in this (main issue) and also if possilble stop the deleteion of texts?
    Thank you very much for your help in advance..
    BR/
    Ashutosh

    Hello SAJU,
      The ATP check is done automatically when sold to party is changed..the issue is how to stop it? beacause of production allocation , it would be incorrect to reduce the open PA qty once more for the sales order when sold to party is changed. So I would like to stop it. Is there any exit or paramater by which we can stop ATP check?
    Thanks for your reply..
    BR/
    Ashutosh

  • Change the Sold to Party(SP) in sales order in change mode

    Hi,
    Is it possible to change the Sold to Party(SP) in sales order in change mode?
    If yes then How??
    Regards
    Somnath

    Hi somnath,
    It is very much possible to change the sold-to-party in the change mode of Sales order(VA02).
    Goto VA02-->enter the sale order number.
    Press enter.
    In the overview screen if you change the sold-to-party then every thing will be redetermined(Taxes and pricing procedure etc...).These will be determined from CMr etc.
    You cannot change the sold-to-party at the partners tab that is present in the Header details.
    It will be greyed out.
    If you change the sold-to-party at the overview screen as suggested earlier it will not apply to the item.
    You are also going to see this message while changing.
    And finally save the document.
    Regards,
    Krishna.

  • Automatic Send mail when sales order is change

    Hi friends,
    I have a requirement that  when ever sales order is created or change i.e in va01 or va02 automatically mail to send to customer. So please can u sujjest me in doing this ?
    with regards,
    prasad.

    Write the codes in sales order exit program so that as soon as you save the sales order the email can be triggered.
    Abap Program: MV45AFZZ
    USEREXIT_SAVE_DOCUMENT
    Sending e-mails using ABAP
    Thanks
    Ganesh
    you can also use work flow to trigger the email from sales order.
    Edited by: Ganesh Modhave on Oct 6, 2008 10:54 AM

  • Insert code in prgram to check sales order exits in your own program

    Hi Experts
    I want to insert a coding in IDOC , can anyone write in abap coding and show .....The program is to check if sales order for category PSTYV ( CATEGORY ) for items ...
    if found set flag true else set flag false...
    Eg
    clear flag
    insert code
    to check s/o for ZTAC item found
    if found
    set flag = true
    else
    set flag = false
    So how can I write a a code in ABAP
    Thanks in advanced
    Piroz

    Hi Fracis
    Thanks for your advice I did in this way ,  Is there any correction required
    form look_sap_saleord  using    p_in_string
                                    p_material_in          " Material No exits
                                    p_site_in              " plant
                           changing p_out_saleord_e        " sales order
                                    p_out_material_e       " Mat No
                                    p_out_order_e          " Prod Order
                                    p_out_wemng_e          " QTY goods received for order item
                                    p_out_psmng_e.         " Ordered Qty Item
      data: lva_prodord like afpo-aufnr,   " Production Order
            lva_prodmat like afpo-matnr,   " Material Number
            lva_saleord like vbkd-vbeln,   " Sales Order
            lva_pstyv   like vbap-pstyv,   " Category
            lva_wemng   like afpo-wemng,   " Quantity of goods received for the order item
            lva_psmng   like afpo-psmng,   " Ordered Qty Item
            lva_count   type i.            " counter validation
    CHECK FOR SALES ORDER IN VBAP IF EXITS
    GO TO DELIVERES
    ELSE CHECK REQUIRED PRODUCTION ORDER
           ihrez_e Ship to party
    check single if the sales order exits
      select vbeln from vbkd into vbkd-vbeln
        where ihrez_e eq p_in_string.
      Is the sales order exits for ZTAN Category ?
        select vbeln from vbap into vbap-vbeln
          where vbeln eq vbkd-vbeln and
                werks eq p_site_in and
                matnr eq p_material_in and
                pstyv = 'ZTAN'.
        The sales order is for the specified plant.
          lva_saleord = vbap-vbeln.
          lva_prodmat = vbap-matnr.
          exit.
        endselect.
      when an order for this plant has been found.
        if not lva_saleord is initial.
        exit.
        endif.
      endselect.
      check not lva_saleord is initial.
      select count(*) into lva_count from vbap
        where vbeln = lva_saleord.
      if lva_count eq 1.
        select vbeln matnr aufnr pstyv
        into (lva_saleord, lva_prodmat, lva_prodord, lva_pstyv) from vbap
          where vbeln = lva_saleord and
                matnr = p_material_in and
                pstyv = 'ZTAN'.
          exit.
        endselect.
      else.
        select vbeln matnr aufnr pstyv
        into (lva_saleord, lva_prodmat, lva_prodord, lva_pstyv) from vbap
          where vbeln = lva_saleord
          and matnr   = p_material_in.
          exit.
        endselect.
      endif.
       move: lva_saleord to p_out_saleord_e,           " sales order
             lva_prodord to p_out_order_e,             " production order
             lva_prodmat to p_out_material_e,          " material no
             lva_psmng   to p_out_psmng_e,             " QTY Ordered
             lva_wemng   to p_out_wemng_e.             " Qty Received goods
            lva_wemng   to p_out_wemng_e.             " Quantity of goods received for the order item
    endform.                    " look_sap_sales ord
    Regards

  • Ignore Production order if sales order exits

    Hi Experts
    I want to check some validation for sales order , The system goes in this way  ...I have to modify in this way
    we are extracting the command orders from Command QC System and inserting into SAP . Once it is extracted the Interface coding was written.....to extract sales order, production order etc.,
    Now I want to check only those records in which category are ZTAN. because some time in our company they will sold pigments which does not contain production order directly it will check for qty and delivered to customer.
    Select * from VBAP where VBELN = 'SALES ORDER' and
             MATNR = 'Material nO' and
             PSTYV = 'ZTAN'
    This is because it should not check the production order in AFPO table it must directly go to create deliveries etc for that I created to check sales order ignoring production order So can anyone help me to modify the below coding to check only sales order bu
    SALES ORDER EXITS MODIFICATION****************
    *&      Form  find_sap_salord Exits
          Find an SAP production order for a material.
         -->P_IN_STRING    COMMAND order number
         -->P_MATERIAL_IN  Material number in
         -->P_SITE_IN      Material number in
         <--P_OUT_SALEORD  Sales order number
         <--P_OUT_MATERIAL Material number out
         <--P_OUT_ORDER    Production order number
    form look_sap_saleord  using    p_in_string         " 
                                    p_material_in       " Material No exits
                                    p_site_in           " plant
                           changing p_out_saleord       " sales order
                                    p_out_material      " Material No
                                    p_out_order         " Prod Order
                                    p_out_wemng         " Qty of Goods Rec for Order Item
                                    p_out_psmng.        " Ordered Qty Item
      data: lva_prodord like afpo-aufnr,   " Production Order
            lva_prodmat like afpo-matnr,   " Material Number
            lva_saleord like vbkd-vbeln,   " Sales Order
            lva_pstyv   like vbap-pstyv,   " Category
            lva_wemng   like afpo-wemng,   " Quantity of goods received for the order item
            lva_psmng   like afpo-psmng,   " Ordered Qty Item
            lva_count   type i.            " counter validation
           ihrez_e Ship to party       
      select vbeln from vbkd into vbkd-vbeln
       where ihrez_e eq p_in_string.
      select vbeln from vbap into vbap-vbeln
        where vbeln eq p_in_string.
      Is the order for the specified plant?
        select vbeln from vbap into vbap-vbeln
          where vbeln eq vbap-vbeln and
                matnr eq vbap-p_material_in and
                pstyv in ('ZTAN')
          and   werks eq p_site_in.
        The order is for the specified plant.
          lva_saleord = vbap-vbeln.
          exit.
        endselect.
      Exit when an order for this plant has been found.
        if not lva_saleord is initial.
          exit.
        endif.
      endselect.
      check not lva_saleord is initial.
      select count(*) into lva_count from afpo
        where kdauf = lva_saleord.
      if lva_count eq 1.
        select aufnr matnr wemng psmng
        into (lva_prodord, lva_prodmat, lva_wemng, lva_psmng) from afpo
          where kdauf = lva_saleord.
          exit.
        endselect.
      else.
        select aufnr matnr wemng psmng
        into (lva_prodord, lva_prodmat, lva_wemng, lva_psmng) from afpo
          where kdauf = lva_saleord
          and matnr   = p_material_in.
          exit.
        endselect.
      endif.
      move: lva_saleord to p_out_saleord,
            lva_prodord to p_out_order,
            lva_prodmat to p_out_material,
            lva_psmng   to p_out_psmng,
            lva_wemng   to p_out_wemng.
    endform.                    " find_sap_prodord
    END OF MODIFICATION 22/09/2008*******

    Thanks  thread close
    Piroz

Maybe you are looking for