SAP query in Grand Totalling in SQ01 wrongly calculation

Dear All,
I have created a  SAP query for getting few ledger accounts data in the clients specified format.
But I am having a problem, that debit and credit amounts are getting added in the 'Total' field.
The credit amounts are not getting substracted from the debit amount.
For eg :
CoCd     G/L          Year     DocumentNo      Amount in LC     Crcy     D/C
1000     4071101020          2007     9600000002     3,300.00          H
1000     4071101021          2007     9600001413     40,000.00          S
1000     4071101022          2007     8000000000     2,020,012.80     H     
Grand Total                                                                2,063,312.80     
Where as total should be -1,983,312.80, where 'H' is credit and 'S' is debit.
rgds

Hiya,
You may need to:
1. Either group by the Debit/Credit Indicator (SHKZG), create two subtotals for each and then subtract one from the other, or,
2. Multiply the Credits by -1 (again use the Debit / Credit Indicator to sort this for you) and then get a total field.
This is an inbuilt problem with queries (SQ01, SQVI, etc.).
Cheers.

Similar Messages

  • SAP Query - Joining two tables - SQVI, SQ01

    Hi gurus,
    Can anybody send word documentation of joining any two tables. (Variant creation). Simple and easy to understand with screen shots step by step procedure.

    Got the doc from Google.

  • Grand total on a Percentage calculation

    Guys,
    I have report where i am calculating % active and % inactive aircrafts for two different types. The data is as below
    Columns : CustomerType Active Active % Inactive Inactive% Total
    Data : COMMERCIAL 277 38.96 434 61.04 711
    CORPORATE 4593 48.42 4892 51.58 9485
    SUM : 4870 87.38 5326 112.62 10196
    The Active% and Inactive% are calculations as below
    Active % = ( Active/Total )*100 (i.e (277/711) * 100 = 38.96 and (4593/9485)*100 = 48.42 )
    Inactive % = ( Inactive/Total )*100 (i.e (434/711)*100 = 61.04 and (4892/9485)*100 = 51.58 )
    The sum is caculated by the Totals functinality in discoverer , the sum for Active 5 and Inactive % is being calculated incorrectly.
    Is it possible to make discoverer to calculate the sum for Active % as ( 4870/10196 ) * 100 and for Inactive % as ( 5326/10196) * 100 ??
    Please help.
    thanks

    Hi,
    That is how the Discoverer totalling should work. Ensure that you are using SUM rather than CELL SUM. Also try including an aggregate function in your calculations, i.e. so that your active calculation is SUM(active) and your total is SUM(total) so that your Active % is (SUM(active)/SUM(total))*100
    Rod West

  • How can I define Double Click Processing in SAP Query ?

    The first question is : How Can I define drill-down for SAP Query report ?
    The second one :  How can I program Double Click in SAP Query report for Different columns like ALV Grid processing ?

    you can attach a repot or at tcode etc in an SAP query using report assignment in SQ01 but as far as i remember you cannot attach multiple reports.
    regards,
    khusro habib

  • How to Substr field in SAP Query.

    Dear Developer,
    How to substr any field in SAP Query ?
    Regards,
    Ujed.

    Hi Ujed,
    if SUBSTR stands for substring, then possibly your question may be how to get the substr method as konown in languages like php in ABAP.  If SAP Query points to a SAP query as created in transaction SQ01, then you should explain what you want to achieve.
    Note: Better ask a specific question and get am answer you can or which is already generalized.
    If I need a substr function, I'd create a functional method for that:
    method substr
      importing
        anyfield type any
        offset type i
        length type i
      returning substring type string.
      try.
        substring = anyfield+offset(length).
      catch cx_root.
    * handle error
      endtry.
    endmethod.
    Regards,
    Clemens

  • Standard variant of SAP query is loaded automatically

    Hi!
    I have created SAP query and standard variant via SQ01.
    When I run my query (via transaction) values of variant are loaded automatically in a selection screen and in my case I need empty selection screen at the beginning and values should appear in a selection screen only after choosing a variant, but not before this.
    Probably it is something about attributes of variant? Any ideas?
    <b><REMOVED BY MODERATOR></b>
    Mindaugas.
    Message was edited by:
            Alvaro Tejada Galindo

    Hi,
    What type of custom transaction code did you create?
    Was Dialog Transaction or Report Transaction?
    For your purpose, you can create with dialog transaction with specifying program name and screen number. If you want to execute with specific variant then choose report transaction.
    Regards,
    Ferry Lianto

  • OBIEE11g Grand total not summing up correctly

    hi all,
    I have to display the grand total from the foll calculation : (total po numbers - total Recd on time PO numbers) / total PO numbers.
    To get the total PO numbers - in the Edit formula - COUNT(PO numbers) and aggregation rule is set to SUM - this gives total correctly. eg : count of Total PO numbers - 15
    To get the total Recd on time PO numbers-- In the edit formula fields - COUNT(Recd on time PO numbers) and aggregation rule is set to SUM . This also shows hte total correctly. Eg : Count of total Recd on time PO numbers 12
    Now I do the division (Recd on time PO numbers/ total PO numbers ) Again in the Edit formula field SUM( COUNT(PO numbers))/ SUM(COUNT(Recd on time PO numbers)) - This gives incorrect results. output is 12.
    12/15 should be .8 but it shows 12.
    I am not sure why its not doing the calculation correctly.
    Is there any way I can achieve this ?
    Thanks
    OBI_user

    * 1.00 => http://gerardnico.com/wiki/dat/obiee/int

  • Incorrect Grand total

    Can anyone pls tell how to fix the issue of Incorrect Grand total ?
    Especially for calculated values.If any formula is applied then the grand total should also be executed with the same formulas.
    Pls help

    Thanks Madhan and MMA.
    Madhan
    I've already tried adding <ReportAggregateEnabled>true</ReportAggregateEnabled> and even after restarting the services no use. My server version is 10.1.3.2.1.Is there any alternate solution?
    MMA
    I tried with Server complex aggregate also.But no use.
    Pls suggest if there is any alternate solution.

  • Percentage in Totals / Grand Totals

    I have 2 columns on a report (in reports builder) that have numbers - total touched & total count. I am calculating the percentage done with the following formula: ROUND(((PP_TOUCHED / PP_TOTAL) * 100),2). This works fine for the detail lines, but I can't get the correct percentage in the grand totals.
    Also, when I use the above formula and one of the numbers is zero, I get an error.
    Kris

    I have 2 columns on a report (in reports builder)
    that have numbers - total touched & total count. I
    am calculating the percentage done with the following
    formula: ROUND(((PP_TOUCHED / PP_TOTAL) * 100),2).
    This works fine for the detail lines, but I can't
    get the correct percentage in the grand totals.How are you calculating the percentage for grand total? Create a formula column at report level and use summary columns in the formula to calculate percentage.
    Also, when I use the above formula and one of the
    numbers is zero, I get an error.
    It may help:
    ROUND(decode(nvl(PP_TOTAL,0),0,((PP_TOUCHED / PP_TOTAL) * 100)),2)

  • Difference between 2 sub-totals in SAP query

    Hello Experts,
    Is there any possibility to find out the difference between 2 sub-totals and display it at the bottom of the ALV output( like total) in SAP Query using SQ01.
    For example: see below example(Request you to paste the below in an excel sheet for more readability).
    PRZ     25.05.2011     A 007 008 01 15     10     EA           0,00     INR          0,00     INR          2,00     INR               0,00     INR
    PRZ     27.05.2011     A 007 008 01 00     1     PC          10,00     INR          0,00     INR          0,20     INR               0,10     INR
    PRZ     27.05.2011     A 007 008 01 00     1     PC          10,00     INR          0,00     INR          0,20     INR               0,10     INR
    Sub-total               10     EA     20,00     INR          0,00     INR     2,40     INR     20     INR
                   2     PC                                        
    DRP     26.05.2011     WDB2020261X744924     1     PC          60,00     INR         50,00     INR         30,00     INR               0,00     INR
    DRP     31.05.2011     WDB2020261X744924     1     PC          60,00     INR         50,00     INR         30,00     INR               0,00     INR
    Sub-total               2     PC     120,00     INR     100,00     INR     60,00     INR               0,00     INR
    Grand totals               10     EA     140,00     INR     100,00     INR     62,40     INR     20     INR
                   4     PC                                        
    In the same way as Grand total, Is there any possibility to find out the difference between the 2 sub-totals and display at the bottom after the Grand Totals row.
    Please let me know if there is any possibility for the same.

    Just to update on my question.
    In the sub-totals line you can see that there is 20,00 INR value which is summation of the above fields present in individual line numbers above. And the same way for the rest of the fields as well.
    After calculating the sub-totals in this manned, I need to find out the difference between the subtotals and display it at the bottom of the output.
    Please let me know if this is possible.

  • Sap Query custom field assigned to wrong field group (in extract)

    Hello,
    I want to add an extra field to InfoSet /SAPQUERY/MEBANF at EBAN level. I added a field in a normal way:
    I fill it with a constant value. I adapted Sap Query:
    In result, I got the value in new column but only for certain rows:
    The value is there only for EBAN rows which have EBKN entries related.
    I checked the program, and my new field is added to field group %fg07 with some other fields from table EBKN (not EBAN):
    Fields from field group %fg07 are inserted to extract only in event get EBKN, so if there is no entries in EBKN, my field will not be inserted into extract:
    I tried a lot of things (assigning my field to new field group in InfoSource, adding a field on EBKN level). I can say that every extra field created by me was assigned to field group &fg07.
    Am I doing something wrong?
    The target is to add new field in the document overview panel in ME2xN transaction. I know that there is user-exit EXIT_SAPLMEQUERY_002 where I can specify a Z* query. But this solution requires a copy of InfoSet and query to Z*. Adding a new field to standard Sap query is the fastest way.
    Message was edited by: Rafal Matuszewski
    Now I tried to append EBAN table with my Z* field. I regenerated InfoSet and query but the result is still wrong:
    insert EBAN-GSFRG into %fg06.
    insert EBAN-ZUGBA into %fg06.
    insert EBKN-VBELN into %fg07.
    insert EBKN-AUFNR into %fg07.
    insert EBKN-KOSTL into %fg07.
    insert EBAN-ZZDELIV_DATE_MRP into %fg07.   <-- here again the Z* field is assigned to field group related to EBKN table

    Thanks Sandra

  • SAP Query (SQ01) - create and save queryies

    Hi Expert;
    We wanted to implement SAP query reporting (SQ01) tool, and already developed custom HR infoset and user groups and transported to QAS.  We experienced the problem that we can not directly "save" any queries in SQ01. We pretty much have the client opened up and set at "Changes without automatic recording".  But keep getting a "transport object create" dialog upon "save" query.  But in Adhoc (PQAH), we don't encounter same problem.    We wanted our users be able to create and save any queries directly without creating any local objects. Is there another setting that needs to be set? 
    Thanks for any information that you can provide.  Points will be awarded.
    Helen

    Hello Helen,
    in SQ01 you can save queries like in HR Ad Hoc Query (or Infoset query as it is called outside HR).
    However this is only possible in the "Standard Area" not in the "Global Area". However as Ad Hoc Query is based on the SQ0x basics it only hides this effect.
    If you are doing HR specifics you should consider the documetnation on the special HR switches:
    http://service.sap.com/~form/sapnet?_SHORTKEY=01200252310000076208&
    In general if you are new to the topic you should consider the courses BC407 for Query Basics and HR580 for reporting in HR.
    Also to get a feeling for the different types of reporting with the InfoSet Query you can look at the following documentation:
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/a8/2e7237a323427ee10000009b38f8cf/frameset.htm
    HR Reporting Tools -> Sap Query -> InfoSet Query -> Calling InfoSet Query.
    Or you can book a special training if you need a contact let me know your email adress
    Best regards,
    Michael

  • How to Hide Empty Column In SAP Query (SQ01)

    I was crated a report in sq01 based on business requirements , but there are some fields without any content , in sq01 if you select one of output fields in the right side of the screen in the left side you can see  "List Fields" T in the list fields there is a check box , the name is "Only display field if <> 0 " , but when i check it, it doesn't work  , guys is there any one to help me to eliminate column without content , in the result of sap query (sq01) ??

    Please give reference (or hyperlink) to 10 Useful Tips on Infoset Queries (original document)
    Regards,
    Raymond

  • Sap query report sq01

    Hello all
    I want to create new sap query in sq01 , the requirement is like this eg:- customer a/b/c , I want to generate the  list of last created sales order for the customers a/b/c here I have given 3 customers but I have to execute for 1500 customers
    If customer A creates 3 sales order in that 3 sales orders I want to pick last sales order on 12.09.2010 / 15.09.2010 /17.09.2010 in that I wnat to pick the last sales order 17.09.2010
    So in query report sq01 how to create, plz provide step by step procedure with this logic
    With regards
    Rahul
    Moderator Message: Search.
    Edited by: kishan P on Sep 17, 2010 4:47 PM

    Hi,
      better search in Google with the keyword 'SAP query tutorials',
    you will get lots of tutorials in the net with step by step approach.

  • SAP Query SQ01 column limitation issue

    Hi
    At SQ01, I have created a number of custom reports via SAP Query.
    Its a great tool and all, but I am running into a problem where there is a 255 character limitation when I create a Statistics view (where it summarizes values by characters I choose).
    In the SQ01 Query screen, this is controlled by the columns field under the heading list format  and if I list too many objects, I get a message stating report has exceeded 255 character limitation.
    Is there any way I can modify this value, so I can exceed it (say 500?)?
    For us, we use many query reports in our daily reporting so it would be worth modifying.
    If anyone has any info on this, please advise (or feel free to PM me!)
    Regards
    Ken

    Naimesh,
    Thanks for your reply.
    How can I accomplish this? And will it still show the data one the same screen?
    Regards
    Ken

