Restrict Formula Calls in Sales Order Pricing

Hi All,
I have created a pricing conditon formula to get the price for the real time contract price from a third party Contract management system through a RFC call, and assigned the formula to a condition type.
In this formula, if there was an error i am exporting the error message to a memory and importing the value from that memory to set a billing block in the user exit SAVE_PREPARE_DOCUMENT (MV45AFZZ).
The problem i am facing is that the formula is getting called many times uncessarily for eg. when you click pricing etc
and not necessarily updates the price all times. Actually the price is not updated when called from the following routine and is basically because of the following code.
Form: xkomv_bewerten.
IF xkomv-kofrm NE 0 AND wertformel EQ space AND komp-kposn NE 0.* rettkomv = xkomv*.
xkwert = xkomv-kwert. frm_kondi_wert-nr = xkomv-kofrm. PERFORM (frm_kondi_wert) IN PROGRAM saplv61a IF FOUND. xkomv = rettkomv.
ENDIF.
During Change Sales Order, because of this even a billing block is set before, it is getting cleared without updating the price.
Can somone help me with this?
Thanks.
Martin

I coded  this logic in a 906 pricing routine... and I did not have any problem bcoz of multiple hits... SAP is taking care of when to update values as per the calculations I am doing here....
if I remember right SAPLV61A is the main program which will be included with all sorts of code related to routines..
* Call the RFC wrapper in a new task
  CALL FUNCTION 'ZTEST'
    STARTING NEW TASK taskname
    DESTINATION 'NONE'
    PERFORMING ret ON END OF TASK
    EXPORTING
      comm_head_i           = wa_komk_i
      comm_item_i           = wa_komp_i
    EXCEPTIONS
      communication_failure = 1
      system_failure        = 2
      resource_failure      = 3.
  IF sy-subrc EQ 0.
    WAIT UP TO 1 SECONDS.
  ENDIF.
* Get the values from the RFC shared memory export
  CONCATENATE 'ZTESTVPRS' sy-uname INTO memid1.
  IMPORT lt_komp = comm_item_e
  FROM SHARED BUFFER indx(st) ID memid1.
  wa_komp_o = comm_item_e.
  IF sy-subrc EQ 0.
    DELETE FROM SHARED BUFFER indx(st) ID memid1.
  ENDIF.
* Get the Header level from RFC shared memory
  CONCATENATE 'ZTESTVPRS_H' sy-uname INTO memid2.
  IMPORT lt_komk = comm_head_e
  FROM SHARED BUFFER indx(st) ID memid2.
  wa_komk_o = comm_head_e.
  IF sy-subrc EQ 0.
    DELETE FROM SHARED BUFFER indx(st) ID memid2.
  ENDIF.

