Group By Without Using Any Aggregate Function

L1                                L2
54654               414.00
654654               237.60
654654     
54654               1,108.80
654654               1,136.00
654654               5,956.00
NOW I WANT OUTPUT LIKE
L1               L2           sum
54654     414.00    1,522.80
54654     1,108.80  1,522.80
654654     1,136.00  7,329.60
654654     237.60    7,329.60
654654     5,956.00  7,329.60
HERE GROUP IS L1 SO
L1  54654  414
     54654  1108  SO TOTAL IS 1522

I USE FOLLOWING LOGIC:-
  sort i_data by lrnum.
   loop at i_data.
       on change of i_data-lrnum.
        if sy-tabix = 1.
          else.
           itab-lrfriegh = tot_sum.
           append itab.
           clear itab.
           clear i_data.
           clear tot_sum.
          endif.
          endon.
        at end of lrnum.
          move i_data to itab.
        endat.
          tot_sum = tot_sum + i_data-afriegh.
        at last.
          itab-lrfriegh = tot_sum.
          append itab.
          clear itab.
          clear i_data.
          clear tot_sum.
        endat.
     endloop.
CLOSE THREAD
Edited by: krupa jani on Nov 22, 2008 10:10 AM

Similar Messages

  • Length of a string without using any built-in functions

    code that returns the length of a string without using any built-in functions.
    thanks
    Sam

    A string is internally represented by a character array.  An array of characters will reside on the stack, not the heap.  Yes, we always learned that String is a reference type, but what goes on in your memory might still surprise you...
    A struct is internally represented by only it's private properties, sequentially on the stack.
    So basically, what I thought is happening by messing with the structlayout: is only tricking our programming a bit into thinking that the top X bytes on the stack represent a chararray, while actually we put them there as a string.
    Wrong. True. And wrong.
    A string is internally represented by, in that order, an array length, a string length, the chars. None of them resides on the stack.
    An array is internally represented by, in that order, an array length and the chars. None of them resides on the stack.
    When you use the FieldOffset attribute to handle the string as a char array, you don't get anything right:
    - the Length returned is the "array length" of the string, which is equal to the string length + 1.
    - the chars returned by the array indexer are shifted by 2 chars (the length of the "string length" field).
    You can use the FieldOffset to make that work, but it needs a little bit more work.
    unsafe static int Test()
    string myString = "This string may contain many string inside this string";
    string testString = "string";
    int countResult = 0;
    fixed (char* myChars = new StringToChar { str = myString }.chr, testChar = new StringToChar { str = testString }.chr)
    // The 2 first chars of the array are actually the string length.
    int myCharsLength = myChars[1] << 16 | myChars[0];
    int testCharLength = testChar[1] << 16 | testChar[0];
    for (int i = 0; i < myCharsLength - testCharLength + 1; i++)
    if (myChars[i + 2] == testChar[2])
    for (int j = 1; j < testCharLength; j++)
    var c = testChar[7];
    if (myChars[i + 2 + j] != testChar[j + 2])
    goto endOfCharAnalyses;
    countResult++;
    endOfCharAnalyses:
    continue;
    return countResult;

  • Is it possible to retrieve photos from an iPod Touch 5th Generstion iOS 7 backup to iTunes on a MacBook, without using any other iDevice?

    Is it possible to retrieve photos from an iPod Touch 5th Generation iOS 7 backup to iTunes on a MacBook, without using any other iDevice?
    I Backed up my iPod Touch 5th Generation iOS7 onti my MacBook using iTunes
    Later, I lost the iPod.
    I want to retrieve as much of the data, especially photos, as possible ftom the backup.
    I do not have another iPod to use the restore function.
    Is there any other way to retrieve the photos or any other data from the backup?

    You could restore an iPad or iPhone from the backup.
    Some of this apps are compatible with a Mac
    How to perform iPad recovery for photos, videos
    Wondershare Dr.Fone for iOS: iPhone Data Recovery - Wondershare Official     
    http://www.amacsoft.com/ipod-data-recovery.html

  • Can i make a book in iPhoto without using any of the built in layout templates, which are too limiting when i have already cropped my pictures to show just what I want. Ideally I just want to drag and drop and arrange and size the pictures myself

    Can i make a book in iPhoto without using any of the built in layout templates, which are too limiting when i have already cropped my pictures to show just what I want. Ideally I just want to drag and drop and arrange and size the pictures myself

    If you have Pages you can create customs pages for your book as TD suggested. If you have Pages from iWork 09 or 11 this app will add 80 or so additional frames to those offered:  Frames and Strokes Installer. Don't use it on the latest Pages version, however.
    This tutorial shows how to create a custom page with the theme's background: iP11 - Creating a Custom Page, with the Theme's Background for an iPhoto Book.  Once the page is complete to get it into iPhoto as a jpeg file follow these steps:
    Here's how to get any file into iPhoto as a jpeg file:
    1 - open the file in any application that will open it.
    2 - type Command+P to start the print process.
    3  - click on the PDF button and select "Save PDF to iPhoto".
    NOTE:  If you don't have any of those options go to Toad's Cellar and download these two files:
    Save PDF to iPhoto 200 DPI.workflow.zip
    Save PDF to iPhoto 300 DPI.workflow.zip
    Unzip the files and place in the HD/Library/PDF Services folder and reboot.
    4 - select either of the files above (300 dip is used for photos to be included in a book that will be ordered).
    5 - in the window that comes up enter an album name or select an existing album and hit the Continue button.
    That will create a 200 or 300 dpi jpeg file of the item being printed and import it into iPhoto. For books to be printed choose 300 dpi.

  • How to create a popup window to load HTML page in AIR application without using any mx or spark?

    How to create a popup window to load HTML page in AIR application without using any mx or spark components?
    I need to load the HTML page in popup in AIR application without using any of the <mx> or <spark> components. I need to open in the application itself not in the browser.(If we use navigateToURL() it will open in th browser)

    Can we achieve this? can somebody help me on this scenario..

  • I have a macmini on order, I wonder if I can pair the wireless apple keyboard and magic touchpad without using any other input devices, especially, since everything is brand new and not yet paired.

    I have a macmini on order, I wonder if I can pair the wireless apple keyboard and magic touchpad without using any other input devices, especially, since everything is brand new and not yet paired.

    You may just want to save yourself any possible issues
    by just hooking up a wired keyboard and mouse on first
    start up.  Any USB keyboard and mouse should work.
    There have been many that have had problems on first boot
    using the Bluetooth devices. 

  • Last Year MTD/YTD Column Without Using Time Series Function

    I need to calculate MTD and YTD of last year without using time series function.
    My requirement is like:
    We are working on Fiscal year.
    Suppose user will select a date: 15-Jan-2013

    Use a period table with Period Ago attributes and join these to an alias of your fact table. In other words, use a period table (let's say Day is grain) that would have
    WAgo, QAgo, YAgo, (etc.) attributes for each day. Join this table to aliases of the fact tables on these columns.
    Thanks.

  • I am using Iphone 5s my battery is draining like anything. Without using any application also it seems i am using iphone 5s but in show only really i am using like previous nokia 1100 model.

    I am using Iphone 5s my battery is draining like anything. Without using any application also it seems i am using iphone 5s but in show only really i am using like previous nokia 1100 model.

    Are there apps on your phone right now? 
    I think one of your apps is causing this.
    The only way to find out is to delete them all and then add them one by one to see what app maybe causing this.
    Especially if you've gone thru 3 iphones already.
    When you restored as new - did you sync back your stuff - apps/music or did you restore from backup?

  • How to do Indepth table analysis without using any tool

    Is there anyway of indepth analysis of tables of a database without using any tool, i.e. by means of sql's, pl/sql's only.
    My database has around 800 main tables which have several other related relational tables(objects relating 2 tables on basis of OTO, OTM, MTO, MTM object relationship) and several dependent views(made from among the 800 base table only).
    Currently database is indexed, has joins and views, all in working scenario but yet do not gauranty consistent behaviour.
    My sole purpose is to analyse all main tables (around 800 of them) in my database by running scripts and prompt errors, warnings, exceptions wherever table needs indexing or change of joins(eg - from cross to inner,etc. ) or check inorder to avoid table full scan for related relational tables and dependent views.
    My databse is Oracle10g.
    Please do revert for any doubts.

    My sole purpose is to analyse all main tables (around 800 of them) in my database by running scripts and prompt errors, warnings, exceptions wherever table needs indexing or change of joins(eg - from cross to inner,etc. ) or check inorder to avoid table full scan for related relational tables and dependent views.There are no tools which can tell whether your table needs indexing or whether you need to change joins methods, by just looking at your database. At most, you can get an idea about the missing indexes in case of a parent-child relation. Everything else, falls under application tuning - which involves sql tracing, profiling etc.
    If you cannot trace individual sessions, then you are better off monitoring the database with statspack/AWR (if licensed). Generate reports at frequent intervals, look at the resource consuming SQLs and have a discussion with dev team to fix them, whenever possible.
    EM can also be used for SQL analysis.

  • Can we demodulate the signal recieved at DAQ card without using any hardware interface(by only using labview)?

    Hi all,
    Can we demodulate the signal recieved at DAQ card without using any hardware interface(by only using labview)? if yes then how? please give brief idea.
    Regards,
    Amit

    There is probably a way to do it, but it it may be easier to use an X-series board for the job.   They support a new counter capability for count reset on a digital edge without needing to be configured in encoder position mode.  I am not sure exactly how that feature's been implemented however, so maybe it won't make things easier after all.
    The plan based on the hoped-for behavior: 
    1. Configure an X-series counter for pulse generation based on "ticks" of your clock channel.
    2. Set both initial delay and low time to the critical # of ticks.
    3. Configure for count reset on a digital edge (if possible in pulse generation mode)
    4. Configure the count reset value to be the critical # (or possibly 1 less, if possible in pulse generation mode)
    5. If you want the output to remain high indefinitely, configure the counter task to use its own output as a
    pause trigger, and pause while high.
    The way pulse generation works is to preload a # of "low time" ticks into the count register.  Then every source edge will decrement the count.  When the count reaches terminal count (0), the counter's output is toggled (or can be configured to pulse).  The register is then loaded with the # of "high time" ticks and the process continues.
    You would be perpetually interrupting the count-down process as long as you got your triggers in time.  The count would keep getting reset to the # of low counts, keep decrementing toward 0 without reaching it, and so on.  If ever you did reach 0, the output state would toggle high, then the high state would prevent subsequent clock signals from decrementing the count.
    You can conceivably do a similar thing with a 6601, but I'm pretty sure you'd need 2 counters working together to get it working.
    -Kevin P

  • Rounding to 2 decimal places WITHOUT using any formatting class

    Hello
    I'm trying to round a number (double) to 2 decimal places without using any of the formatting class like (DecimalFormat or Math.Round and BigDecimal). Is it possible to do it by just using typecast?

    OP:
    BigDecimal is not a formatting class. Math.round isn't a class at all.
    Typecasting doesn't really do that sort of thing at all (unless you count dropping fractional components when casting to an integer type).
    double holds values in binary format, so it's basically impossible to round to decimal values meaningfully.
    Chuck:
    I thought that BigDecimal supported arbitrary decimal precision, so one doesn't have to do that sort of thing....?

  • Help required to create portal without using any vendor specific API's

    Hi All,
    I am trying to develope a portal without using any vendor specific API or tool like Weblogic workshop or Vignette Wizard. I would like to know whether Sun Microsystem provides any API for developing portal. I would also appreciate if I can get few links for developing portal using java API's...
    Thanks in advance...
    Dgk

    Sure Sun provides the tools: it is called the compiler. Now all you need to do is write the code for a portal. But since there are vendor specific solutions available that could make your life a lot easier, writing one yourself is like reinventing the wheel.
    Pardon my mild sarcasm, but avoiding API's not developed by Sun is not the general idea behind the Java platform. You are encouraged to use those API's.

  • How do we Back up my music files from my phone into my computer (PC) without using any programs

    I am looking for a way to back up my Music from my iPhone into the computer (Like how the iPod Nano could) WITHOUT using any programs. Is there a way? Is it possible? If so, please help....
    thankyou
    Charlie

    Music purchased from the iTunes store can be redownloaded again for free (see.http://support.apple.com/kb/HT2519)  In other words, it's already in iCloud so there's nothing you need to upload.
    However, if you don't want to run into problems syncing with your new computer you need to copy the entire iTunes folder (not just the music folder) from your old computer to your new one using one of the methods outlined here: http://support.apple.com/kb/HT4527.

  • How do i lock all fields without using the signature function with adobe lifecycle designer 9

    How do i lock all fields without using the signature function with adobe lifecycle designer 9 ...
    I want it to have the same affect as when a signature is used but not use that function. I want a button that says lock all fields. And then you can click it again to unlock all fields...
    Thanks

    Here you go!
    LOCK the form once its SAVEd?

  • Using an Aggregate Function in a Sub-SELECT

    Ok. I have this Sub-SELECT and I'd like to base my outside query based on the resyult set of my inner Sub-SELECT which contains an Aggregate function.
    Is that possible???
    Here's the Query...
    SELECT *
    FROM CUSTPRO.CPM_PND_TRAN_HDR CPMPNDTH
    INNER JOIN (SELECT CPMPNDT2.ky_pnd_seq_trans,
    CPMPNDT2.id_ba_esco,
    CPMPNDT2.ky_ba,
    CPMPNDT2.ky_enroll,
    MAX(CPMPNDT2.dt_billed_by_css)
    FROM CUSTPRO.CPM_PND_TRAN_HDR CPMPNDT2
    WHERE CPMPNDT2.ky_pnd_seq_trans IN (6544937)
    GROUP BY CPMPNDT2.ky_pnd_seq_trans,
    CPMPNDT2.id_ba_esco,
    CPMPNDT2.ky_ba,
    CPMPNDT2.ky_enroll) DERIVE1
    ON CPMPNDTH.id_ba_esco = DERIVE1.id_ba_esco
    AND CPMPNDTH.ky_ba = DERIVE1.ky_ba
    AND CPMPNDTH.ky_enroll = DERIVE1.ky_enroll
    AND CPMPNDTH.dt_billed_by_css = ????DERIVE1.MAX(CPMPNDT2.dt_billed_by_css)???
    How can I designate that last qualifier ????....
    PSULionRP

    You should give your aggregate function a column-alias as in:
    SELECT *
    FROM   custpro.cpm_pnd_tran_hdr cpmpndth
           INNER JOIN (SELECT   cpmpndt2.ky_pnd_seq_trans,
                                cpmpndt2.id_ba_esco,
                                cpmpndt2.ky_ba,
                                cpmpndt2.ky_enroll,
                                Max(cpmpndt2.dt_billed_by_css) as XXX    -- ADDED THIS.
                       FROM     custpro.cpm_pnd_tran_hdr cpmpndt2
                       WHERE    cpmpndt2.ky_pnd_seq_trans IN (6544937)
                       GROUP BY cpmpndt2.ky_pnd_seq_trans,
                                cpmpndt2.id_ba_esco,
                                cpmpndt2.ky_ba,
                                cpmpndt2.ky_enroll) derive1
             ON cpmpndth.id_ba_esco = derive1.id_ba_esco
                AND cpmpndth.ky_ba = derive1.ky_ba
                AND cpmpndth.ky_enroll = derive1.ky_enroll
                AND cpmpndth.dt_billed_by_css = derive1.XXX
    /

Maybe you are looking for

  • Accessibility testing crashes Acrobat

    We're using JAWS and NVDA to test PDFs for section 508 compliance. When we exit JAWS, Windows presents a Data Execution Prevention message:"To help protect your computer, Windows has closed this program: Adobe Acrobat 9.3" With NVDA, after exiting th

  • EFT number updation in TDS certificates

    Hi all, Where i have to update EFT number to get the same information at TDS cetificate in Cheque/DD column. Generally we are paying TDS amount by net transfer thru EFT. we have to update the same EFT number against payment document and internal chal

  • AIR BLAZEDS not working...

    hi friends how integrate blazeds and AIR.. can i please sned any example or tell da process... as per my knowledge we have to create new "amf channel" but im not getting...

  • Backspace wrong behaviour in textarea

    I've recently found this problem: when I press the backspace on the keyboard in a textarea component (inside a tabnavigator) , it doesn't delete the carachters but it goes back on the previous tab as if I pressed the back button of the browser. This

  • Problems running myPage

    Hi, i'm trying to do a web portal when i run my page to see it, it appears a whit new window with nothing, which could be my problem? i'm using this tutorial: Oracle® Fusion Middleware Tutorial for Oracle WebCenter Developers *11g Release 1 (11.1.1)*