How to code to get intermediate results in webdynpro ALV? Please help!

Hi Experts,
I got following info from help file to generate Intermediate Results(subtotal).
Can somebody help me with sample code to achieve this?
Basically I want to subtotal 'Qty' column based on 'Product' field.
By default, all values in a field are used in the calculation during aggregation. However, you
are also able to generate intermediate results. You group the data records that contain the
values for an intermediate result and display each intermediate result in its own result row.
To generate intermediate results, you have to provide certain information:
● To specify in which field the values from which the intermediate results are calculated
are located, generate an aggregation condition for the desired field. The overall result is
displayed in the result row.
● To specify which data records are contained in an intermediate result, group the data
records: You sort the ALV output by the field that includes the criterion for the
intermediate result.
● To then generate the intermediate results, calculate the intermediate results using the
field with the criterion.
● To then display the intermediate results, switch on the display of intermediate results.
You are able to make the following settings for intermediate results:
● Generate intermediate results
● Display intermediate results
● Setting levels for drilling down intermediate results
● Set the position of the result rows (see Settings for Aggregation [page 196])
● Forbid the generation of intermediate results
Prerequisites
● You have generated an aggregation object for at least one aggregatable field.
● The field with the criterion for intermediate results is not an aggregatable field, and
therefore has an alphanumeric data type.
Generate Intermediate Results
To generate intermediate results in a field that already has an aggregation condition, generate
a sort condition for the field of a column (another column) (see Sorting [page 190]).
In this sort condition, define whether intermediate results are to be generated. To do this, use
the methods of the class CL_SALV_WD_SORT_RULE.
Methods for Generating Intermediate Results
Function Method
Generate intermediate results SET_GROUP_AGGREGATION
Check whether intermediate results are displayed GET_GROUP_AGGREGATION
Display Intermediate Results
Once you have made all settings, to generate intermediate results you have to switch on the
display of these intermediate results. You use the methods of the interface class
IF_SALV_WD_FIELD_SETTINGS for this (implementing class
CL_SALV_WD_CONFIG_TABLE).
Methods for Displaying Intermediate Results
Function Method
Display intermediate results SET_GROUP_AGGR_DISPLAYED
Check whether intermediate results are displayed GET_GROUP_AGGR_DISPLAYED
I have tried a bit but it is not working. here is my code:
get field and create aggregation rule of type total
lr_field = l_value->if_salv_wd_field_settings~get_field( 'Qty' ).
lr_field->if_salv_wd_aggr~create_aggr_rule( ).
lr_aggr_rule = lr_field->if_salv_wd_aggr~get_aggr_rule(  ).
lr_aggr_rule->set_aggregation_type( if_salv_wd_c_aggregation=>aggrtype_total ).
l_field = l_value->if_salv_wd_field_settings~get_field( 'PRODUCT' ).
l_sortrule = l_field->IF_SALV_WD_SORT~create_sort_rule( ).
l_sortrule~SET_GROUP_AGGREGATION( 'Y').
l_value->if_salv_wd_field_settings~SET_GROUP_AGGR_DISPLAYED( 'Y' ).
Please help
Message was edited by:
        gopalkrishna baliga

Hi Gopalakrishna balgia,
I think i have answered in the below thread. Check it out.
How to show Subtotal in webdynpro ALV(ABAP)? Kindly help!
Regards
Rakesh

