Get additions throu Select

Hi All
I have a doubt in retrieving the data from database.
Please assume we have the table as below
Sales doc no    Date        Value      customer No
1               10/05/2005   10000         1
2               10/02/2005   20000         1
3               05/05/2004   10000         1
4               05/10/2005   30000         2
5               12/12/2004   15000         2
6               14/10/2005   20000         2
      If I want to get sales values during the year 2005. Is there any possibility sum-up the sales value in a single field into internal table. It means I want to see in the internal table structure like below during the year 2005
customer No     Sales Value
   1               30000
   2               50000
       Please help me ASAP. I am very beginner in ABAP.
Regards
Praveen

Hello Praveen,
For this you have to use control level events.
Select all the fields you want from the database tables into an internal table.
Then loop thru that internal table and check for new customer using AT NEW control statement and the use COLLECT statement for summing up the values.
Do F1 on AT NEW and COLLECT.
look at the following example code.
TYPES: BEGIN OF COMPANIES_TYPE,
        NAME(30),
        PRODUCT(20),
        SALES TYPE I,
      END   OF COMPANIES_TYPE.
DATA: COMPANIES TYPE STANDARD TABLE OF COMPANIES_TYPE WITH
                     NON-UNIQUE DEFAULT KEY INITIAL SIZE 20,
      WA_COMPANIES TYPE COMPANIES_TYPE.
LOOP AT COMPANIES INTO WA_COMPANIES.
  AT NEW NAME.
    NEW-PAGE.
    WRITE / WA_COMPANIES-NAME.
  ENDAT.
  WRITE: / WA_COMPANIES-PRODUCT, WA_COMPANIES-SALES.
  AT END OF NAME.
    SUM.
    WRITE: / WA_COMPANIES-NAME, WA_COMPANIES-SALES.
  ENDAT.
ENDLOOP.
Regards,
Message was edited by: Naren Somen