Maybe you are looking for

  • HT2729 How can I put songs into the album they came from but were split because of multiple artists on a tune?

    I need help in finding out home to combine songs from the same CD into one Album. When putting CD into the iMac, it auto loads into iTunes. If the artist is singing duet and the songs show more than one artist, it gets separated in iTunes. I want to

  • Downgrade to Win 7 Pro on HP ENVY 15 K058CA Need drivers

    Got Win 7 installed, all went well, boots and runs. Need drivers for Network, Chipset, USB, and some unknowns. Can anyone point to them. Have tried the Intel HM87 Express drivers they didnt do much and the Intel ethernet drivers with same resuts. Any

  • How to Make Sent and Deleted Messages Get Saved in the Folders of My Choice

    On my iPhone, under Mailbox Behaviours, I can select specific mailboxes on the server where the Sent, Deleted and Draft messages will be saved. However, I could not find this feature in Mac OS 10.6.2's Mail application; instead, these mails are saved

  • SQL Functions in eScript

    Hi We have a Requirement to work Siebel with MS-Access Having an Idea about the Functions which will be used in VB Script for these kind of requirement *1. SQLOpen ("DSN=SampleVBC; UID=SADMIN; PWD=SADMIN")* *2. SQLExecQuery (connection, Querystr) 'Re

  • Report to MS Power Point

    Hi Experts! We have a requirement where we need to generate a report output in MS Power Point. Can somebody please provide your inputs and suggestions on this? Are there any test programs to check on the same? Your help is highly appreciable. Thanks