Multi Column subtotals in List Viewer

Hi experts,
           I had three columns and i sort on these three columns..and i need to get subtotals for these in web dynpro ALV programitically..??
Can any one help...???

Hi Prakash,
                Check out the below sample code. It will solve your problem.
method WDDOINIT .
  DATA: lo_cmp_usage TYPE ref to if_wd_component_usage.
   DATA: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
   DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
          lr_column TYPE REF TO cl_salv_wd_column,
          lt_column TYPE salv_wd_t_column_ref,
          ls_column TYPE salv_wd_s_column_ref.
    DATA: lr_function_settings TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
     DATA: lr_field_settings TYPE REF TO IF_SALV_WD_FIELD_SETTINGS,
           lr_field_curr TYPE REF TO CL_SALV_WD_FIELD,
           lr_field_amnt TYPE REF TO CL_SALV_WD_FIELD.
     DATA: lv_aggr_rule TYPE REF TO CL_SALV_WD_AGGR_RULE.
      DATA: lr_sort_rule TYPE REF TO CL_SALV_WD_SORT_RULE.
*create an instance of ALV component
       lo_cmp_usage = wd_this->wd_cpuse_MY_ALV( ).
if not initialized, then initialize
       if lo_cmp_usage->has_active_component( ) is initial.
         lo_cmp_usage->create_component( ).
          endif.
get ALV component
          lr_salv_wd_table = wd_this->wd_cpifc_MY_ALV( ).
          lr_function_settings = lr_salv_wd_table->get_model( ).
get reference to column settings
          lr_column_settings ?= lr_function_settings.
get all columns
           lt_column = lr_column_settings->get_columns( ).
loop at columns
           loop at lt_column into ls_column.
             CASE ls_column-id.
               when 'PRICE'.
for PRICE aggregate field
                 CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD EXPORTING FIELDNAME = 'PRICE' RECEIVING VALUE = lr_field_amnt.
create aggregate rule as total
                 CALL METHOD LR_FIELD_AMNT->IF_SALV_WD_AGGR~CREATE_AGGR_RULE EXPORTING AGGREGATION_TYPE = IF_SALV_WD_C_AGGREGATION=>AGGRTYPE_TOTAL RECEIVING VALUE = lv_aggr_rule.
                 when 'CURRENCY'. CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_FIELD_SETTINGS~GET_FIELD EXPORTING FIELDNAME = 'CURRENCY' RECEIVING VALUE = lr_field_curr.
sub totals based on contract currency.
CALL METHOD LR_FIELD_CURR->IF_SALV_WD_SORT~CREATE_SORT_RULE EXPORTING SORT_ORDER = IF_SALV_WD_C_SORT=>SORT_ORDER_ASCENDING GROUP_AGGREGATION = ABAP_TRUE
  RECEIVING VALUE = lr_sort_rule.
*hide others when OTHERS.
ls_column-r_column->set_visible( if_wdl_core=>visibility_none ).
  endcase.
  endloop.
endmethod.
Regards,
Susil.