Similar Messages

  • Additional Dynamic Selection in S_ALR_87012086(Trx)

    Hi All,
    I need to incorporate additional dynamic selection criteria which references 'Vendor-Serach Term 2' in new Z Transaction which is a copy of Transaction S_ALR_87012086.
    help me out how to proceed.
    Full reword points will be given.

    Hi Sij,
    1) Go t se36 and before that you have t get logical database name 2) From there go to menu and check the views 3) Take the view and click on chnage 4) Get the exact node which one you need and check the fields .In the same way you can add function groups also and then save.This is did for s_alr_87011990 report with custom fields.You can try and see.
    Regards,
    Madhu.

  • Need sample code to get handle of Selected rows from ADF Table

    Hi,
    I am new to ADF. I have an ADF table based on VO object.On some button action,I need to get handle of selected rows in application module.
    If anybody is having sample code to do this then please share with me.
    Thanks,
    ashok

    wow now link http://blogs.oracle.com/smuenchadf/examples/#134 is working.thanks a lot.
    also the link http://baigsorcl.blogspot.com/2010/06/deleting-multi-selected-rows-from-adf.html is very useful. Thanks a lot for Sameh Nassar too.He made it clear that in 11g Select column is not available for a ADF table and provided a solution to get Select column.
    Thanks,
    ashok

  • How to get additional field from the second list base on lookup information column ?

    Hi everyone,
    Currently I created a SharePoint hosted Apps project and I need to know how can I get additional field from the second list base on lookup information column. example List1 Have 2 columns column1 and column2(Lookup Information from list2 (category)),
    List2 have 3 columns title, and category, and color.  so how can get the title and color from list2 base on this lookup information column (SharePoint Hosted apps and Javascript code)? that is possible?
    Best regards,
    ------------------------------------------------------------ ---Tola---

    You can build one custom lookup control. Refer to the following post
    http://www.stuartroberts.net/index.php/2012/10/03/enhanced-lookup-field-part-1/
    Alternatively, try the following solution from codeplex
    http://sp2010filteredlookup.codeplex.com/
    http://filteredlookup.codeplex.com/
    --Cheers

  • How Can I Get Group By Select Statement To WorK?

    How can I get Code2 to work correctly? Code1 works fine. A user enters the customer and a date range on a form and submits request. I get error message in Dreamweaver. You tried to execute a query where the specified expression field3 is not part of an aggragate function I set the Form variables to: Name                            Default Value        RunTime Value Search_Criteria                    1                    Request.Form("Search") Date1                                  1                    Request.Form("Date1") Date2                                  1                    Request.Form("Date2") Code1. This works fine SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #1/2/09# AND Field6 <= #1/30/09#  GROUP BY Field3, Field10 Code2. I get error message SELECT Field3, Field10, SUM(Field16) as SumofField16 FROM CustomerHistory_CP WHERE Field3 LIKE '%Search_Criteria%' AND Field6 >= #Date1# AND Field6 <= #Date2#  GROUP BY Field3, Field10

    That requires you to enter the configuration correctly.  You can find out the configuration for your email from your ISPs website in most cases. Or if you're using Gmail, Yahoo, or Hotmail you need only Google something like:
    "Gmail configuration for Apple Mail"  or  "Hotmail configuration for Apple Mail" (without the quotes). 
    That should get you started..
    Jeff

  • Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Hi Memalyn
    Essentially, the bare issue is that you have a 500GB hard drive with only 10GB free. That is not sufficient to run the system properly. The two options you have are to move/remove files to another location, or to install a larger hard drive (eg 2TB). Drive space has nothing to do with SMC firmware, and usually large media files are to blame.
    My first recommendation is this: download and run the free OmniDiskSweeper. This will identify the exact size of all your folders - you can drill down into the subfolders and figure out where your largest culprits are. For example, you might find that your Pictures folder contains both an iPhoto Library and copies that you've brought in from a camera but are outside the iPhoto Library structure. Or perhaps you have a lot of purchased video content in iTunes.
    If you find files that you KNOW you do not need, you can delete them. Don't delete them just because you have a backup, since if the backup fails, you will lose all your copies.
    Don't worry about "cleaners" for now - they don't save much space and can actually cause problems. Deal with the large file situation first and see how you get on.
    Let us know what you find out, and if you manage to get your space back.
    Matt

  • When i try to load any page on Mozilla 28 the page opens but i get additional tab saying The address isn't valid The URL is not valid and cannot be loaded.

    When i try to load any page on Mozilla 28 the page opens but i get additional tab saying The address isn't valid The URL is not valid and cannot be loaded. I tried everything from reseting Firefox ,completely new installation of firefox to about.config and nothing worked it's been two days now since the problem started and i am pretty frustrated and desperate as i try to fix the issue so please help me with some solutions????
    Big thanks in advance

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Delete a possible user.js file and numbered prefs-##.js files and rename (or delete) the prefs.js file to reset all prefs to the default value including prefs set via user.js and prefs that are no longer supported in the current Firefox release.
    You can use this button to go to the Firefox profile folder:
    *Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder)
    *http://kb.mozillazine.org/Preferences_not_saved

  • How to get the previoulsy selected value in a combobox

    How to get the previoulsy selected value in a combobox. i WANT the current and the previously selected value of the combobox.

    Just add to combobox ItemListener. When item is changing in itemStateChanged arrives 2 events. ItemEvent.DESELECTED and ItemEvent.SELECTED with corresponding item's values. Just write something like this:
            comboBox.addItemListener(new ItemListener() {
                Object prevValue;
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        //do what you need with prevValue here
                    } else {
                        prevValue = e.getItem();
            });

  • How to get the old selection in ListSelectionListener valueChanged() method

    Hi,
    Is anyone know how to get the old selection index/value in the ListSelectionListener valueChanged() method? The list.selectedValue() always return the same value which is the new selection. The ListSelectionEvent.getFirstIndex() and getLastIndex are always firstIndex <= lastIndex so that you cant' tell which one is the old selection.
    Please help and thanks!

    Just test the two indexes (first and last): if the corresponding row is selected, then the other is unselected. That gives you the old (unselected) and new (selected) item.
    Of course, I have supposed that you were using a SINGLE_SELECTION model...
    Hope this helped,
    Regards.

  • I get prompted to select a scanner and a scan profile/preset each time I try to scan a document to PDF using Adobe Acrobat Pro.

    Hello,
    I have a fujitsu scanner (fi-6140) connected to my computer and have the "Scan" button on the scanner associated with Adobe Acrobat.  And so when I press the "Scan" button on the scanner to scan a document, it launches Adobe Acrobat Pro automatically.   Then I get prompted to select a scanner/device and a scan profile.  It seems to remember the last-used scanner/device, however; it still prompts me each time to confirm the scanner/device selected and select a scan profile to use.  Is there a way to save both the scanner & scan profile information and so when I click the "Scan" button, it doesn't prompt me to select but starts scanning using the last-used settings automatically?
    Thank you.

    Hi,
    Are you facing the issue with any pdf file?
    Please try updating Acrobat to 11.0.7 and check.
    You might also want to repair Acrobat and see.
    Regards,
    Rave

  • How to get id of selected Tab in WebDynpro abap

    HI,
        How to get id of selected Tab in WebDynpro for abap? THANKS!

    Hi,
    In the action method for onSelect try using,
      DATA:
        lv_select_tab type string.          "Selected tab value
      DATA:
        lt_events type WDR_EVENT_PARAMETER_LIST,
        ls_events type WDR_EVENT_PARAMETER.
      field-symbols: <fs_value> type any.   "Attribute value in events table
      lt_events = wdevent->parameters.
      read table  lt_events into ls_events with key name = 'TABSTRIPID'.
      if sy-subrc eq 0.
        assign ls_events-value->* to <fs_value>.        
        if sy-subrc eq 0.
          lv_select_tab = <fs_value>.                    "Tab selected
        endif.               
      endif.               
    Hope it helps!
    Regards,
    Radhika,

  • How to get a node selection in a table using Arraylist

    Hi All,
      Can someone help me with the code to get the node selected value from a table and then set that values to input fields?
    Early response would be much appreciated.
    Thanks
    Uday

    Dear Uday,
    Please user the isMultiSelected inside the for loop and iterate through all the rows selected to set in the arraylist.
    Refer to this might help: delete records from table
    if(wdContext.node<Node Name>().size()>0)
                // Iterate through the context Node
                for(int i=0;i<wdContext.node<Node Name>().size();i++)
           if(wdContext.node<Node Name>().isMultiSelected(i))  {
                      // Set the ArrayList here for the Lead Selected elements of the Table multiple selected rows
                            }else {
                                   // Set the ArrayList here for the Lead Selected elements of the Table single selected rows
    Best Regards
    Arun Jaiswal
    Edited by: Arun Jaiswal on Dec 10, 2011 2:04 PM

  • How to get the default selection color from JTable

    Hi, there,
    I have a question for how to get the default selection color from JTable. I am currently implementing the customized table cell renderer, but I do want to set the selection color in the table exactly the same of default table cell renderer. The JTable.getSelectionBackgroup() did not works for me, it returned dark blue which made the text in the table unreadable. Anyone know how to get the window's default selection color?
    Thanks,
    -Jenny

    The windows default selection color is dark blue. Try selecting any text on this page. The difference is that the text gets changed to a white font so you can actually see the text.
    If you don't like the default colors that Java uses then use the UIManager to change the defaults. The following program shows all the properties controlled by the UIManager:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java
    Any of the properties can be changed for the entire application by using:
    UIManager.put( "propertyName", value );

  • JTree: How to get the currently selected node

    How do I get the currently selected node in JTree?
    getLastSelectedPathComponent() this method always return the last selected node and not the current one.
    Thanks in advance
    Sachin

    Use
    TreePath selectedPath = tree.getSelectionPath()If your tree allows multiple selections, use
    TreePath [] selectedPaths = tree.getSelectionPaths() this will return an array of all selected tree paths.
    Once you get the tree path, call the treePath.getLastPathComponent(). this should tell you the currently selected node.
    Hope this helps
    Sai Pullabhotla

  • When I reboot my iMac I'll get hard disk selection instead of fast login and I am not using boot camp! Any help is greatly appriciated!

    When I reboot my iMac I'll get hard disk selection instead of fast login and I am not using boot camp! Any help is greatly appriciated!

    Have you selected which disk you want to boot from? In System Preferences, click startup disk and choose the drive you want as your default boot drive.

Maybe you are looking for