Similar Messages

  • HT3630 How to creat an app-enabled accessories for iPhone? Please help me to get an answer..

    How to creat an app-enabled accessories for iPhone? Please help me to get an answer..

    To get hardware interfaces and API's via hardware you
    need to join the MFi program.  That info is here:
    https://developer.apple.com/programs/mfi/
    To get the additional software to be able to download
    and test code on any iDevice, you must join the
    iOS Developer Program.  That info is here:
    https://developer.apple.com/programs/ios/
    Both programs require fees and NDA agreements,
    especially hardware as most vendors that supply
    components development tools will not sell you any
    of their tools unless you are a member of the MFi
    program.

  • HT204023 I have iphone 4(ios 5.1.1)but there are no any icon like personal hotspot. How can i get it to my phone. Please help me. Thank you.

    I have iphone 4(ios 5.1.1)but there are no any icon like personal hotspot. How can i get it to my phone. Please help me. Thank you.

    The personal hotspot is not an app or an icon; it is a setting. You must first have your carrier provision it, then you turn it on in settings. Most carriers charge extra for tethering.

  • HT4528 I accidently put all my pics from my computer onto my phone and i have no idea how to get them off. Can u please help me?

    I accidently put all my pics from my computer onto my phone and I have no idea how to get them off. Can u please help??

    PhilipRoy wrote:
    Please see this article about transferring photos from a mobile device to a computer.
    http://support.apple.com/kb/ht4083
    Good luck Friend.
    That's not going to help.  That article is for moving photos from iOS device to computer, not for removing them.  Additionally, photos synced via iTunes cannot be manually removed from the device.  You have to use iTunes to 'unsync' them, as FoxFifth stated.
    Camera Roll pictures are the only ones that can be imported from device to computer.  Album folders cannot be moved from device to computer.

  • HT1212 My iPod touch is disabled after too many attempts and I want to enable it without getting it clear so can you please help me out in this....

    My iPod touch is disabled after too many attempts and I want to enable it without getting it clear so can you please help me out in this....

    A data recovery company MAY be able to do it for a price. The Disabled is a very good security feature.
    JWhy not just restore from the last backup you have?
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
      Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • My iPod touch is permanently disabled and it says to connect my iPod to my iTunes yet when I do that, it tells me to type in pass code even though it's still disabled. PLEASE HELP ME

    My iPod touch is permanently disabled and it says to connect my iPod to my iTunes yet when I do that, it tells me to type in pass code even though it's still disabled. PLEASE HELP ME

    I have the same problem with mine... but im trying to find a way to fix it without restoring it...
    but one fix is to shut it down completely ... then press and hold BOTH the power button and the home button .. hold both of those 4 ten seconds .. then release the power button but still hold down the home button .. and then it'll show something that says "connect to itunes" once u get it connected to itunes , click the restore button ... BEWARE THIS WILL WIPE OUT EVERYTHING ON YOUR IPOD!!! IT WILL RESTORE IT BACK TO FACTORY SETTINGS , AS IF U JUST BOUGHT IT !!!!! then it should work fine again .. but u will lose all data on there besides the things you have synced with itunes already..
    Thats y im iffy with doing this , im trying to find a fix where i wont have 2 restore it but i dont think there is 1 :'(
    good luck tho
    ~sam

  • I have like a paper gift card i got with a purchase and it has "gift card number" and "pin" and i want to redeem it but when i go to redeem a gift card on itunes it says "code" i i don't have that! please help i want to redeem this

    i have like a paper gift card i got with a purchase and it has "gift card number" and "pin" and i want to redeem it but when i go to redeem a gift card on itunes it says "code" i i don't have that! please help i want to redeem this

    coIt is a code. See:
    iTunes Store: How to redeem a code
    Apple - iTunes - Inside iTunes - How to Redeem Free Download Codes and Gift Cards In the App Store and iTunes

  • I have a few wedding projects(1-2 hours)I am trying to export at full hd quality,than burn in idvd.After rendering for 8hrs I receive error code that states "file is too big". Please help? compressing tips without losing quality?

    I have a few wedding projects(1-2 hours)I am trying to export at full hd quality,than burn in idvd. After rendering for 8hrs I receive error code that states "file is too big". Please help? compressing tips without losing quality? or any other exporting alternatives?

    Hey Z,
    Thank you for the tip on exporting by media browser (large) from imovie. But of course, if it's not one thing it's another. Now that I figured how to export a large file from imovie, I have an idvd issue. I followed the instructions for burning from idvd and changing the encoding to professional quality and the burn speed to x4, but I am receiving an error that states the following,
    Your project exceeds the maximum content duration. To burn your DVD, change the encoder setting in the Project Info window.
    Project:
    - total project duration: 79:04 minutes
    - total project capacity: 4.327 GB (max. available: 4.172 GB)
    Menus:
    - number of menus in project: 1 menus
    - total menu duration: 0:39 minutes
    - total menu capacity: 37.370 MB
    Movies:
    - total movies duration: 78:25 minutes
    - total movies capacity: 4.291 GB
    I have searched in the idvd forum for similar issues and I am stumped at this point. I have tried deleting the encoding assets and re launching idvd with the changed preferences, and still the same error. I know you mentioned something about free hard drive space available, and I have very little left. 4GB to be exact due to massive hours of non-edited footage. I am not sure if this is why, but I do not recall ever needing free space to burn memory onto a separate dvd. I would be more than happy if I am wrong, and it would be a quick fix. Otherwise, the technical nightmare continues. It's all a learning process and your expertise is greatly appreciated! Thanks in advance.

  • I have downloaded iOS 6 to my iTunes but I have clicked "Download Only" not "Download and Update" how do i install/sync it to my iPad. Please help me, its taken me hours to download it i don't want to do it again :(

    I have downloaded iOS 6 to my iTunes but I have clicked "Download Only" not "Download and Update" how do i install/sync it to my iPad. Please help me, its taken me hours to download it i don't want to do it again
    PLEASE HELP ME!!!

    Hook your iPad into your computer and open iTunes. GIve it a couple of minutes to get going, then click on the name of your device, then the main summary page. In the middle you'll see a software update button/area. Click on check on updates and update and follow the prompts.
    it SHOULDN"T redownload but if you've already got it should just install.
    I'd suggest that you first do a complete sync before you update, that way you have a good backup to restore your device from if the upgrade doesn't go perfect.

  • My AppStore id is my apple id n password which is good when purchasing. But when I am updating from update option it ask for a password. The user id I see there is not mine, it's different. How do I change that to my apple Id? Please help me resolve .....

    My AppStore id is my apple id n password which is good when purchasing. But when I am updating from update option it ask for a password. The user id I see there is not mine, it's different. How do I change that to my apple Id? Please help me resolve  this issue. I have tried resetting it but nothing... Either I'm doing something wrong or....

    I believe the issue is with the Apple ID that was used to purchase the App. If you download an App that was purchased under a different Appple ID then all updates will also be linked to the original purchaser's Apple ID. Your Apple ID is the the same ID as your iTunes, iCloud, etc. Some folks use different ID for the different Apple sites. No need for that One ID for all Apple Sites, and if someone else buys an App using their ID and they(you) download that App onto your device and that App requires an update it will ask for the purchasers Apple ID. This happens a lot when folks sell their iPad or give it to someone else and leave some purchased(free) Apps on the iOS device. You cannot change the original ID the App was purchased under. A suggestion would be if someone else has an App that you like but do not want to pay for use their ID or in the future have them gift the App to you.

  • HT1222 I bought used iPhone and on this iPhone I'm not able to make new account  on i Cloud'.  How can I use this iCloud's on used iPhone   Please help me

    I bought used iPhone and on this iPhone I'm not able to make new account  on i Cloud'.  How can I use this iCloud's on used iPhone   Please help me
    When I logging there it told me that maximum no of iCloud's Account already activated on this iPhone.
    Please help me how can I open new iCloud's account on this iPhone
    Regard
    Faiz khan

    Set up the account using a desktop or laptop, then sign
    into that account on your iPhone.
    I am not aware of any method around the restriction once
    the maximum has been created on any individual iPhne.

  • I just got the macbook air for christmas and i also got the dr dre headphones so i am trying to enable my soundcheck on my iTunes but i cannot figure out how to find where sound check is located can someone please help!!

    i just got the macbook air for christmas and i also got the dr dre headphones so i am trying to enable my soundcheck on my iTunes but i cannot figure out how to find where sound check is located can someone please help!!

    Go to the iTunes menu > Preferences > Playback.

  • How to use a vector to navigate my database? please help me.. ty

    how to use a vector to navigate my database? please help me.. ty

    Quite unclear request�
    Can you provide more details?

  • Every time i open Fire Fox i get an unreponsive pop-up? Please help in getting it resolved

    Every time i open Fire Fox i get an unreponsive pop-up? Please help in getting it resolved

    Hi sushmasrikrishna,
    did you try reinstall to see if something changes ?
    romsdu81

  • How to start Managed server in weblogic10gr3....please help me out...

    hi...
    How to start Managed server in weblogic10gr3....please help me out...

    Hi
    You can start Managed server in admin console ->servers
    or you can start the managed servers in Independent mode(without admin server)
    by using the startManagedWebLogic.cmd/>startManagedWebLogic.sh (this requires weblogic authentication).
    Hope this helps
    thanks