Similar Messages

  • Add custom column in default list view in sharepoint

    Hello,
    How to add custom column in default list view in SharePoint 2013? In list view we have view fields section. But its not allowing to add any static text.  I want to add one button/textin view fields. How to add that?
    <View Name="{C7499466-A865-4742-8511-5536D2521D1C}" MobileView="TRUE" Type="HTML" Hidden="TRUE" DisplayName="All Documents" Url="/SectionManagement/SitePages/Untitled_1.aspx" Level="1"
    BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/15/images/dlicon.png?rev=23" ><Query/>
    <ViewFields>
    <FieldRef Name="LinkFilename"/>
    <FieldRef Name="LinkFilenameNoMenu"/>
    </ViewFields>

    Hi,
    to add a field to a view use this
    <ViewFields>
    <FieldRef Name="LinkFilename"/>
    <FieldRef Name="LinkFilenameNoMenu"/>
    <FieldRef Name=[InternalNameOfCustomField]/>
    </ViewFields>

  • How to calculate the total of a calculated column in a list view at the end of the view?

    I have a view with the following columns ProductName, Quantity, Price, Total The total column is a calculated column which is the product of quantity and price. I want to place the sum of the total column by the end of the list view. I can do this with
    the price and quantity but not with the total column. how do I do this?

    You can use SharePoint Designer and calculate the total in xslt view. Refer to the following post for more information
    http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2009/04/24/how-to-total-calculated-columns-in-a-sharepoint-list.aspx
    http://blog.metrostarsystems.com/2012/12/03/jennys-sharepoint-tip-sum-calculated-columns/
    Cheers,

  • How to add custom columns to the list view in Finder

    Hi,
    I'm looking for a way to view additional file details in the list view in Finder, for example audio bit rate, so I don't have to do "Get Info" for each file separately. I couldn't find a way to add columns other than the ones listed on the view options dialog.
    Can anyone help me find a way to do it?
    Thanks,
    Tal

    Have you checked the Help menu for what you want to do? I found this in Apple support - List View Options
    Check the AppleScript Forums. There is probably a script that you can use.

  • Custom column in a list view web part for a multilingual site does not take on custom language labels. Stays in default language.

    Hello all,
    I have what so far appears to be a fairly unique problem.  We are running a multilingual SharePoint 2010 environment with English as the default language and French as the secondary.  We have setup the sites in a variance relationship, but the
    issue I am discussing happens outside of a variant as well.
    We have created a library outside the variant (but within the collection) that the two sites must share.  A list view web part was created via Designer to add to each site to provide a quick view into the list.  If we are in the libary and switch
    to French, then update the column label it will remember the setting (because of the resource file) and maintain it as the language is flipped back and forth.  Where it doesn't work is as a web part in a variant or where the language is different.
    If the language is different, the out of the box columns work find, but the custom columns (all site columns not library\list columns) remain as the english label.  It doesn't matter if within a variant or outside with the browser language changed. 
    It always reverts back to English.  It's like it isn't using the same resource file that was used in the list itself.
    I created a custom view and modified it with xslt as per
    http://sharepoint.stackexchange.com/questions/50004/how-to-change-column-title-for-a-view-but-not-modify-the-list but this only worked within the list and did not occur in the list view either.
    I can't be the first that has come across it, either I am not performing my searches properly, no one has ever documented a fix for this or this is something we just can't fix with OOTB tools.  That's the other thing, the solution has to be accomplised
    OOTB or with minor client side changes.  I can't fire up Visual Studio because they are piloting Office 365 and have put a "No custom code" mandate on for migration.
    Thank you all in advance.

    Ok, I have come up with a solution.  I edited the XSLT for the web part on the page.  I did the following:
    1.    Create the variants in the Site Ccollection
    2.    Create the library outside of the variants.
    3.    Add all the columns you require for the library.  It is very important all the columns are there before you move on.
    4.    Create a French and English view.
    5.    Create the list view web part via designer.
    6.    Add the list view web part to each site selecting the appropriate view to use.
    7.      Edit the page in SharePoint Designer 2010.
    8.      Place cursor in the column you wish to modify.
    9.      Click Design in the List View Tools on the ribbon.  
    10.     Then click Customize XSLT and select Customize Item.  Select this option otherwise you will generate a **LOT** of unnecessary XSL code.
    11.     You are looking for a piece that resembles the following:
            <xsl:with-param name="fieldtitle">
              <xsl:value-of select="@DisplayName"/>
            </xsl:with-param>
    12.      Modify it by typing in the actual column name you want.  You should end up with something like this:
            <xsl:with-param name="fieldtitle">
              New Column Name.
            </xsl:with-param>
    13.      Now, for this page only, the column will be renamed.
    There are some caveats:
    1.    Doesn’t appear to work in a publishing portal.  I think this has to do with how SP stores the pages in this case.  In a publishing portal you can only modify the page layout which won’t work as we need to modify the content.
    2.    If you add another column, you will need to repeat the XSLT modification
    Anyways, I hope this helps out any others with the same issue or need as I had.

  • ITunes 11: Can't remove Genres column in playlist List View

    In previous versions, when playing playlists, I use List View, displaying only Artists and Albums. In iTunes 11, I'm unable to remove the Genres column; the items in View > Column Browser are grayed out.
    Also, ⌘-L (Go to Current Song) doesn't work.

    Just uncheck "Genres."

  • How to keep information in the comment column while in list view?

    While in list view, as you know, you can change the visible columns like comments for example. Then you can get info for each file and type in some text in the comments box and then when you 'enter' it will then appear in the comment line of the file. However for me, I find that if I input text in the comments box it will show in the column view but when I exist finder or restart to mac the info is gone. What the trick to get it to stay there?

    HI,
    Go to ~/Library/Preferences and move the com.apple.finder.plist file to the Trash. Relaunch the Finder.
    See if that makes a difference.
    Carolyn

  • Suddenly Genres column disappeared from List view

    Hi guys,
    I'm still running 8.0.2, and I can't figured out what happened; Genres column is disappeared from the list view and I couldn't find anyway to show it again.
    I also tried to reinstall iTunes 8.0.2, but nothing changed.
    Anyone know how to solve the problem?
    Thanks!

    Ok, just to make sure that I understand. In the list view in iTunes 8.0.2, you see artist & album column. In iTunes, just as the list starts it indicates what is listed in a gray bar. Right click on the bar & a menu should appear. From that list choose what you want to have displayed. The genera should be one of those options.
    If you are still experiencing issues at that point try the following article on Apple's support page:
    http://support.apple.com/kb/HT1224
    This will show you how to properly remove iTunes from your computer. After trying all of that with out any luck, call the support number & I know that an agent will be happy to help!

  • Is it possible to set default column widths in list view when using a finder window in Mavericks?

    The default 'document' column is way too wide and forces you eye to track all the way across the screen to read info like "date modified', 'kind' or 'size'.
    Tried several times to create a narrower default 'document name' column with no results. Couldn't find anything in preferences or view options. Tried dragging column headers while holding the down the option key with no results. 
    Every time I open a new finder window, all columns except the 'document' column affixed to the right side of the window. Also, when you grab the bottom right corner of a window to resize smaller, the lists become re-affixed to the right side of the window when opening the window back up.
    Experiencing the same problem in Mavericks 10.9.3 on an iMac and Macbook Pro Retina.
    Thanks if you've made it this far:)

    This was a great place for me to start
    Thank you
    I took profdant139's suggestions a bit further as my real goal was to have the "Document column" narrower. The goal to be able to see all the other document info that was usually hidden way out to the right
    To achieve my results I right clicked in the upper bar with the column names and chose from the drop down box "comments" column (as suggested). I then dragged it to the far right. This pushed all the other columns over.
    In the end of the day I ended up adding "Size" and "Date modified" columns as well to get my desired results.
    Remember one can move different columns around to be in the order you need by clicking on the column to get it active and then left click and drag it to where you want
    Another great thing is that by default (Using Mavericks) the date modified, opened,created columns have date and time. One can shrink them down to xx/xx/xx format by manually adjusting the column width like one does in Excel - click on column separator up top and drag
    Once all that is done, at least on my box, I closed it out and opened up a new finder window and everything was as I wanted.
    Thank you for the help  from the above helper to get me here

  • SharePoint Form columns vs. List view

    Hello,
    Is it possible to have SharePoint list with columns A,B,C, and and D columns in its view; but when adding new items it could save columns A,B,C,D, and F within the list? In other words, I want to save Column F when adding a new item, but I don't want to
    show it in the List's view?
    Any help will be greatly appreciated.
    Thanks,
    David R.

    If you're not against installing third party products (that are free) there's a useful CodePlex tutorual called the ListField manager that lets you access the properties for each column to ascertain where exactly they are displayed. 
    Here's the relevant links
    Utility link on CodePlex - https://listfieldmanager.codeplex.com/
    List Field Manager tutorial -
    http://social.technet.microsoft.com/wiki/contents/articles/21335.sharepoint-2007-2010-tutorial-using-the-sharepoint-list-field-manager.aspx
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Custom column in List view

    Dear guru's,
    I'd like to ask you if its possible to add custom column in list view. For example in tc. FBL1N I'd like to add a column with custom text (for example with value "1" for counting the sum of rows). Is it possible to do without creating custom program?
    Thank you all.
    Regards.
    Michael.

    Hi Michael,
    It's not possible to add some extra text in standard out-put without modifying it or creating custom program.
    For adding a column in your list view. I think this write statement will help you
    WRITE 'You can overwrite the following line:'.
    FORMAT INPUT ON INTENSIFIED OFF.
    WRITE 'WRITE HERE'.
    FORMAT INPUT OFF INTENSIFIED ON.

  • Modify columns in list view - add annotations

    Hello! Does anyone know if we can add new columns to the list view of assets in the production window? My goal is to have a column that shows annotation information in the list view. Possible?
    Thanks!

    Yes, kind of. You can add (and subtract) columns to a list view by modifying the List (ASSETLISTVIEW) metadata group. You can add Annotations but I'm not sure what you'll see for a value given it is not a unicode value field. It might not be a ver useful field to have in list view.

  • List View Column width

    Hi:
    Just wondering if there is a way to adjust the column widths in list view?
    thanks,
    Ed

    To clarify, I mean the MAX column width. I would like it wider than its current maximum width.
    Thanks!
    Ed

  • Customise columns in Open/Save dialog when in List View

    When opening or saving a file from an application while in list view, there is no "Date Modified" column that you could click to sort by. It seems to be gone and there is no way to configure the columns in this dialog. How to add or delete columns in the list view of open/save dialog?
    I seem to be able to change columns in Finder, but not in Open/Save file dialog.

    No. Column view will only sort by name. If you wanted to put a space before each folder name, then they will sort to the top. Sorting by Kind will put folders above files, but it will also put anything else except files at the top. If there are only folders, however, that would put them first in the sort list.

  • Workflow not working if the trigger field isn't in the list view!

    I have a list that displays important dates, and I have set up a reminder date column which calculated the reminder date by adding 7 days on to the set date. I then have a workflow that emails out reminder of this task if the reminder date matches today.
    I have noticed that if I include the reminder date column in my list view, the workflow works fine. But as soon as I remove the reminder date field from the list view my workflow no longer works. It's obviously quite confusing to other having this reminder
    date column there when it is only needed to trigger a workflow, so how do I trigger the workflow without having it on view?
    Thanks!

    Hi Sarah,
    As I understand, you have a Date column for user to set date, then you want a reminder date to add 7days to Date column. Then you would like to trigger a workflow if reminder date matches today.
    If you do not want reminder date in the list, you could use the workflow 2013 action Core Actions > Add time to Date, to set a workflow variable to replace reminder date, and compare with today. Then you could omit reminder date column.
    If you do want reminder date in the list, please try hide reminder date column in the list and test the issue again.
    http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2013/06/03/how-to-hide-a-sharepoint-list-column-from-a-list-form.aspx
    Regards,
    Rebecca Tu
    TechNet Community Support

Maybe you are looking for

  • HDMI on Mini to DisplayPort display

    Here's a quick and dumb question: I have a HP monitor currently connected to my late 2012 Mac Mini via a DisplayPort cable. It's the full size connector on the monitor, and I used a mini DisplayPort adapter so that I could plug it into the Thunderbol

  • VISIO insert from file problem

    I have been running some VBA code in MS Access for some time (3+) years, but the code is now giving me some issues.  When I wrote the code, I was using Windows XP, VISIO 2007, MS Access 2007, and Adobe Reader.  Since then several migrations have happ

  • STO Process

    Dear Guru's, Can I know the step wise process for depot to depot transfer and what are the accounting documents that will be genarated? I am also getting error while creating G.R, Maintain vendor for excise invoice, for this I have given vendor code

  • Info record price picking.

    Hi Currently I blocked manual entry of price in PO. The price should pick only from info record, if info record is not there for the material then it should through an error message. I have already made Message No: 06 136 No info record exists for it

  • JMF... Classes Not Found

    Hello, Although I have put the CLASSPATH as it should be in my environment variables ( I am using windows XP for the moment, but I had the same problem on Linux Kubuntu ), I still can't have the Diagnostics applet working. Any ideas to solve this ...