Group condition calulation error

Hi Gurus
I am facing a problem while applying a group condition as discount at item level. Tried to search in the existing threads but no luck.
We have marked a discount condition as group condition with quantity scales.
Now if there are multiple line items in the sales order for the same material with different quantities, there is a strange system behaviour.
The line item with highest quanity gets the discount calulated with a conditon round diff populated (KOMV-KDIFF) with negative value in the sales order. Now when billing document is created for this sales order the same line item gets the condition round diff (KOMV-KDIFF) populated with positive value. This in turn results a difference in net value of sales order and billing document.
Pls advise what could be the possible cause and solution.
Thanks in advance,
Gaurav

Hi Nikhilesh
Thanks for ur early reply.
Yes there is a 1:1 relationship between sales order and invoice. Example is detailed below:
Line item Material Qty     Amount (GBP)
10           STL       6531   2220.54
20           STL       6770   2301.80
Now in the sales order, when the discount condition YGID is calulated on the above items @ 4.5%, discount value for line # 10 comes to 99.92 and discount value for line # 20 comes to 103.59 with -0.01 value in KOMV-KDIFF field.
Thereafter when billing document is created for this sales order, value in line # 10 for the discount remains same i.e. 99.92 but for line # 20 the discount value comes as 103.58 with +0.01 value in KOMV-KDIFF field.
This results in a difference in net values of sales order and billing document.
Regards
Gaurav