Similar Messages

  • User exists sales order pricing

    How to find out SALES ORDER PRICING USER EXISTS already predefined
    Thanks
    munna

    Hi,
    Check below link for all user Exists in SD.
    https://wiki.sdn.sap.com/wiki/display/ERPLO/SDUserexits
    User Exits for Price Determination
    Routine      - Module pool or function group - Include  - Description
    USEREXIT_PRICING_PREPARE_TKOMK      SAPLV60A      RV60AFZZ      This user exit allows you to copy additional fields for pricing in the TKOMK communication structure (header fields), which have not been provided in the standard SAP system. These fields can also be used for pricing in the billing document. This user exit is described in detail in the "New fields in pricing" section.
    USEREXIT_PRICING_PREPARE_TKOMP      SAPLV60A      RV60AFZZ      This user exit allows you to copy additional fields for pricing in the TKOMP communication structure (item fields), which have not been provided in the standard SAP system. These fields can also be used for pricing. This user exit is described in detail in the "New fields in pricing" section.
    USEREXIT_FIELD_MODIFICATION      SAPMV61A      MV61AFZA      You can use this user exit to adjust the display of individual lines in the condition screen by changing the display attributes of the screen fields. This does not include the display of subtotals. This user exit is also used in order processing.
    USEREXIT_FIELD_MODIFIC_KZWI      SAPMV61A      MV61AFZB      You can change the display of subtotals in the condition screen by changing the display attributes of the screen fields.
    This user exit is also used in order processing.
    USEREXIT_FIELD_MODIFIC_KOPF      SAPMV61A      MV61AFZB      You can adjust the display of subtotals in the condition screen to your requirements by changing the display attributes of the screen fields.
    This user exit is also used in order processing.
    USEREXIT_FIELD_MODIFIC_LEER      SAPMV61A      MV61AFZB      You can adjust the display of blank lines in the condition screen to your requirements by changing the display attributes of the screen fields.
    This user exit is also used in order processing.
    USEREXIT_PRICING_CHECK      SAPMV61      MV61AFZA      You can install additional checks to the standard checks of condition lines (e.g. maximum/minimum value).
    USEREXIT_PRICING_RULE      SAPLV61A      RV61AFZA      In the standard SAP system, it is predefined which condition categories and classes can be copied or recalculated per pricing type. You can change the predefined standard procedure for each pricing type.
    USEREXIT_CHANGE_PRICING_RULE      SAPMV61A      MV61AFZA      You can use this user exit to change the pricing type that has been predefined in the copying control table in billing.
    USEREXIT_XKOMV_BEWERTEN_INIT      SAPLV61A      RV61AFZB      This field is used in the formulas and therefore initialized before the loop for the pricing procedure starts.
    USEREXIT_XKOMV_BEWERTEN_END      SAPLV61A      RV61AFZB      Within a loop for the price components during pricing, specific values can be transferred into the communication structures in pricing to be further processed.
    USEREXIT_XKOMV_ERGAENZEN      SAPLV61A      RV61AFZB      In change mode, you can change the dynamic part of the condition record (KONVD) that is always redetermined (i.e. it is not stored in database table KONV).
    USEREXIT_XKOMV_ERGAENZEN_MANU      SAPLV61A      RV61AFZB      You can use this user exit to change the ready-for-input fields of the manually entered condition record in add mode in the condition screen.
    USEREXIT_XKOMV_FUELLEN      SAPLV61A      RV61AFZB      This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record.
    USEREXIT_XKOMV_FUELLEN_O_KONP      SAPLV61A      RV61AFZB      This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record. This may include subtotals, manually entered conditions or conditions that have been calculated with a formula.
    USEREXIT_PRICING_COPY      SAPLV61A      RV61AFZA      You can change the KONV fields for copied price components.
    Note: as of Release 4.6A, the display of the condition screen (screen 6201) has been converted from a full screen to a subscreen. The full screen is included in the SAPMV61A module pool, the subscreen, however, in program SAPLV69A. Therefore, instead of MV61AFZA and MV61AFZB, the user exits in LV69AFZZ should be used. For reference, see OSS note 313569.
    Best regards,
    Anupa

  • Sales Order Pricing User Exit Problem

    Hi,
    I am facing a problem related to coding in Sales Order pricing user exits. Scenario is as mentioned below:
    Based on Material Entered and Sold To in Sales Order, auto determination of a manual pricing condition happens. For doing this, coding has been done in USEREXIT_PRICING_PREPARE_TKOMP by changing XKOMV table. Auto determination of the manual price is happening properly.
    From Sales Overview Screen when user goes to the Conditions tab, Net Value is not getting calculated. When we navigate away to Schedule line tab and then come back to COnditions tab, Net Value is automatically getting calculated.
    AM i missing something in the coding part? As the data is getting populated automatically I guess some piece of code needs to be triggered. Can anyone shed some light into this.
    Thanks in advance,
    thunderans.

    Prabhu: After filling in XKOMV structure, I am calling FM PRICING. On doing this, the Sales Pricing is getting calculated but even then net value of order at header i.e VBAK-NETWR is not getting populated when we are in Sales Overview screen. When, I am getting into Conditions tab and coming back to Sales Overview screen, Net value is getting populated correctly. This portion of everything not getting populated at the same time is bothering me. The pricing conditon that I am  filling is a manual pricing condition.
    I put a breakpoint after FM PRICING which correctly populates XKOMV structure. How do I properly update Order Net Value in Sales Overview screen wihtout having to navigate to any other tab?
    Nicklas: I am looping at Order line within the user exit USEREXIT_PRICING_PREPARE_TKOMP and determining price. Once all line items are processed, I am using the FM PRICING for calculating Sales Prices.
    J@Y: Request to send me a bit more details into your approach.

  • Control Sales order Pricing Date with Delivery GI Date

    Is it possible to have a control that ensures the Actual GI date in a delivery is not more than a number of days from the sales order pricing date?

    Hi,
    To have restriction in actual GI date in transaction VL01N . Please find the user exit for VL01N , you can use one which are marked as bold . Kindly take the help of abaper to put the validation or logic as required.
    V02V0001   - Sales area determination for stock transport order 
    V02V0002   - User exit for storage location determination 
    V02V0003   - User exit for gate + matl staging area determination 
    V02V0004   - User Exit for Staging Area Determination (Item) 
    V50PSTAT  - Delivery: Item Status Calculation 
    V50Q0001   - Delivery Monitor: User Exits for Filling Display Fields
    V50R0001    -  Collective processing for delivery creation 
    V50R0002    - Collective processing for delivery creation 
    V50R0004    - Calculation of Stock for POs for Shipping Due Date List
    V50S0001    - User Exits for Delivery Processing 
    V53C0001    - Rough workload calculation in time per item 
    V53C0002    - W&S: RWE enhancement - shipping material type/time slot
    V53W0001   - User exits for creating picking waves 
    VMDE0001  - Shipping Interface: Error Handling - Inbound IDoc 
    VMDE0002  - Shipping Interface: Message PICKSD (Picking, Outbound) 
    VMDE0003  - Shipping Interface: Message SDPICK (Picking, Inbound) 
    VMDE0004  - Shipping Interface: Message SDPACK (Packing, Inbound) 
    Hope this will help you to resolve your issue!!!!
    Regards,
    Krishna O

  • How to restrict the Number of sales orders in theTCode:VL10A whil creation

    I'm creating the Delivery by using the batch job with program: RVV50R10C Here I need to restrict the number of sales orders numbers while creating deliveries for sales orders
    Like system should pick the sales orders (sales documents) from 1 to 100 OR 100 to 200
    Please advise me how to do it and what changes I need to do it

    Hi,
    Aslo, you can see Note 198137 - VL10: Customer-specific enhancements / user exits. As is for SO, check subroutine LV50R_VIEWG03. If cf_subrc = 1 thin this SO isn't seen in list.
    ***INCLUDE LV50R_VIEWG03 .
    *&      Form  POSTAB_VEPVG_FILL_USER
    FORM POSTAB_VEPVG_FILL_USER
         USING    IX_LIST_PROFIL    TYPE      SHP_VL10_LIST_PROFIL
                  IX_PARAMETERS     TYPE      SHP_VL10_PARAMETERS
                  IX_SELECT_OPTIONS TYPE      SHP_VL10_SELECT_OPTIONS
                  IT_ENQUEUE        TYPE      SHP_VL10_PACKAGE_T
                  IX_SD_ORDER       TYPE      SHP_VL10_SD_ORDER
                  IS_VEPVG          TYPE      VEPVG
         CHANGING CS_POSTAB         TYPE      SHP_VL10_ITEM
                  CF_SUBRC          TYPE      SYSUBRC.
    CF_SUBRC = 0.
    *  cs_postab-zzfield = ......              "add new field to List
    *  if xxxxxxx = yyyyyyy.
    *    cf_subrc = 1.                         "Exclude this index from List
    *  endif.
    ENDFORM.                    " POSTAB_VEPVG_FILL_USER
    I hope this helps you
    Regards
    Eduardo

  • How to restrict saving of a sales order without a material.

    Hi Gurus
    Please advice How to restrict saving of a sales order without a material. That is the system saves the order even if no item is assigned to it.

    Hi Raghu,
                 In standard SAP we can not do that. Even for some requirements of the customer this feature is required, specially in case of milestone billings, custom materials etc. client after saving the empty sales order they may create materials based on that sales order number.
                 If it is mandatary for u to save sales order only after the entry of the materials, u can try user exits or go for a code with the help of an ABAPer.
    Regards,
    Ravi Duggirala
    Edited by: ravi duggirala on Jun 20, 2008 11:11 AM

  • Country of Delivering Plant is not showing in Sales Order Pricing Analysis

    Hello All,
    I have created a new condition table with the field Country of Delivering Plant (KOMK-WKCOU).
    But in the sales order pricing analysis this field is not fetching the country of the plant (it is showing the Yellow color exclamation icon).
    This is  a standard field, I am not able to understand why it is not fetching this field.
    I have used the same field for tax condtions in my previous projects as well, there it worked well. 
    Even I have activated the KOMK structure in SE11 also, but still the same problem.
    Can anybody tell me how to resolve this issue.
    Thanks & Regards,
    Sreehari.

    Rightly suggested by Shiva.
    As plant determines at item level.
    So, instead of KOMK-WKCOU, field should append in KOMP.
    FYI, for checking any inconsistency in condition table, you can use TCode VK+C.
    Regards
    JP

  • Excise CIN amounts not updated in TAX field in Sales Order Pricing

    Hi,
    I am not getting the Excise Amount [CIN] i.e BED + ECS + SHE Cess in Tax field of Sales Order Pricing Procedure. only Sales Tax amount is showing.
    Plz let me know, where did I go wrong in the Configuration.
    Thanx in advance.
    with best regards
    Jabbar

    Abdul,
    What you have said is correct with regards to condition record creation, excise rate picking and its calculation.
    On clicking the "analysis" button in pricing screen (Sales item details --> condition -->) try to analyse for each condition type
    we can resolve it
    Check within the condition type whether you have entered condition category = D, it must be like this
    Cond. class   =  D Taxes
    Calculat.type  = A Percentage
    Cond.category = D Tax
    In Pricing Procedure Activate "Statistical" Indicator, it will definitely appear in the tax field.
    Regards
    Sathya

  • Sales order pricing conditions

    Can any one let me know what are the tables that are updated while working with sales order pricing conditions .......      r sales order conditions

    Hi Ali,
    VBRK     Billing document :header data
    VBRP     Billing document :Item data
    KONH      Conditions header
    KONP     Conditions items
    KONV     Procedure ( billing doc or sales order)
    KOND     Conditions (data)
    These tables will give sufficient information on Sales order pricing and its billing conditions etc.
    best regards
    Ramakrishna

  • Restriction of No. of Sales Orders

    Dear Gurus,
    How  can we restrict the no. of sales orders for a customer ie. if we want to only allow the system to create say 3 orders for the particular customer in a particular month, and the system should not allow  to create the fourth order for that month for that customer.

    Hi Hari
    In customization its not possible.
    Blocking /unblocking customer every month will be an extra effort for end user.
    Advisable is go for user exit.
    Take help of ur abaper, use User exit USEREXIT_SAVE_DOCUMENT.
    Write a code such that before saving sales order program will check VBAK table for the Sold to party (KUNNR) and number of sales orders created in SY-DATUM month i.e. current month.
    If its already 3 then display an error message and exit. ie not save that sales order.
    try and revert.

  • Call Off sales order

    Hello Gurus,
    I need to reserve  materials for a customer in my warehouse. As soon as the customer require partial quantity of his stock, I have to create a call off sales order referred to stock reserved and send the materials to him.
    Do you have any proposal on how to manage it?
    Thanks.

    Hi,
    You can reserve material by MB21
    Use movement type which is relevant for your business scenario
    Logistics >> MM >> Inventory mgt. >> Reservation
    Kapil

  • Sale order- Pricing -Access Sequence

    Hi Gurus,
    While creating Sale order, the price is picked from the Pricing procedure and Condition records maintained.
    In PR00- Material price and Customer-Material special price is maintained in VK11.
    So the system picks Customer Material combination price and the same we can see in the Item level conditions-Analysis for pricing and can also see it fetched record from where.
    So for this Client wants in the following way: POPUP MESSAGE
    At Sale order Warning Message that Price is taken from Which List- Normal Price List or Special Price List for Customer and Material combination
    Is there some way to do this?
    Thanks in Advance.
    Best Regards
    Sri

    Hi,
    U have to take ABAPER HELP  No doubt please use this input if tis use full .
    User Exits For Price Determination
    USEREXIT_PRICING_PREPARE_TKOMK (module pool SAPLV60A, program RV60AFZZ)
    This user exit allows you to copy additional fields for pricing in the TKOMK communication structure (header fields), which have not been provided in the standard SAP system. These fields can also be used for pricing in the billing document.
    This user exit is described in detail in the "New fields in pricing" section.
    USEREXIT_PRICING_PREPARE_TKOMP (module pool SAPLV60A, program RV60AFZZ)
    This user exit allows you to copy additional fields for pricing in the TKOMP communication structure (item fields), which have not been provided in the standard SAP system. These fields can also be used for pricing.
    This user exit is described in detail in the "New fields in pricing" section.
    USEREXIT_FIELD_MODIFICATION (module pool SAPMV61A, program MV61AFZA)
    You can use this user exit to adjust the display of individual lines in the condition screen by changing the display attributes of the screen fields. This does not include the display of subtotals.
    This user exit is also used in order processing.
    USEREXIT_FIELD_MODIFIC_KZWI (module pool SAPMV61A, program MV61AFZB)
    You can change the display of subtotals in the condition screen by changing the display attributes of the screen fields.
    This user exit is also used in order processing.
    USEREXIT_FIELD_MODIFIC_KOPF (module pool SAPMV61A, program MV61AFZB)
    You can adjust the display of subtotals in the condition screen to your requirements by changing the display attributes of the screen fields.
    This user exit is also used in order processing.
    USEREXIT_FIELD_MODIFIC_LEER (module pool SAPMV61A, program MV61AFZB)
    You can adjust the display of blank lines in the condition screen to your requirements by changing the display attributes of the screen fields.
    This user exit is also used in order processing.
    USEREXIT_PRICING_CHECK (module pool SAPMV61, program MV61AFZA)
    You can install additional checks to the standard checks of condition lines (e.g. maximum/minimum value).
    USEREXIT_PRICING_RULE (module pool SAPLV61A, program RV61AFZA)
    In the standard SAP system, it is predefined which condition categories and classes can be copied or recalculated per pricing type. You can change the predefined standard procedure for each pricing type.
    USEREXIT_CHANGE_PRICING_RULE (module pool SAPMV61A, program MV61AFZA)
    You can use this user exit to change the pricing type that has been predefined in the copying control table in billing.
    USEREXIT_XKOMV_BEWERTEN_INIT (module pool SAPLV61A, program RV61AFZB)
    This field is used in the formulas and therefore initialized before the loop for the pricing procedure starts.
    USEREXIT_XKOMV_BEWERTEN_END (module pool SAPLV61A, program RV61AFZB)
    Within a loop for the price components during pricing, specific values can be transferred into the communication structures in pricing to be further processed.
    USEREXIT_XKOMV_ERGAENZEN (module pool SAPLV61A, program RV61AFZB)
    In change mode, you can change the dynamic part of the condition record (KONVD) that is always redetermined (i.e. it is not stored in database table KONV).
    USEREXIT_XKOMV_ERGAENZEN_MANU (module pool SAPLV61A, program RV61AFZB)
    You can use this user exit to change the ready-for-input fields of the manually entered condition record in add mode in the condition screen.
    USEREXIT_XKOMV_FUELLEN (module pool SAPLV61A, program RV61AFZB)
    This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record.
    USEREXIT_XKOMV_FUELLEN_O_KONP (module pool SAPLV61A, program RV61AFZB)
    This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record. This may include subtotals, manually entered conditions or conditions that have been calculated with a formula.
    USEREXIT_PRICING_COPY (module pool SAPLV61A, program RV61AFZA)
    You can change the KONV fields for copied price components
    With best regards,
    venkataswamy.y

  • How to restrict status profile for sales order.

    Dear Friends,
    Pl suggest me for follwoing scenario
    ►     As per business process for tender/ institutional sales and exports, the order is complete once the complete delivery and invoicing for the same has been performed.
    ►     It was also observed that a sales order may be modified (material, quantity, price etc) even after complete invoicing of the same has been performed in SAP.
         The requirement is  Possibility to enable a control to restrict any amendments to the sales order after complete delivery and invoicing will be explored as per business requirements.
    Is there any solution above scenario without writing any code.
    Regards,
    Atul
    Edited by: atul thakur on Oct 28, 2009 5:09 AM

    Mr Atul,
    My understanding is, you don't want your user to be able to change the pricing and order quantity once the order is complete, i.e Delivered and Shipped.
    The status profile will not help you in the above scenario, Price/Quantity changes will not come up as Business transactions that can be controlled at Status profile.
    Standard SAP restricts the price changes to a completed item of the order, so no need to worry about this.
    But order quantity can be increased any time.
    So to restrict the user to increase the order quantity you need to use the User-Exits that SAP provided.
    Use the MV45AFZB user-exit program and form  FORM userexit_check_vbap to code this.
    Hope this helps you.
    Regards,
    Aj.

  • Restrict manual change in sales order with respect to quotation

    Hi All,
    The user use to create sales order with respect to quotation.  The user can able to change pricing as well as some header and item fields.  How can I restrict user for manual change in sales order expect some specific fields.
    Thanks.

    Hi Sunil,
    It is possible through configuration better you can post in sd forums.
    For the condition type settings , ensure that the manual entries is 'D'. it wont allow any changes in the order.
    Regards,
    Madhu.
    Edited by: madhurao123 on Aug 1, 2011 1:08 PM

  • SALE ORDER PRICING

    Hi gurus,
                  I  was created one sale order.While i want to give the Taxes mandatory.ie vat -4% 12.5%etc... and cst percentage give  to mandatory. is it possible?
    Regards,
    T.Murugu

    Hello Muruga,
    Yes you can maintain VAT and CST condition types as mandatory condition types in your pricing procedure through these settings
    -->Go to V/06 Transaction select your condition types then go in to the details of the condition type here you can find the field called Manual entries under Changes which can be tab
    Maintain this field as B   Automatic entry has priority
    -->Go to V/08 transaction then select your procedure then go in to the control data here you check the Mandatory for VAT and CST comdition types.
    Maintain the condition records properly to those condition types.
    Now system will take those values automatically while creating sales order.
    I hope it will help you,
    Regards,
    Murali.

