Create a group based on row count

I am looking for a way of reducing the size of tables I am displaying in my monthly report, by counting some rows together, and naming them 'other'
I would like to always show all rows, where count of item is >= 50, but all rows where count of item < 50, total up and call 'other'.  I will add an example image as soon as my account has been verified
I can hide rows using this in the visibility =iif(Count(Fields!Item.Value) >= 50, False, True)
I have duplicated the line, and added a filter to each (one for greater than 50, one for less than 50) but my totals are still counting all the data, and not just the filtered data.
Ideally, I would like to add a column using something like =iif(Count(Fields!Item.Value) >= 50, "Over50", "Under50"), or a group based on the same sort of idea, but I keep getting errors about using aggregates in columns.
Any suggestions?
Cheers

What you can do is to add derived column in query behind like this
SELECT other columns...,
CASE WHEN Cnt >= 50 THEN YourGroupingField ELSE 'Other' END AS GrpName
FROM
SELECT *,COUNT(1) OVER (PARTITION BY YourGroupingField) AS Cnt
FROM Table
)t
Then in your reports use =Fields!GrpName.Value as the Grouping column and you will get required output
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Create a group based on file contents

    Hello!
    I'm investigating options to create a dynamic group based on periodic check of file content. I have a Shavlik updater which is patching custom groups based on file contents. I would like to create a dynamic group which should return all Windows Computer
    classes that are found from this file. Anything close to sensible was found at https://www.youtube.com/watch?v=gxASdzHFTOU where author created an attribute of based on "SELECT * FROM CIM_DataFile" and then created a group out from it - but it checks
    file existence, not content, would launch against all Windows Clients (and we have 1000+ of these monitored) - certainly not a valid way.
    Is there any way I could do that in a simple, straightforward way?
    Thanks in advance

    Ok, I got it. Have you tried modifying the group membership with powershell?
    Modifying Explicit Group Membership in SCOM 2012 with PowerShell
    http://blogs.msdn.com/b/rslaten/archive/2013/06/27/modifying-explicit-group-membership-in-scom-2012-with-powershell.aspx
    Automate your group creation with Powershell
    http://blog.coretech.dk/kra/automate-your-group-creation-with-powershell/
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Group based on row data

    Given the following data:
    id duration start date end date
    1 15 08/01/2008 10:00 08/01/2008 10:15
    2 15 08/01/2008 10:15 08/01/2008 10:30
    3 15 08/01/2008 10:30 08/01/2008 10:45
    4 15 08/01/2008 11:00 08/01/2008 11:15
    5 15 08/01/2008 11:30 08/01/2008 11:45
    6 15 08/01/2008 11:45 08/01/2008 12:00
    7 15 08/01/2008 12:00 08/01/2008 12:15
    Is it possible to group them based on the sum of the duration column? If three rows' duration sum equals 45 and the datetimes are contiguous, then they'll be grouped as 1. So in the example above, [1 2 3] will be grouped as one and [5 6 7] will be grouped as another - row 4 is excluded since row 4 and row 5 aren't contiguous.
    Thanks.

    How about:
    SQL> alter session set nls_date_format = 'mm/dd/yyyy hh24:mi'
      2  /
    Session altered.
    SQL> with t1 as (
      2              select 1 id,15 duration,to_date('08/01/2008 10:00') start_date,to_date('08/01/2008 10:15') end_date from dual union all
      3              select 2, 15, to_date('08/01/2008 10:15'), to_date('08/01/2008 10:30') from dual union all
      4              select 3, 15, to_date('08/01/2008 10:30'), to_date('08/01/2008 10:45') from dual union all
      5              select 4, 15, to_date('08/01/2008 11:00'), to_date('08/01/2008 11:15') from dual union all
      6              select 5, 15, to_date('08/01/2008 11:30'), to_date('08/01/2008 11:45') from dual union all
      7              select 6, 15, to_date('08/01/2008 11:45'), to_date('08/01/2008 12:00') from dual union all
      8              select 7, 15, to_date('08/01/2008 12:00'), to_date('08/01/2008 12:15') from dual union all
      9              select 8, 45, to_date('08/01/2008 13:00'), to_date('08/01/2008 13:45') from dual union all
    10              select 11, 15, to_date('09/02/2008 08:00'), to_date('09/02/2008 08:15') from dual union all
    11              select 12, 15, to_date('09/02/2008 08:15'), to_date('09/02/2008 08:30') from dual union all
    12              select 13, 15, to_date('09/02/2008 08:30'), to_date('09/02/2008 08:45') from dual union all
    13              select 14, 15, to_date('09/02/2008 08:45'), to_date('09/02/2008 09:00') from dual union all
    14              select 15, 15, to_date('09/02/2008 09:00'), to_date('09/02/2008 09:15') from dual union all
    15              select 16, 15, to_date('09/02/2008 09:15'), to_date('09/02/2008 09:30') from dual union all
    16              select 17, 15, to_date('09/02/2008 09:30'), to_date('09/02/2008 09:45') from dual union all
    17              select 18, 15, to_date('09/02/2008 09:45'), to_date('09/02/2008 10:00') from dual union all
    18              select 19, 15, to_date('09/02/2008 10:00'), to_date('09/02/2008 10:15') from dual union all
    19              select 20, 15, to_date('09/02/2008 10:15'), to_date('09/02/2008 10:30') from dual union all
    20              select 21, 30, to_date('09/02/2008 10:30'), to_date('09/02/2008 11:00') from dual union all
    21              select 22, 15, to_date('09/02/2008 11:00'), to_date('09/02/2008 11:15') from dual
    22             ),
    23       t2 as (
    24              select  id,
    25                      duration,
    26                      start_date,
    27                      end_date,
    28                      case
    29                        when lead(start_date,1,end_date - 1) over(order by id) != end_date then 1
    30                        when duration + lead(duration) over(order by id) > 45 then 1
    31                        when lead(start_date,2,end_date - 1) over(order by id) != lead(end_date) over(order by id) then 2
    32                        when duration + lead(duration) over(order by id) + lead(duration,2) over(order by id) > 45 then 2
    33                        else 3
    34                      end grp_size,
    35                      case
    36                        when lead(start_date,1,end_date - 1) over(order by id) != end_date then duration
    37                        when duration + lead(duration) over(order by id) > 45 then duration
    38                        when lead(start_date,2,end_date - 1) over(order by id) != lead(end_date) over(order by id) then duration + lead(duration) over(order by id)
    39                        when duration + lead(duration) over(order by id) + lead(duration,2) over(order by id) > 45 then duration + lead(duration) over(order by id)
    40                        else duration + lead(duration) over(order by id) + lead(duration,2) over(order by id)
    41                      end grp_duration,
    42                      row_number() over(order by id) rn
    43                from  t1
    44             ),
    45       t3 as (
    46              select  id,
    47                      level grp_number,
    48                      grp_duration
    49                from  t2
    50                start with id = 1
    51                connect by rn = prior rn + prior grp_size
    52             )
    53  select     t1.*,
    54          max(t3.grp_number) over(order by t1.id) grp_number,
    55          last_value(t3.grp_duration ignore nulls) over(order by t1.id) grp_duration
    56    from     t1,
    57          t3
    58    where t1.id = t3.id(+)
    59    order by t1.id
    60  /
            ID   DURATION START_DATE       END_DATE         GRP_NUMBER GRP_DURATION
             1         15 08/01/2008 10:00 08/01/2008 10:15          1           45
             2         15 08/01/2008 10:15 08/01/2008 10:30          1           45
             3         15 08/01/2008 10:30 08/01/2008 10:45          1           45
             4         15 08/01/2008 11:00 08/01/2008 11:15          2           15
             5         15 08/01/2008 11:30 08/01/2008 11:45          3           45
             6         15 08/01/2008 11:45 08/01/2008 12:00          3           45
             7         15 08/01/2008 12:00 08/01/2008 12:15          3           45
             8         45 08/01/2008 13:00 08/01/2008 13:45          4           45
            11         15 09/02/2008 08:00 09/02/2008 08:15          5           45
            12         15 09/02/2008 08:15 09/02/2008 08:30          5           45
            13         15 09/02/2008 08:30 09/02/2008 08:45          5           45
            ID   DURATION START_DATE       END_DATE         GRP_NUMBER GRP_DURATION
            14         15 09/02/2008 08:45 09/02/2008 09:00          6           45
            15         15 09/02/2008 09:00 09/02/2008 09:15          6           45
            16         15 09/02/2008 09:15 09/02/2008 09:30          6           45
            17         15 09/02/2008 09:30 09/02/2008 09:45          7           45
            18         15 09/02/2008 09:45 09/02/2008 10:00          7           45
            19         15 09/02/2008 10:00 09/02/2008 10:15          7           45
            20         15 09/02/2008 10:15 09/02/2008 10:30          8           45
            21         30 09/02/2008 10:30 09/02/2008 11:00          8           45
            22         15 09/02/2008 11:00 09/02/2008 11:15          9           15
    20 rows selected.
    SQL> SY.

  • Conditional display based on row count

    I have a report region with sql query (PL/SQL function body returning sql query). In this region i have text item above the report. I would like to have a condition on this item that it should only show if there exists records in the report (row count > 0).
    How can this be done?
    Best regards
    Erik

    There are many options available for conditional display. You can use this one here:
    http://apex.oracle.com/pls/otn/f?p=31517:7
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Creating Resource Group based On Location

    Hi,
    Can we create Resource group location wise in PWA or Professional.
    Thanks,
    Prashant

    What about creating a lookup table with the location and a resource enterprise custom fields? Then for each resource you can pickup a location. You could even then open all the resources in MS Project Pro and bulk update the location.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Dynamically creating a Record Group based on Previously entered Record Grou

    Forms [32 Bit] Version 10.1.2.3.0 (Production)
    Hi,
    I know how to dynamically create a record group based on a query and putting the code in When new form instance.
    My query is. I have a form which has multiple Record Groups and the user wants to dynamically create subsequent groups based on previous groups.
    For example
    I have a record group with selects a Location,
    when the user selects the Location from a list of values
    the 2nd record group called 'Cost Centres' will have to filter out only those with the locations selected above.
    How can I populate the 2nd record group at run-time when I do not know what site the user will select?
    If I simply populate in when new form instance as in location and just select everything, the list of values populates.
    CC field is a LIST ITEM and the list style is a POP LIST, it is not required.
    I have put the code in the Location field in the when-list-changed trigger.
    I am getting this error:
    frm-41337: cannot populate the list from the record group
    here is the code:
    DECLARE
    v_recsql Varchar2(1000); -- The SQL for creating the Record Group.
    v_recgrp RecordGroup; -- Record Group
    v_status Number; -- Return Value of Populate_Group function.
    c_where VARCHAR2(1000);
    BEGIN
         IF :location = '1' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''02'')';
         ELSIF :location  = '2' THEN
              c_where := ' substr(cost_centre,1,2) in (''02'',''03'')';
         ELSIF :location   = '3' THEN
              c_where := ' substr(cost_centre,1,2) in (''01'',''11'',''07'')';
                   ELSE
              c_where :=  ' 1=1'; --EVERYTHING
         END IF;
    v_recsql := 'SELECT cost_centre, description  FROM   cost_centres  where '||c_where;
    -- Create the Record Group
    v_recgrp := CREATE_GROUP_FROM_QUERY('v_recgrp', v_recsql);
    IF NOT ID_NULL(v_recgrp)
    THEN -- No Error, record group has been successfully created.
    -- Populate Record Group
    v_status := POPULATE_GROUP('v_recgrp');
    IF v_status = 0
    THEN -- No Error. Record Group has been Populated.
    POPULATE_LIST('block.CC', 'v_recgrp');
    END IF; -- IF v_status = 0
    -- Delete the Record Group as it is no longer needed.
    DELETE_GROUP('v_recgrp');
    END IF; -- IF NOT ID_NULL(v_recgrp)
    END;thanks for your assistance.

    Hi,
    Once record status gets change for block you can not populate/repopulate the list item. Keep those list items as non-database item with different names and create different items as database orignal items. Than assign the values in WHEN-LIST-CHANGE trigger to the actual database items.
    -Ammad

  • Creating user groups using SQ03.

    I am going to make a change to a already existing query 01 in the user group /SAPQUERY/AM. I am not a query expert, in fact this is the second query that I am modifing. I am reading some documentation that the first thing that I have to do is create a user group. from what I am reading, the user group will contain the users that are allowing to modify queries. Since our users do not use this tool, I am the only one that creates and modifies queries. I think I am going to create a user group and that my user-id will be the only one in the group - correct? will I create one user group and and queries that I make changes to in the future user this user group or do I create user groups based on the users group that are defined by SAP. example - If I am changing a query in /SAPQUER/AM  and in /SAPQUERY/AU - would I create 2 user groups  1 for AM and 1 for AU or would I create only 1 user group and use it for both queries.
    After this, I think I have to copy the infoset (SQ02)and the query (SQ01) to custom names (names starting with Z) and then attaching the parts to the new user group.

    Hi Timothy
    Typically you want to create user groups for functional areas or grouped reports/queries. You can enter as many users as needed into a user group and only those who have the checkbox next to their name in the user group screen will have authorization to create/modify queries in the infosets where the usergroup is assigned. If you are creating 2 usergroups with the same users and authorizations then that is redundant but if the list of users is different or the authorizations may change then it would make sense to have 2 usergroups. You should have some naming convention to follow when creating the queries but the Z prefix is not required.
    Andy

  • Grouping Based on Parameters

    Hi
    can anyone lease explain me how to create a group  based on the parameters entered by the user ?

    hmm, are your parameters set to dynamic? if yes here is the solution which might work - Direct from Crystal Report Help file
    Adding dynamic grouping using parameter fields
    You can design your report so that users can change the grouping presentation of the report without refreshing information from the database. For instance, users can move from a customer-focused view of the report to either a region-focused or an order-focused view. Dynamic grouping combines the use of group selection formulas and the Parameter Panel.
    To add dynamic grouping using parameter fields
    Create a report using the sample data, Xtreme.mdb, and place the following fields from left to right in the Details section:
    {Customer.Customer Name}
    {Customer.Country}
    {Orders.Order ID}
    {Orders.Order Date}
    {Orders.Order Amount}
    Create a new parameter field and call it GroupBy.
    Select String from the Type list.
    Add the following values to your parameter:
    Customer
    Country
    Order
    Select Editable from the Show on (Viewer) Panel list, and click
    OK.
    Create a new formula field and call it GroupField.
    Type the following formula into the Formula text box.
    If {?GroupBy} = 'Customer' then
    {Customer.Customer Name}
    Else if {?GroupBy} = 'Country' then
    {Customer.Country}
    Else if {?GroupBy} = 'Order' then
    *ToText({Orders.Order ID})
    Note: Crystal Reports formulas do not allow conditions to return different data types. Both the Customer Name and Country fields return strings, so the ToText function must be used to convert the
    Order ID from a number to a string as well.
    Save your formula and close the Formula Workshop.
    In the Group Expert, select the GroupField formula as your group field, and click OK.
    Customize summary fields and section formatting as you like.
    Users can now change the grouping presentation of the report by modifying the GroupBy parameter value on the Parameter Panel.
    Note: Changing parameter values will not cause a database refresh as long as the parameter is a non-data parameter.
    hope this helps
    Regards
    Jehanzeb

  • Group based on Shared variable

    Hi Experts,
    Can we create a Group based on Shared variable in subreport?

    Hi Praveen,
    A shared variable evaluates in Pass 2 and hence No!
    You can't create a group on such formulas in the Main Report or the Subreport.
    -Abhilash

  • Create target group for contacts does not work

    Hi Experts,
    I am working on a Markting solution for a University with CRM 5.0.
    We need to contact certain Teachers in Schools (they have an orientation function for pupils that might study in the University in the future).
    I can segment for schools in Segmentbuilder. Now, I need to generate "new target group from contact". In my case the contact person of the school is the Teacher (function type is contact person). This does not work.
    Am I missing some parametrization, or is there a relation to sales area (wich we do not have).
    Hoping for your help. I will regard points generously.
    cristina

    Hi Cristina,
    I understand Schools are crated as Org and Teacher as Persons. There exist a Relationship between these similar to Contact Person (BUR001).
    Now, Follow the process
    1) Create a Data Source in CRMD_MKTDS.
    2) Assign an Infoset Query, as per your scenario.
    3) Assign Function Module "CRM_MKTTG_PF_BP_TAB_TO_CP" to data source
    4) Save, and then create an Attribute List.
    Go to Segment Builder and create target group based on above Attribute List.
    You'll get a list of all the contact persons. For your case, Teachers.
    Hope this helps......
    Regards,
    Vikas
    PS: This will only work if Schools - Org, Teacher = Person and Relationship = BUR001. If you have other criterias please copy Function Module "CRM_MKTTG_PF_BP_TAB_TO_CP" and edit it as per your business case. Then assign this FM in Data Source.

  • Create Memory Group in SCOM 2012

    Hello,
    I would like to create dynamic groups based on memory capacity to set the threshold for different sizes.
    Anyone help me to create a group based on memory size?
    regards,
    Vijay

    Hello Vijay,
    When you go to create a New Group in the Authoring workspace, and you add the Windows Computer class, you will then have a Property list to select from. Unfortunately, I don't see any reference to Memory available (although I do see referenced to both Local
    and Physical Processors). 
    However, if you change the class to Windows Operating System, there is a property for "Physical Memory (MB)". You can then choose the appropriate Operator (i.e. Equals, Greater Than, etc.), and then specify the value you want. 

  • Problem w/: Error while getting estimated row count for view

    JDev 10.1.3 - Steps
    1. created a ADF VO w/ one bind variable vNAME.
    2. Created a basic jspx page, use the data control pal. to drop in VO w/ executeparam option. Use the data control pal to drop in VO w/ ADF Read-Only Table w/ select and sort option. Selected all VO columns in table.
    3. Following Error msg occurs when running jspx page -
    oracle.jbo.DMLException: Error while getting estimated row count for view object CategoryView, statement SELECT count(1) FROM (SELECT
    CATEGORY.CATID CATID,
    CATEGORY.NAME NAME,
    CATEGORY.PICTURE PICTURE,
    CATEGORY.ACTIVE ACTIVE
    FROM
    CATEGORY
    WHERE
    (CATEGORY.NAME LIKE UPPER(:vName)||'%')) .
    Tested SQL Statement in SQL Worksheet works ok (with a Value replacing ':vName').
    Can anyone advise - seems to be a straight forward process that is returning this error msg. I have tried variations of the SQL stmt with no luck. The jspx page errors when the ADF Read-Only Table is added.

    I seem 2 have the same error, in a slightly different situation.
    I have a view which subclasses a Entity with a history column 'CreatedOn'. When performing a quick search/filter on this column I get the same error. The ADF app is build on a DB2 database, so no named parameters here. Instead invalid SQL is created when executing the estimated row count. The WHERE clause contains 'CreatedOn = null', should be 'CreatedOn is null'. Furthermore the input of my quick search is not filled in this clause.
    Any help would be appreciated

  • Configuring UME to create virtual group ....

    Hello Friends,
    I am configuring UME to create virtual groups in Portal. And I successfully did that.
    My question is, Can I create virtual groups for multiple user attributes?
    For e.g. Can I create virtual groups based on location as well as employeetype?
    So I would be seeing somewat like this:
    <b>Cadre based groups: </b>Cadre_Staff, Cadre_Managers, Cadre_Executives, Cadre_Presidents
    <b>Location based groups: </b>location_India, location_USA, location_England
    Regards,
    Nilz

    Hi nilz,
    we can create Virtual groups; for that just follow below steps:
    1.Start the Config Tool C:\usr\sap\<SID>\<engine-instance>\j2ee\configtool\configtool.bat
    Ex: D:\usr\sap\F02\JC00\j2ee\configtool --> configtool.bat
    2.Goto cluster-data --> Global server configuration --> services --> com.sap.security.core.ume.service
    3. Set below properties:
    ume.virtual_groups.names = Sales,Production,accounts          
    ume.virtual_groups.user_attribute = myAttribe (give any name)
    ume.virtual_groups.user_attribute.namespace = myNameSpace (give any name)
    4. Save and Restart the Engine.
    5. login to UME then search for Virtual Groups; you will get Sales,Products,Account groups.
    For further references just see this link:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/40ad17fcae1bcde10000000a1553f7/frameset.htm
    <b>Please Reward Points; if it is usefull.</b>
    Thanks
    Nagaraju

  • Creating a target group based on the BP email address only in CRM

    Hi there,
    I am currently trying to create a target group based on the business partner email address only.
    I have a list of over 1000 email addresses - these email addresses equate to a BP in our CRM system, however I do not have a list of the equivalent business partner numbers, all I have to work on are the email addresses.  With these 1000 BP email addresses I need to update the marketing attributes of each of these 1000 BP records in CRM.
    What I need is a method to find the 1000 BP numbers based on the email addresses and then use the marketing expert tool (tx. CRMD_MKT_TOOLS) to change the marketing attributes on all of the 1000 BPs.
    The issue I am having is how can I find the list of BP numbers just based on the BP email address, I tried creating an infoset based on table BUT000, BUT020 and ADR6 but I after creating attribute list & data source for this I am stuck on what to do next. In the attribute list the selection criteria does not allow me to import a file for the selection range.  I can only enter a value but I have 1000 email addresses and cannot possibly email them manually in the filter for the attribute list.   I also looked at imported a file into the target group but I do not have any BP numbers so this will not work.
    Does anyone know a method where I can create a target group based on the email addresses only without having to do any code?
    Any help would be most appreciated.
    Kind regard
    JoJo

    Hi JoJo ,
    The below report will return you BP GUID from emails that is stored in a single column .xls file and assign the BP to a target group.
    REPORT  zexcel.
    * G L O B A L D A T A D E C L A R A T I O N
    TYPE-POOLS : ole2.
    TYPES : BEGIN OF typ_xl_line,
    email TYPE ad_smtpadr,
    END OF typ_xl_line.
    TYPES : typ_xl_tab TYPE TABLE OF typ_xl_line.
    DATA : t_data TYPE typ_xl_tab,
           lt_bu_guid TYPE TABLE OF bu_partner_guid,
           ls_bu_guid TYPE  bu_partner_guid,
           lt_guids TYPE TABLE OF bapi1185_bp,
           ls_guids TYPE  bapi1185_bp,
           lt_return TYPE bapiret2_t.
    * S E L E C T I O N S C R E E N L A Y O U T
    PARAMETERS : p_xfile TYPE localfile,
                  p_tgguid TYPE bapi1185_key .
    * E V E N T - A T S E L E C T I O N S C R E E N
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_xfile.
       CALL FUNCTION 'WS_FILENAME_GET'
         IMPORTING
           filename         = p_xfile
         EXCEPTIONS
           inv_winsys       = 1
           no_batch         = 2
           selection_cancel = 3
           selection_error  = 4
           OTHERS           = 5.
       IF sy-subrc <> 0.
         CLEAR p_xfile.
       ENDIF.
    * E V E N T - S T A R T O F S E L E C T I O N
    START-OF-SELECTION.
    * Get data from Excel File
       PERFORM sub_import_from_excel USING p_xfile
       CHANGING t_data.
       SELECT but000~partner_guid FROM but000 INNER JOIN but020 ON
    but000~partner =
       but020~partner
         INNER JOIN adr6 ON but020~addrnumber = adr6~addrnumber INTO TABLE
    lt_bu_guid FOR ALL ENTRIES IN t_data WHERE adr6~smtp_addr =
    t_data-email.
       CLEAR: lt_guids,ls_guids.
       LOOP AT lt_bu_guid INTO ls_bu_guid.
         ls_guids-bupartnerguid = ls_bu_guid.
         APPEND ls_guids TO lt_guids.
       ENDLOOP.
       CALL FUNCTION 'BAPI_TARGETGROUP_ADD_BP'
         EXPORTING
           targetgroupguid = p_tgguid
         TABLES
           return          = lt_return
           businesspartner = lt_guids.
    *&      Form  SUB_IMPORT_FROM_EXCEL
    *       text
    *      -->U_FILE     text
    *      -->C_DATA     text
    FORM sub_import_from_excel USING u_file TYPE localfile
    CHANGING c_data TYPE typ_xl_tab.
       CONSTANTS : const_max_row TYPE sy-index VALUE '65536'.
       DATA : l_dummy TYPE typ_xl_line,
              cnt_cols TYPE i.
       DATA : h_excel TYPE ole2_object,
              h_wrkbk TYPE ole2_object,
              h_cell TYPE ole2_object.
       DATA : l_row TYPE sy-index,
              l_col TYPE sy-index,
              l_value TYPE string.
       FIELD-SYMBOLS : <fs_dummy> TYPE ANY.
    * Count the number of columns in the internal table.
       DO.
         ASSIGN COMPONENT sy-index OF STRUCTURE l_dummy TO <fs_dummy>.
         IF sy-subrc EQ 0.
           cnt_cols = sy-index.
         ELSE.
           EXIT.
         ENDIF.
       ENDDO.
    * Create Excel Application.
       CREATE OBJECT h_excel 'Excel.Application'.
       CHECK sy-subrc EQ 0.
    * Get the Workbook object.
       CALL METHOD OF h_excel 'Workbooks' = h_wrkbk.
       CHECK sy-subrc EQ 0.
    * Open the Workbook specified in the filepath.
       CALL METHOD OF h_wrkbk 'Open' EXPORTING #1 = u_file.
       CHECK sy-subrc EQ 0.
    * For all the rows - Max upto 65536.
       DO const_max_row TIMES.
         CLEAR l_dummy.
         l_row = l_row + 1.
    * For all columns in the Internal table.
         CLEAR l_col.
         DO cnt_cols TIMES.
           l_col = l_col + 1.
    * Get the corresponding Cell Object.
           CALL METHOD OF h_excel 'Cells' = h_cell
             EXPORTING #1 = l_row
             #2 = l_col.
           CHECK sy-subrc EQ 0.
    * Get the value of the Cell.
           CLEAR l_value.
           GET PROPERTY OF h_cell 'Value' = l_value.
           CHECK sy-subrc EQ 0.
    * Value Assigned ? pass to internal table.
           CHECK NOT l_value IS INITIAL.
           ASSIGN COMPONENT l_col OF STRUCTURE l_dummy TO <fs_dummy>.
           <fs_dummy> = l_value.
         ENDDO.
    * Check if we have the Work Area populated.
         IF NOT l_dummy IS INITIAL.
           APPEND l_dummy TO c_data.
         ELSE.
           EXIT.
         ENDIF.
       ENDDO.
    * Now Free all handles.
       FREE OBJECT h_cell.
       FREE OBJECT h_wrkbk.
       FREE OBJECT h_excel.
    ENDFORM. " SUB_IMPORT_FROM_EXCEL
    Just copy paste the code and run the report select any local xls file with emails and pass the target group guid.
    snap shot of excel file:
    Let me know if it was useful.

  • How to create a group in SCOM 2012 R2 based on SCCM Collection?

    Is there a way to create a group in SCOM 2012 R2 based on sccm collection? I am planning to use that group for maintenance mode.
    Thanks, Samer

    Hi,
    I think you could query all the collectin members from SCCM database then use powershell to add them to a specific OU.
    How to Create Groups in Operations Manager
    http://technet.microsoft.com/en-us/library/hh298605.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

Maybe you are looking for

  • Display resolution settings

    I have a macbook hooked up to an Epson powerlite home cinema 720 and have had the display preferences set to 1280x720. I shut down the computer last night and when I woke up this morning the display was set to 800x600, I went to reset the display pre

  • Word-like Handling of Graphics

    The new version of Pages for Mavericks is a mess. I started working with Pages for complex scientific documents with many embedded graphics and their associated figure legends. Pages was great. You put the graphics where you wanted them lumped in a t

  • Condition Group Routines

    Hello, I was asked by my functional analyst to implement the ABAP code for the following scenario: A header pricing condition type's amount, say ZHDR, needs to be populated by the largest amount found in certain item pricing condition type (say all Z

  • How to set the textfield not to scroll the text?

    hi to all.... what will i do if i want the textfield not to scroll the text if the text is very long.. what if i wanted the text will just display "this is a test..." a three dots will be display before reaching the end of the textfield... i tried ge

  • Warehouse wise Profit Center

    Dear Experts, Consider the following scenario. The client has one plant and three warehouses. He manufactures as well as imports the FG. All the deliveries are done from either of the three warehouses. But while doing the sales order he doesn't know