SAP query. Subtotals with information.

Goodmorning,
I hope this is the right forum to post this thread.
I made a query that shows sales information. When I fill in a customer number and a period, I get a list with all the articles they bought.
Some articles are more then one time sold in a period. I want the sum of the articles in one row. I made subtotals and then used the option to only show the subtotals. The problem is now that information like specification, brand and type is not visible in the list. How can i include this information?
Thanks in advance!
Greetings,
Thomas

If you use the Group by clause in your select, the static data (inside the group) can be displayed if you use a grouping function, the most plausible way the min() function.
Like this:
SELECT T0.[ItemCode], min(T0.[Dscription]), sum(T0.[Quantity])
FROM RDR1 T0 GROUP BY T0.[ItemCode]

Similar Messages

  • SAP QUERY/INFOSET with OUTER JOIN

    Hi,
    I have created an infoset (SQ02) using two tables for SAP query.
    Table: AGR_TEXTS. Fields: AGR_NAME, SPRAS, LINE, TEXT.
    TABLE: AGR_FLAGS. Fields: AGR_NAME, FLAG_TYPE, FLAG_VALUE.
    Joined these two tables using outer join.  Defined the join condition as AGR_NAME = AGR_NAME.  Saved and Generated the infoset.
    Created SAP Query (SQ01) using the above created infoset.
    In the basic list,
    Marked AGR_NAME (AGR_TEXTS), TEXT, FLAG_VALUE as listed fields.
    Marked AGR_NAME (AGR_TEXTS), SPRAS, LINE, FLAG_TYPE as selection fields.
    Save the query.  When execute the query provided the inputs for all the selection fields in the selection screen as given below:
    AGR_NAME=Z*
    SPRAS=E
    LINE=00000
    FLAG_TYPE=LICENSE_01
    Executed the Query. 
    Got the results only the matched records as per the selection field FLAG_TYPE.
    But I want all the records from table AGR_TEXTS and matched records from table AGR_FLAGS.
    I want the report (output) as below,
    _AGR_NAME                                               TEXT                                                                                  FLAG_VALUE_
    ZCA_BASIC_ACCESS_GLOBAL     Non-critical basic access for all users.                                       53
    ZCA_BASIC_ENDUSER_ACCESS     UK:CA Basic Enduser Access     
    ZCA_BASIC_ENDUSER_ACCESS_UK     UK:CA Basic Enduser Access UK                                        52
    ZCA_BASIC_ENDUSER_SU52_UK     UK:CA Basic Enduser Access to change Parameter ID's     
    But I got the report (output) as below, 
    _AGR_NAME                                                TEXT                                               FLAG_VALUE_
    ZCA_BASIC_ACCESS_GLOBAL     Non-critical basic access for all users.     53
    ZCA_BASIC_ENDUSER_ACCESS_UK     UK:CA Basic Enduser Access UK     52
    Apprecited your help. Thanks.
    Code Formatted by: Alvaro Tejada Galindo on Dec 30, 2009 2:20 PM

    Identify a KF for which there are non-zero values for all accounts in the cube.
    Create the query with Account (from MP coming from both IO and cube) and this KF. KF will have 0 values for accounts not existing in the cube. Create a condition to show only the 0 value for the KF. This should show you all the accounts in the IO which are not in the cube.

  • SAP Query with Logical databse BRM

    Hi All,
    I'm developing one report by SAP Query using with logical database BRM to pick the accounting documents. But I would like add some kind of where condtion for one of field for BKPF table. Is there way to achieve this by using logical database concept? If there is a way please help me.
    Thanks in advance.
    Regards,
    TNR

    hi
    in SQVI, kindly follow the below steps:
    a.  in the left hand pane, click on the data fields.
    b.  expand the 'accounting document header'.
    c.  for the field BKPF-TCODE click on the 'List Fields' and the 'Selection fields'.
    d.  click on execute,
    e. you can now enter the values for the BKPF-TCODE.
    regards
    eashwar
    Edited by: eashwar1 on Feb 11, 2010 11:55 AM

  • SAP Query with Logical databse

    Hi All,
    I'm developing one report by SAP Query using with logical database BRM to pick the accounting documents. But I would like add some kind of where condtion for one of field for BKPF table. Is there way to achieve this by using logical database concept? If there is a way please help me.
    Thanks in advance.
    Regards,
    TNR

    hi
    in SQVI, kindly follow the below steps:
    a.  in the left hand pane, click on the data fields.
    b.  expand the 'accounting document header'.
    c.  for the field BKPF-TCODE click on the 'List Fields' and the 'Selection fields'.
    d.  click on execute,
    e. you can now enter the values for the BKPF-TCODE.
    regards
    eashwar
    Edited by: eashwar1 on Feb 11, 2010 11:55 AM

  • How to Create Specific SAP Query for Sales BOM

    Dear All Salute !!
    How I can create a SAP Query which provide information from the Sales Order-Line Item, this specific material is having any BOM or not?
    Suppose, user want Input,
    Sales Order No., Product Category, Duration of Sales Order Release.
    want Output,
    Sales Order No., Customer No., Customer Description, Sales Order Line Item, Material No., Material Description, Delivery Date, Quantity, Sales Order release Date
    Users requirement is, List of All Line Items for which BOM is yet to be Uploaded in the System.
    Please provide complete detail with Table & field by using SAP Query.
    Rgds
    Srivastav
    +91-9973504950

    If I am correct, in table KDST, you can see the details of Sales BOM with sale order.  Since right now, I dont have access to SAP, I am unable to confirm this.  You have to consider this table and develop on your own logic with the help of ABAPer.
    thanks
    G. Lakshmipathi

  • SAP Query Infoset

    Dear All,
    I have created a SAP Query Infoset with ldp pnp, i have a customer infotype added to that infoset.
    One of my field in the customer infotype consist of value and text(meaning values are stored in the infotype, which also has some text attached to it which is the check table).
    Now how can i link those two in the infoset, so that user can choose between them?
    Thanks.
    Moderator message: please choose more descriptive subject lines for your posts.
    Edited by: Thomas Zloch on May 26, 2011 10:12 AM
    Edited by: Satish R on May 26, 2011 10:55 AM
    Edited by: Satish R on May 26, 2011 10:59 AM
    Edited by: Satish R on May 26, 2011 11:00 AM

    Hello Satish,
    In SQ01 when you create your output list, you can right-click the column and select "Value and text",  I am on version ECC 6.0.
    Kind Regards,
    Rae Ellen Woytowiez

  • To Find the SAP Query from the tranaction code or the program name

    Hi,
    I have a situation wherein I have to modify the sap query associated with an transaction code.But the problem is that I am unable to find the SAP Query.
    <b>Please let me know how to find the SAP query from the transaction code or the program name.</b>
    Thanks and Regards,
    Rupesh

    Hi Rupesh,
    1 use FM
      RSAQ_DECODE_REPORT_NAME
    2. This is one of the best and easiest way.
    3. It will provide u the following info.
       WORKSPACE
       USERGROUP
       QUERY    
       CLIENT   
    4. Thru TCode U must know the program name first.
       This can be discovered using SE93.
    Hope it helps.
    Regards,
    Amit M.

  • SAP Query - Additional field that collects information from table RESB

    Hello gurus. I have a question.
    I want to create a SAP Query that shows me the stock level of a list of materials, and also show me the total quantity of order reservations in an additional field.
    I created an InfoSet with table MARD, which is the one that holds the Stock information in a plant. Then I created an additional field which would read information from table RESB, the table that holds order reservations per material.
    So I wrote this piece of code:
    SELECT * FROM RESB
    WHERE MATNR EQ MARD-MATNR and
           WERKS EQ MARD-WERKS.
    ENDSELECT.
    if ( sy-dbcnt NE '0').
          MOVE RESB-BDMNG to ZQTY.
    ELSE.
          MOVE '' to ZQTY.
    ENDIF.
    This works fine. However, this is currently just catching the first record in table RESB that matches my condition.
    What I would like is to collect every instance of RESB-BDMNG and add them to field "ZQTY", have it loop in RESB until it finishes finding every record that match the MATNR and WERKS. With this I could get the total number of order reservations that this material has in that table.
    Could someone share some coding that would help me achieve this?

    Yes! That did it. That's what I needed to do. Thank you so much.
    While I'm at it, let me ask you a related question.
    When I execute the query, in the first records of the query where there's no value from RESB to transfer, the value of field ZQTY appears empty. Once it finds the first record in RESB and it populates ZQTY with a value, then the rest of the records with no hit get the proper value of 0.
    Do you know why the first records in the query appear empty and not with a 0? Is there anything I should add to the coding to fix this?

  • Issue with Information broadcasting and pre-cal server in SAP BI

    Hi Experts,
    I have issue with information Broadcasting and Pre-cal server. I have a worrkbook whcih runs from information broadcasting in pre-cal server. Workbook is desinged on single query and workbook contains visual basic code. workbook has a variable which is controlled by Control query in information broadcasting.
    I have 20 employees every month I need to send workbook via e-mail from information broadcasting.  The problem is sometimes all 20 employees will recieve e-mails and sometimes not. I identified there is something wrong in workbook or in pre-cal server.
    because after workbook calculation in pre-cal server is not pushing to SOST so there is something wrong in workbook or in pre-cal server.
    I closely observed pre-cal server front end log. There are few operations performing on workbook in pre-cal server
    like Open workbook, Calculate workbook, Save woorkbook and close workbook. In success case pre-cal sever is performing all the operations but in failure case pre-cal server is missing Close workbook case.
    Below log In pulled from pre-cal server
    Can you please tell what could be the problem.
    Successful job
    3/11/2011 9:29:46 AM (3) -> RS_PREC_LAUNCH_EXCEL i nvoked in thread 3 and job 'BIBCAST4L4EIS7TOR5BWG0
    2PCUG9ZPPP'. nvoked in thread 3 and job 'BIBCAST4L4EIS7TOR5BWG0
    3/11/2011 9:29:46 AM (3) -> InitConnection in thre ad 3
    3/11/2011 9:29:46 AM (3) -> Trying to open "C:\Pro gram Files\Common Files\SAP Shared\BW\BExAnalyzer.
    xla" gram Files\Common Files\SAP Shared\BW\BExAnalyzer.
    3/11/2011 9:30:18 AM (4) -> RS_PREC_GET_SERVER_STA TUS invoked.
    3/11/2011 9:30:18 AM (4) -> RS_PREC_GET_SERVER_STA TUS finished
    3/11/2011 9:30:35 AM (3) -> Using Version 7100.4.1 200.35 of BExAnalyzer.xla
    3/11/2011 9:30:35 AM (3) -> PID of Excel process: "2504"
    3/11/2011 9:30:35 AM (3) -> EndOfInitConnection in  thread 3
    3/11/2011 9:30:35 AM (3) -> RS_PREC_LAUNCH_EXCEL f inished
    3/11/2011 9:30:36 AM (0) -> Calculation Request 91 1A35ED029D4D79DD7A000200000000 received for job 'B
    IBCAST4L4EIS7TOR5BWG02PCUG9ZPPP'. 1A35ED029D4D79DD7A000200000000 received for job 'B
    3/11/2011 9:30:52 AM (6) -> RS_PREC_GET_SERVER_STA TUS invoked.
    3/11/2011 9:30:52 AM (6) -> RS_PREC_GET_SERVER_STA TUS finished
    3/11/2011 9:31:22 AM (0) -> Opening workbook: C:\W INDOWS\TEMP\BW\Analyzer\Workbooks\SAPBEXPRECMML4NN
    DVLYAPC2SYIC7F1AAIO_0.xls INDOWS\TEMP\BW\Analyzer\Workbooks\SAPBEXPRECMML4NN
    3/11/2011 9:31:43 AM (0) -> Refresh BExAnalyzer.xl a!MenuRefreshPrecalc returned with 1.
    3/11/2011 9:31:43 AM (0) -> Calculated workbook C: \WINDOWS\TEMP\BW\Analyzer\Workbooks
    SAPBEXPRECMML
    4NNDVLYAPC2SYIC7F1AAIO_0.xls saved. \WINDOWS\TEMP\BW\Analyzer\Workbooks
    SAPBEXPRECMML
    3/11/2011 9:31:43 AM (0) -> Calculated workbook C: \WINDOWS\TEMP\BW\Analyzer\Workbooks
    SAPBEXPRECMML
    4NNDVLYAPC2SYIC7F1AAIO_0.xls closed. \WINDOWS\TEMP\BW\Analyzer\Workbooks
    SAPBEXPRECMML
    3/11/2011 9:31:44 AM (0) -> Excel based operations  finished.
    Failure job
    3/10/2011 10:22:58 AM (1) -> RS_PREC_LAUNCH_EXCEL invoked in thread 1 and job 'BIBCAST4L41566ZBZDN2N
    TGJR0462ZFX'. invoked in thread 1 and job 'BIBCAST4L41566ZBZDN2N
    3/10/2011 10:22:58 AM (1) -> InitConnection in thr ead 1
    3/10/2011 10:22:58 AM (1) -> Trying to open "C:\Pr ogram Files\Common Files\SAP Shared\BW\BExAnalyzer
    .xla" ogram Files\Common Files\SAP Shared\BW\BExAnalyzer
    3/10/2011 10:23:20 AM (3) -> RS_PREC_GET_SERVER_ST ATUS invoked.
    3/10/2011 10:23:20 AM (3) -> RS_PREC_GET_SERVER_ST ATUS finished
    3/10/2011 10:23:44 AM (1) -> Using Version 7100.4. 1200.35 of BExAnalyzer.xla
    3/10/2011 10:23:44 AM (1) -> PID of Excel process:  "2544"
    3/10/2011 10:23:44 AM (1) -> EndOfInitConnection i n thread 1
    3/10/2011 10:23:44 AM (1) -> RS_PREC_LAUNCH_EXCEL finished
    3/10/2011 10:23:44 AM (5) -> Calculation Request 9 11A35ED02654D789871000900000000 received for job '
    BIBCAST4L41566ZBZDN2NTGJR0462ZFX'. 11A35ED02654D789871000900000000 received for job '
    3/10/2011 10:24:27 AM (0) -> RS_PREC_GET_SERVER_ST ATUS invoked.
    3/10/2011 10:24:27 AM (0) -> RS_PREC_GET_SERVER_ST ATUS finished
    3/10/2011 10:24:31 AM (5) -> Opening workbook: C:\ WINDOWS\TEMP\BW\Analyzer\Workbooks\SAPBEXPRECQB2VE
    A8O8D8FBHYCR4HVB5UI8_0.xls WINDOWS\TEMP\BW\Analyzer\Workbooks\SAPBEXPRECQB2VE
    3/10/2011 10:24:52 AM (5) -> Refresh BExAnalyzer.x la!MenuRefreshPrecalc returned with 1.
    3/10/2011 10:24:52 AM (5) -> Calculated workbook C :\WINDOWS\TEMP\BW\Analyzer\Workbooks
    SAPBEXPRECQB
    2VEA8O8D8FBHYCR4HVB5UI8_0.xls saved. :\WINDOWS\TEMP\BW\Analyzer\Workbooks
    SAPBEXPRECQB
    Thanks in advance
    Narendra

    Hi Ravikanth,
    Thank you very much for the reply
    I went into RSPRECADMIN and clicked on 'Display Current Queue'.  There we have 3 sections
    1) Queue Overview of Open Precalculations
    I can see this section is always blank after running IB also
    2) Queue Overview of Current Precalculations
    In this section I can see an entry after running IB and duration is changing. but some time workbook in this section will never processed but the duration column is changing may be something is happening at this stage.
    If the entry is not proccessed in this section and IB SM37 job will never end. I manually cancelled the job from SM50.
    Don't why the workbook is taking long time and will never end even though I cancelled the SM37 IB job.
    3) Queue Overview of Proccessed Error-Free Precalculations
    All the error free workbooks which means all pre-cal server completed workbook calculation and sent to SOST.
    I manually ran the workbook for all the 20 employees I can't find any pop-up message (earlier we have pop-up windows appearing because of VB code and when report returns no data and we fixed the pop-up issues)
    Can you please help me further to trace the error.
    Thank you
    Narendra

  • Creation of SAP Query in SQ02 with Single Table With Condition

    Hi All,
    I want to Create SAP Query in SQ02 using single Table MCHA.
    ii) I dont want all entries of MCHA Table I mean , I have to apply some Condition on this Table.
    i.e  Suppose I am having actual data in MCHA table is like this for Material M1.
    Plant    Material   Batch   BatchCreationdate
    P1          M1         B1       20.06.2007
    P2          M1         B1       04.05.2009
    P3          M1         B1       04.05.2009
    But I want the Output of SAP Query is like this:
       Material   Batch   BatchCreationdate
          M1         B1       20.06.2007
    That is irrespective of Plant if Material & Batch are equal ---> 1st record with Lowest date shoud get at the output.
    Please help me How write the code on single table in the SAP Query.
    Thanks,
    Kiran Manyam

    Hi,
    Your query should be like this:
    Select MATNR CHARG HSDAT
    from MCHA
    into table t_mcha
    where matnr = Materlal number from selection screen.
    The structure of t_mcha should contain the fields that you select.
    Then sort the table by date ascending
    Sort t_mcha by HSDAT.
    Hope this solves your problem.
    Thanks,
    Sowmya

  • SAP Query PNPCE LDB with additional table.

    Hi ABAP Gurus,
    I am developing a SAP Query.
    I have created an infoset with the custom infotype 9050 and added the table ZPA9050 into the Infoset.
    The fields of ZPA9050 is not available as selection fields when I try to Query through SQ01.
    (How do I input values to the ZPA9050 fields? A checkbox for making a Selection field is not available in the Query (SQ01).
    For every pa9050 entry there exist multiple records of ZPA9050. I need to display the pa9050 fields in the 1st row and the corresponding zpa9050 fields in the subsequent rows.
    What needs to be done in order to get them as Selection fields (Input Fields)
    A quick reply is highly appreciated.
    Useful answers will be rewarded.
    Thanks
    Pradeep

    Hello,
    at the time of cretaing INFOSET using transaction SQ02. You can click on the Extra button nad than on the selection tab to add some fields on the selection screen.
    Reward if useful
    Mohit

  • SAP Query to join action infotype with additional action infotype

    We have created SAP Query on PA0000 which shows all actions that are executed for an employee.
    The problem is that if two actions are exceuted on the same day then it shows only one action instead of showing both the actions.
    As two actions are executed on the same day it will be stored in additional action infotype(0302).We tried to join PA0000(Action infotype) with PA0302(additional action infotype) in SAP Query by using joins(inner join/outer join) but it shows duplicate records.
    Is there any way to get additional action along with records of action infotype without any duplication in SAP Query.

    All entries that are in PA0000 will be in PA0302, but not vice-versa so you just have to reverse what you are currently doing, i.e.: create a Query on PA0302 and join to PA0000, and then make sure your selection criteria is from PA0302 and not PA0000.

  • Sap Query Web Reporting - Issues with accents

    Hi,
    We was using Web Reporting for Sap Querys, throw this tool we can generate automatically web reports.
    When we go to generated web report, selection screen show us character &#56292; instead accent letters.
    In addition to this, generated web report shows two buttons with german text: "report ausf?" and "Werte zur?zen".
    Guaranteed Rewards points.

    Hi Peluka,
    are these web report generate by SAp Query ITS based. If yes this is the right forum to ask, if no I would sugest to ask in the BI forum.
    Best regards,
    Klaus

  • Problem with create universe on Business Objects XI 3.1 base on SAP Query

    Hello,
    I have a problem with create universe on Business Objects XI 3.1 base on SAP Query.
    The problem is hierarchy. Massage on Busines Objects is :
       OWBS_ELEMT__ISTKOSZT(cube ICPC01/BEX_ICOC01):Exception condition  "HIERARCHY NOT FOUND" raised.(WIS 10901) 
    Query in BEX run OK.
    Best regards.
    Ela.

    Hello,
    Thanks for response.
    When I run BEX QUERY, all works OK.
    All hierarchies was created and activated  on system BW.
    This situation appears after upgrade BW to SAP NetWeaver 7.3.
    Before upgrade I created universe without any problems.
    Regards Ela

  • SAP Query with Multiple lines

    HI Team,
    Can we create multiple lines in an SAP Query? If yes, how (pls explain the steps)?
    Like can we have a line for the employee, next for spouse & then the next for child, so on...and then the next employee details.
    Also, there might be fields which will repeat in most of these lines for each employee.
    Thanks
    RL

    Hi RL:
    HR module have PA0021 table (HR Master Record: Infotype 0021 (Family), with this table into TCODE: SQ02  is naturally obtain the result that you ask, or Do you are customizing "Z" program with ALV?
    Regards
    José Luis

Maybe you are looking for