Maybe you are looking for

  • Localization of labels in report

    Hi, I am trying to localize labels used in reports - for this i've created report in Crystal Reports 2008 designer. I am using JRC to edit the labels used in this report. Japanese character inserted appears as question marks in viewer. when i used th

  • Can't drag and drop bookmarks

    ''locking this thread as duplicate, please continue at [https://support.mozilla.org/en-US/questions/1049800 /questions/1049800]'' I can no longer drag and drop websites into my Bookmarks Toolbar, I have been able to do it for several years and now it

  • Define Sales Organization-Cust.inter.co.bill

    Dear All, While Defining  the Sales Organization there is a Field called Cust.inter-co.bill (Customer Intercompany billing) I had defined the Sales Organization as IT10 also I want to define Cust.inter.co.bill  field as IT10 and not any customer Numb

  • Strange happenings, ooh er?

    G4 PowerMac Dual 1.42 GHz processor GB DDR SDRAM OS X 10.4.11 Strange happenings with my beastie! Recently switching on to network my home set up and anticipating the perennial problem this G4 has in holing configurations, I opened system preferences

  • Date ranges - possible to use analytic functions?

    The next datastructure needs to be converted to a daterange datastructure. START_DATE END_DATE      AMMOUNT 01-01-2010 28-02-2010         10 01-02-2010 31-03-2010         20 01-03-2010 31-05-2010         30 01-09-2010 31-12-2010         40Working sol