Maybe you are looking for

  • Problem with Composer info/Album Artist/ tags & duplicate albums

    I recently re-organized my iTunes library, which is on a network drive in my home. Since everything had gotten moved to new directories, I deleted all the songs from my iTunes library and re-imported everything. I've never been much of a playlist per

  • First iPod wouldn't turn off...now won't hold charge

    I got a new speaker system for my iPod. I used it once and ever since my iPod will not turn off without being plugged into the computer or the wall. I did the 5Rs and it still wouldn't turn off like it's suppsed to. Now I went to try some other thing

  • How to use Types structure in smartform layout

    Hi Experts, i have a requirement in smartforms. i have a z-structure having some fields. those fields should be in the smartform output when we run the print program. This is working fine. But i need to add 2 more fields to the existing z-structure.

  • Fumbling through V CAST and LG COSMOS Touch Music / pics setup

    OK basically I'm trying to set up my phone (LG cosmos touch) on V CAST and of course I added a MicroSD (8Gig) card. I have songs listed in V cast, and even created a playlist for them and moved them from the "local media content" to the playlist I cr

  • Contribute and Pop-Up windows

    Hi there, Offently I have user that want pop-up windows on their site to provide enlarged view of thumbnail pics to their website visitors. Of course with a little javascript fonction and a link do the trick. But how to provide Contribute Users the p