Similar Messages

  • Scale type D for group conditions

    Hi all,
    I am creating a new group condition and am trying to make it scale type D - graduated-to-interval scale. However because this is a group condition, SAP is giving me an error (Scale type 'D' cannot be used for group condition 'X').
    What is the best solution to this?
    I would like to give discounts based on:
    Sales quantity:
    1-100 = 15% off
    101-200 = 25%
    201-300 = 35%
    301-400 = 45%

    Hello
    This is b'coz your condition type with active Group condition Indicator. That means, here the system calculates the basis for the scale value from more than one item in the document.
    So, the scale D maintain in Scale basis for those condition type, does not go with it and throws an Error.
    Thus, if you want to scale functionality for condition type with group condition indicators use GrpCond.routine to maintain routine.
    Routine number for creating group key identifies a routine that calculates the basis for the scale value when a group condition occurs in pricing.
    For instance.
    Check routine 3-Mat.Pricing Group. This is an example of a structure of group key formula.  A structure of group key formula can be used to influence the basis the system uses when reading the scale of a group condition.  The formula is assigned to a group condition type in customizing.
    Formula '3' adds up the quantities / values of all of the line items in the sales document that have the same material pricing group (field KONDM) as the current sales document line item.
    A company defines a particular discount (condition type Z001) with scales based on weight.  When a sales order line item is priced that is eligible for the Z001 discount, the user would like the system to read the scale with not just the weight of the current line item, but the combined weight of all items in the sales document that have the same material pricing group as the current line item.  To accomplish this, the user defines condition type Z001 as a group condition and assigns structure of group key formula '3' to it in customizing.
    I hope this assist you.
    Thanks & Regards
    JP

  • Group condition summary by Year

    Sum({Detail_positive_responses.A8RPositive},{Detail_positive_responses.Survey Date}, "Monthly")
    I'm looking to be able to change this summary to Yearly.  I tried just typing "Yearly", and Tried "Annually" but get an invalid Group condition error.  is there a way to summarize by year?
    Thanks much for any insight you can provide.

    Hello,
    I'd ask in the SQL Server forums over here:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book:
    Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

  • CRM 5.0 IPC Group Condition

    Friends,
    We have a requirement to implement a group condition in CRM IPC 5.0.  We have it implemented in R/3 and it works fine.  We have replicated the code in the IPC and it is being hit.  The code is quite simple.  We copy to subtotal 1 a the net line value if the condition ZDC1 exists on the line.  We then want the group basis calculation to only include the totalling of those lines that had ZDC1.
    As I mentioned, this works fine in R/3.  In CRM it is including the value of all the lines regardless of whether there is a ZDC1 condition or not.  The Java code is getting hit and doing the transfer of the value to subtotal 1 at the right time. 
    Is there something else we should be setting up in the custom fromula for a group condition?  I see in the IMG in CRM where I can add formula and implementation attributes.  Is this something I need to do to get the group condition to work correctly?
    Regards.
    KB

    We put code in to write the condition out to a log file to ensure that the correct values were being calculated.  Once we did this, the condition started working.  No clue why.

  • Urgent ---group by syntax error

    This is my syntax as below.But it doesn't work.Does anyone can tell me what's problem ? or it have another way to solve this quuestion? thanks .
    sql syntax:
    select a.txdate,a.costype,sum(cosamt) * (1+a.cosrate) as costamount
    from sales_cost a
    where a.txdate between '2003-01-01' and '2003-02-01'
    group by a.txdate,a.costype;

    Although more specifics might have helped, I am assuming based on the title of the post: "urgent ---group by syntax error" and my test of the original code that I have identified the error. See the example below for how the original code produces a group by error and how the solution I provided executes without error.
    SQL> -- test data:
    SQL> SELECT * FROM sales_cost
      2  /
    TXDATE      COSTYPE    COSAMT   COSRATE                                                            
    03-JAN-03         1         3        .5                                                            
    03-JAN-03         1         4       .25                                                            
    03-JAN-03         2         4       .75                                                            
    04-JAN-03         3         3        .5                                                            
    04-JAN-03         4         4       .25                                                            
    04-JAN-03         4         4       .75                                                            
    6 rows selected.
    SQL> --
    SQL> --
    SQL> -- wrong:
    SQL> SELECT   a.txdate, a.costype,
      2             SUM (a.cosamt) * (1 + a.cosrate) AS costamount
      3  FROM     sales_cost a
      4  WHERE    a.txdate BETWEEN '2003-01-01' AND '2003-02-01'
      5  GROUP BY a.txdate,a.costype
      6  /
             SUM (a.cosamt) * (1 + a.cosrate) AS costamount
    ERROR at line 2:
    ORA-00979: not a GROUP BY expression
    SQL> --
    SQL> --
    SQL> -- correct:
    SQL> SELECT   a.txdate, a.costype,
      2             SUM (a.cosamt * (1 + a.cosrate)) AS costamount
      3  FROM     sales_cost a
      4  WHERE    a.txdate BETWEEN TO_DATE ('2003-01-01', 'YYYY-MM-DD')
      5                   AND     TO_DATE ('2003-02-01', 'YYYY-MM-DD')
      6  GROUP BY a.txdate,a.costype
      7  /
    TXDATE      COSTYPE COSTAMOUNT                                                                     
    03-JAN-03         1        9.5                                                                     
    03-JAN-03         2          7                                                                     
    04-JAN-03         3        4.5                                                                     
    04-JAN-03         4         12                                                       

  • Getting "ORA-00979: not a GROUP BY expression" error in Inline query

    Hello all,
    The following query when run in SCOTT user gives "ORA-00979: not a GROUP BY expression" error.
    If I remove the TRUNC function from the outer query's group by clause, then it fetches
    (My actual query is something similar to the following query. I have given emp, dept tables for convenience's sake)
    select e.empno,e.ename, AVG(e.SAL), trunc(e.hiredate),
    (select sum(sal) from emp
    where hiredate = e.hiredate) salary
    from emp e
    group by e.DEPTNO,e.EMPNO,e.ENAME, trunc(e.hiredate)
    Pls suggest how this error can be avoided.
    Regards,
    Sam

    Why not this?
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.02
    satyaki>
    satyaki>
    satyaki>select e.empno,
      2         e.ename,
      3         AVG(e.SAL),
      4         trunc(e.hiredate),
      5        (
      6           select sum(sal)
      7           from emp
      8           where hiredate = e.hiredate
      9        ) salary
    10  from emp e
    11  group by e.DEPTNO,
    12           e.EMPNO,
    13           e.ENAME,
    14           e.hiredate;
         EMPNO ENAME      AVG(E.SAL) TRUNC(E.H     SALARY
          7934 MILLER         1887.6 23-JAN-82     5583.6
          7698 Glen             1848 23-JAN-82     5583.6
          7788 SCOTT          598.95 19-APR-87     598.95
          7900 JAMES          1379.4 03-DEC-81    6650.16
          7521 WARD           226.88 22-FEB-81     226.88
          7599 BILLY            4500 10-JUN-09       4500
          2222 sp               1200 14-SEP-09       1200
          7902 FORD          5270.76 03-DEC-81    6650.16
          7566 Smith            1848 23-JAN-82     5583.6
          7654 MARTIN           1815 28-SEP-81       1815
          7839 KING             7260 17-NOV-81       7260
         EMPNO ENAME      AVG(E.SAL) TRUNC(E.H     SALARY
          7844 TURNER           2178 08-SEP-81       2178
          7876 ADAMS          159.72 23-MAY-87     159.72
    13 rows selected.
    Elapsed: 00:00:00.03
    satyaki>Regards.
    Satyaki De.

  • Analytical Services failed to get user's parent group tree with Error

    Hi,
    We have a frequent errror during our weekly batch for an application.
    The context:
    - Essbase Administration Services we are using is version is 9.3.1.
    - 8 applications are calculated during the week-end. The scripts executed are exactly the same for the 8 applications.
    - For example let's say that 5 scripts are launched during the night in the batch for each application (script 1, script 2 ... script 5)
    - App1 and App2 are launched alone and before the 6 others applications as these applications database are 3 x bigger (App1 is calculated alone, then app2 is calculated alone, then app3 to app8 scripts are launched in the same time).
    The issue :
    - We don't see any issue for app3 to app8, the calculation are executed without any problem from script1 to script5.
    - But we have an error in App1 and App2 log when the bath execute script 4 and we see the following error in the server log **
    "Analytical Services failed to get user's parent group tree with Error".
    (** : we don't see any log for script 4 in the application log - it's like the server bypass script 4 to go directly from script 3 to script 5 )
    Nothing special is done in script 4 but just an aggregation of the Year dimension (using a @SUM(@RELATIVE(Year,0)) calculation.
    I think that there is may be a synchronization error with Shared Services but what is strange is that it's always for the same script 4 and the batch is launched at different time every week-end.
    Can the issue be linked to the size of the database of applications (8 Gb) and difficulties for the processor to executes aggregation in a large database volume ?

    Hi,
    According to your description, my understanding is that the error occurred when sending an email to the user in workflow.
    Did you delete the existing Connections before setting NetBiosDomainNamesEnabled?
    If not, I recommend to delete and recreate your AD connections, then set NetBiosDomainNamesEnabled to true.
    Or you can delete the original User Profile Service Application and create a new one, then set the NetBiosDomainNamesEnabled to true and start the User Profile Service Application
     synchronization.
    More reference:
    http://social.technet.microsoft.com/wiki/contents/articles/18060.sharepoint-20xx-what-if-the-domain-netbios-name-is-different-than-the-fqdn-of-the-domain-with-user-profile.aspx
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Shipment Cost: Group Condition Type calculated on a special weight...

    Here is the scenario: A shipment (truck) combines multiple deliveries, grouped on a stage when same destination (happens often).
    A condition per LB is to be calculated on the cumulated weight per destination (per stage) BUT not simply on the gross weight, but on the heavier of 2 special weights: the business here uses a special formula according to the packaging, and it gives 2 weights (stored in Z fields of LIKP), an actual weight and a cubic weight.
    The purpose is to identify for each delivery the heavier weight and to use cumulated the weight across the deliveries to the same destination to calculate the per CWT cost.
    This is my first issue: the condition type is defined at Delivery calculation base, Calculation Type Multi-dimensional, and as a group condition). How do I define to use the cumulated of each delivery heavier weight ? In the Scale for condition type view, I used the scale basis D Gross Weight (which is not right..), there is also a field for a Scale Base Value formula, I wondered if that is what I should use..
    My 2d issue: once the cost is calculated, I have to re-distribute it on the deliveries as per the proportion of their heavier weight compared to the total weight used for the calculation…Should that be an alternate Condition Base Value formula in the pricing procedure (where xkwert would be….the heavier weight….would that be then a new Z field to be filled in by the user exit determing the heavier value) ??
    Thanks a lot, it is a tough one, I know...who is the best ever shipment cost pricing consultant ? !

    Hi Guys
    Unfortunately I do not think that you will get an answer now. Either your question is not simple or we do not know.
    So in the interest of keeping the Forum tidy and easier to surf through could you please close your thread and either try one of the other forums or try another post. I do not think that most people will bother to look this far back anymore.
    Sorry I cannot help as I would if I could.
    Regards
    Frenchy.

  • Get Delivery date(EKET-EINDT) in MM Pricing routine(group condition)

    Hi All,
    I have created an MM pricing routine RV65A092 in VOFM. So when creating PO(ME21n), this routine will trigger..
    Now the problem is I need EKET-EINDT for grouping condition. It was mentioned to call program SAPLMEPO and get EKET data.
    Please help me how to get delivery date in that routine  which is filled in Item level during PO creation
    Thanks
    Ram

    Hi Ram,
    For SD you have the SAP Note 531835 - Using field PSTYV in the condition access. For MM is simmilar, although you must use the enahncements. Instead use the userexits that note says, use the enhancement LMEKO001 (EXIT_SAPLMEKO_001) to populate fields ZZ in KOMK and LMEKO002 to populate KOMP.
    I hope this helps you
    Regards
    Eduardo

  • Set up pricing - Group condition doesnt works

    Hi Gurus,
    Please provide me your inputs.
    Can SAP determine the sales price as described in the below two cases.
    Case 1:
    Sales price for material M1, from 01.01.2011 u2013 31.07.2011
    Quantity         Price
    0                         100
    25      90
    100      75
    Sales price for material M1, from 01.08.2011 u2013 31.12.9999
    Quantity      Price
    0      105
    25      94
    100      78
    Sales order (note the difference in pricing date)
    Total quantity = 38, second scale should be used
    Item      Material      Pricing date      Quantity      Price
    10      M1      31.07.2011      17      90
    20      M1      31.08.2011      21      94
    Many Thanks for your answers
    Sharan

    Dear Sumanth,
    Thanks a lot for your answer. I am relatively new to this subject. Please elaborate your answer for me to maintain the settings in copy control.
    The scenario is - New condition type ZPR0 is created with group condition. And the scales are maintained as mentioned in the problem.
    Lets say Order is created on  date - 23/11/2011 with two lines
    Line 1 - Material M1 - Quantity 17 - Pricing date 31.07.2011(Maintained at item level)
    Line 2 - Material M1 - Quantity 21 - Pricing date 31.08.2011(Maintained at item level)
    With scales maintained, because of the pricing date , system picks up individual scales and it doesnt accumulates the quantity. How to tell system to accumulate quantity and then check scale based on the pricing date.
    Thanks for your help again,
    Sharan

  • Use of group conditions in subtotal KZWIW

    Hi,
    I have a specific trouble in the use of group condition in sales order and billing.
    Condition Z001 is a group condition and should also update field kzwi2 as base information for condition Z002
    Condition Z002 is not a group condition and is  calculated based on informations stored in kzwi2. 
    When creating a document, the field kzwi2 is not updated directly (because Z001 is a group conditions) and the price should be redeterminated manually in order to allow the document to be considered as complete.
    Is there any settings that can avoir the manual recalculation of the price?
    Many thanks in advance,
    Nathalie Winand

    Hi Nathalie:
    See Note 1022966 - FAQ for the 'Subto' column (KZWIW) in the pricing procedure
    Perhaps it will help you
    Regards
    Eduardo

  • Not a group by column error message - cursor sharing

    Hi,
    Our database is Oracle 11g.
    We faced problems about some sql's. These sql's were running in Oracle 10g.
    Our sql statements are like the below query:
    SELECT COLUMN_A,COLUMN_B,COLUMN_C,
    TO_CHAR(OPERATION_DATE,'DD/MM/YYYYY'), CUSTOMER_NAME || '-' || CUSTOMER_SURNAME,
    DECODE (IS_MANAGER, 0, ' Manager', 'Employee')
    SUM(TOTAL), SUM(AMOUNT), AVG(SALARY),
    FROM TABLES
    GROUP BY COLUMN_A,COLUMN_B,COLUMN_C,
    TO_CHAR(OPERATION_DATE,'DD/MM/YYYYY'), CUSTOMER_NAME || '-' || CUSTOMER_SURNAME,
    DECODE (IS_MANAGER, 0, ' Manager', 'Employee')
    ORDER BY COLUMN_A,COLUMN_B,COLUMN_C,
    TO_CHAR(OPERATION_DATE,'DD/MM/YYYYY'), CUSTOMER_NAME || '-' || CUSTOMER_SURNAME,
    DECODE (IS_MANAGER, 0, ' Manager', 'Employee')
    When we remove order by or when we disabled cursor sharing, problem is fixed.
    I think that sql looks correct. Why we are taking not a group by column error message?
    How can we fix this problem without changing querys( we have other reports which gives same error message) or disabling cursor sharing?
    Thank you, Bye

    Dear,
    SELECT   column_a
            ,column_b
            ,column_c
            ,TO_CHAR (operation_date, 'DD/MM/YYYYY')
            ,customer_name || '-' || customer_surname
            ,DECODE (is_manager, 0, ' Manager', 'Employee')
            ,SUM (total)
            ,SUM (amount)
            ,AVG (salary)
        FROM TABLES
    GROUP BY column_a,
             column_b,
             column_c,
             TO_CHAR (operation_date, 'DD/MM/YYYYY'),
             customer_name || '-' || customer_surname,
             DECODE (is_manager, 0, ' Manager', 'Employee')
    ORDER BY column_a,
             column_b,
             column_c,
             TO_CHAR (operation_date, 'DD/MM/YYYYY'),
             customer_name || '-' || customer_surname,
             DECODE (is_manager, 0, ' Manager', 'Employee')Here you are grouping by
    DECODE (is_manager, 0, ' Manager', 'Employee')What does represent the is_manager? it is a function ? it might be that you hit one of the group by restriction such as select are not allowed into the group by clause
    Best regards
    Mohamed Houri

  • Regarding group condition

    hi friends
    1.wht is header condition and group condition?
    2. what r the condution types for header and group conditions?
    3. give me some examples for useful of header condition and group conditon?
    plz reply me
    thanks in advance

    Dear Venkata Ramana
    1)  Header Conditions
    Header conditions are entered manually in order processing. Automatic pricing does not take header conditions into account; you can not create condition records for them in the standard system.  R/3 includes the following header conditions:
    - Percent discount (HA00)
    - Absolute discount (HB00)
    - Freight (HD00)
    2)  Group Conditions
    Please check this help link
    [Group Conditions |http://help.sap.com/saphelp_47x200/helpdata/en/1c/8c8b518d8c11d199a30000e8a5bd28/frameset.htm]
    thanks
    G. Lakshmipathi

  • Group Condition at Header on Scale basis

    Hi,
    I want to know, how system assign the corresponding condition amount of header to individual item .
    in our system
    e.g in our system we have condition ZD22 for packainf and forwading charges as fixed amount and scale is qty
    i have add Rs 300 at header  and in my PO there are 3 item  having qty,   100 ,100  and 2500   after adding condition amount at header  as 300   when i checked the on individual item  i found for first two item  it  75.89  each  and for third item  the amount is  148.22
    I want to know how system divides the header amount to individual item  if scale is qty.
    regards,
    zafar

    Hi
    Kindly note this scenario
    Condition value XXXX    180
    Marked as Header + Group Condition
    PO
    Item 1       qty   1           Price 300
    Item 2       qty   1           Price 100
    Item 3       qty   1           Price  50
    Ratio = Based on value =Qty*Value
    300:100:50   = 6:2:1
    Therefore XXXX distributed to items as   120 , 40,20

  • Creating Protection Group Fails with Error:360 The operation failed due to a virtual disk service error

    Hello
    I'm setting up a DPM server (2012 R2) at a remote site; everything goes well with no issues until a protection group is created, at which point I get the following error;
    Create protection group: Protection Group 1 failed:
    Error 360: The operation failed due to a virtual disk service error
    Error details: The system cannot find the file specified
    Recommended action: Retry the operation.
    The environment is as follows;
    - Virtual Machine Running Server 2008 R2 Fully updated
    - Storage Pool is an iSCSI connection Thick Provisioned 1TB GPT and shows in Disk Management with no issues.
    - Have connected to Session 0 (console) 
    - Error log shows The provider did not receive a Plug and Play service notification for the volume. volume=10  for the VDS Dynamic Provider
    Can Anyone Help?
    Thanks
    .Adam Langdon

    Hi,
    Disk defrag is initiated when a volume shrink is attempted. See if there is any problem defragging a volume and correct any problems doing that.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT]
    This posting is provided "AS IS" with no warranties, and confers no rights.

Maybe you are looking for

  • Need help getting music purchased with one apple id to my new phone that has a new apple id

    I used to have an ipod nano under one apple id.  I stopped using the nano and let my daughter use that apple id when she purchased an ipod touch.  I recently got an iphone and would like my music library on my phone.  I created a new apple id for my

  • Goal Line Chart in Flex

    Hello All,   I'm creating a project that consists of flex chart componnents. However, client requires a goal line in the charts. I've googled allday on this and cant seem to find any samples. Is this even possible? If so, can you please lead me to th

  • Error Log entry Unable to write file with XML Saver

    Hi all, I have just encountered the following problem. I am saving a XML file using the XML Saver. Another BLT reads the file, changes something, and saves it again with the same name. The file is saved, but the NetWeaver SAP Log gives the error "Una

  • Can't build jade package, /usr/bin/ld: cannot find -lsp

    Hello everyone (my first post here ) I installed Archlinux because of it's ease of use when compiling the whole system (compared to Gentoo and others), I have my first install of Archlinux, and began to compile all packages in the system using the pa

  • List of the available parameters for the various URL options

    Hi all, Where can I find a list of all of the available parameters for URL options such as OMRET0=XXXXX (OMRET0=ActivitiesList or OMRET0=Homepage). I've created a copy task weblink and want the destination after the copy is saved to be the newly crea