Filtering values in It

Dear Experts,
  I have an Internal Table like below,
X        Y        Z
1        A       10
1        B       20
2        A       10
2        B       30
3        C       50
3        C       60
3        C       90
    I need to select the  highest Z value for each X. the output should be
F1    F2   F3
1      B       20
2      B       30
3      C       90
Can anyone pls send the code for this
Thanks in advance
karthik

Hi Karthik,
Please try this code and ITAB3 has all values that you want.
REPORT ZZFL_TEST07.
DATA: BEGIN OF ITAB OCCURS 0,
        F1(1),
        F2(1),
        F3(2) TYPE N.
DATA: END OF ITAB.
DATA: BEGIN OF ITAB2 OCCURS 0,
        KEY(2),
        F1(1),
        F2(1),
        F3(2) TYPE N.
DATA: END OF ITAB2.
DATA: BEGIN OF ITAB3 OCCURS 0,
        F1(1),
        F2(1),
        F3(2) TYPE N.
DATA: END OF ITAB3.
DATA: WA_ITAB2 LIKE ITAB2.
ITAB-F1 = '1'.
ITAB-F2 = 'A'.
ITAB-F3 = '10'.
APPEND ITAB.
ITAB-F1 = '1'.
ITAB-F2 = 'A'.
ITAB-F3 = '20'.
APPEND ITAB.
ITAB-F1 = '2'.
ITAB-F2 = 'B'.
ITAB-F3 = '10'.
APPEND ITAB.
ITAB-F1 = '2'.
ITAB-F2 = 'B'.
ITAB-F3 = '30'.
APPEND ITAB.
ITAB-F1 = '3'.
ITAB-F2 = 'C'.
ITAB-F3 = '50'.
APPEND ITAB.
ITAB-F1 = '3'.
ITAB-F2 = 'C'.
ITAB-F3 = '60'.
APPEND ITAB.
ITAB-F1 = '3'.
ITAB-F2 = 'C'.
ITAB-F3 = '90'.
APPEND ITAB.
LOOP AT ITAB.
  MOVE: ITAB-F1 TO ITAB2-KEY(1),
        ITAB-F2 TO ITAB2-KEY+1(1),
        ITAB-F1 TO ITAB2-F1,
        ITAB-F2 TO ITAB2-F2,
        ITAB-F3 TO ITAB2-F3.
  APPEND ITAB2.
ENDLOOP.
SORT ITAB2 BY KEY F3 DESCENDING.
DELETE ADJACENT DUPLICATES FROM ITAB2.
SORT ITAB2 BY KEY ASCENDING F3 DESCENDING.
LOOP AT ITAB2.
  WA_ITAB2 = ITAB2.
  AT NEW KEY.
    MOVE-CORRESPONDING WA_ITAB2 TO ITAB3.
    APPEND ITAB3.
  ENDAT.
ENDLOOP.
Regards,
Ferry Lianto

Similar Messages

  • Issue with filtering values in Web Template

    I am facing a problem with filtering values in Web Template.
    I have two queries based on two different data providers. One query is getting data from an Info set and the other from a Remote Cube. I have a single navigational block to filter values for both these queries but the change gets reflected only on the variable of one query. The other reflects no change and shows all the values irrespective of the filter condition.
    I have tried the option of setting in the properties of the navigational block, ‘affected data providers’ as both your data providers.But no effect.
    Can a single navigational block be used to filter values on 2 queries which are built on different data providers? If yes, can someone please tell me how it is possible?
    Kindly let me know how can I make the changes appear in both the queries?I am using SAP BI 3.5.
    Thanks & Regards,
    Suchitra

    Hi Peng,
    Frank also published a fix for 11g R1: http://www.oracle.com/technology/products/jdev/tips/fnimphius/rc_expand_menu_on_mouse_over.html
    function showMenu(event){
       var adfRichMenu = event.getSource();
       adfRichMenu.getPeer().show(null,true);
    }This should work.
    Luc Bors

  • Filtering Values from DDLB causes flickering

    Hi Experts,
    I am reducing the number of entries we have in a drop down list box for a standard field in an search overview page by means of redefining method 'get_dquery_definitions' of the controller class of the respective view and removing entries from table <rt_result>.
    Example:
    read table rt_result with key field = 'COST_TYPE' assigning <rt_result>.
    delete <rt_result>-options index 1.
    This method is executed twice: Once when the search view is created and once when the applicable search field is selected (as this field is not visible by default when the view is built).
    Functionally, the filtering works fine but what when the DDLB is built we see some kind of flickering before the values are displayed which seems to be caused by the sandclock showing up and being hidden again very quickly a number of times. Different from the example above we are not only removing a single entry from the DDLB but instead are reducing the list of entries significantly. When we only remove a single entry from the list, the flickering does not occur.
    Does anybody know where this flickering comes from (e.g. AJAX roundtrips) and how it can be suppressed?
    Thanks a lot and Regards,
    Jens

    Hi Jens,
    What method are you using to populate the drop down initially?
    Does the V getter method of that attribute create an object which uses interface IF_BSP_WD_VALUEHELP_DESCRIPTOR?
    If so you could restriuct the values in the class before the page is rendered.
    Gregor

  • Aggregating variables and hiding/filtering values

    Hi Everyone
    I have a pivot table and chart (chart screenshot below) that has monthly intervals along the x-axis. The chart presents a cumulative percent based on aggregating records along the variable on the x axis.
    The problem is that I want to give people the ability to hide certain month intervals at will (specifically the initial .5 -> 5 months ones). However, when someone hides any of the initial intervals, the cumulative number starts with the month value displayed
    (as filtered by the user) and not from the beginning.
    Is there a way to modify the below functions to override the user filter for this and cumulate along all the intervals?
    =(CALCULATE(countrows(s1Perm1),FILTER(ALL(s1Perm1[ExitMonthCategory]),s1Perm1[ExitMonthCategory] <= MAX(s1Perm1[ExitMonthCategory]))))/(CALCULATE(COUNTROWS(s1Perm1),ALL(s1Perm1[Exit],s1Perm1[ExitMonthCategory])))
    Paul

    Hi Paul,
    I guess I am misunderstand something but if I try that on the copy of that worksheet from your previous posting, the result looks to me right according to your description - the Pivot table would show the following values with a slicer set to start with
    6 - 27,4% is the same value that the pivot table would show for month 6 if the previous months were selected too:
    StartYear
    Values
    2008
    ExitMonthCategory
    Den
    Num
    CumPercent
    6
    10.580
    2901
    27,4 %
    12
    10.580
    4276
    40,4 %
    18
    10.580
    5308
    50,2 %
    24
    10.580
    5935
    56,1 %
    30
    10.580
    6392
    60,4 %
    36
    10.580
    6729
    63,6 %
    42
    10.580
    6912
    65,3 %
    48
    10.580
    7035
    66,5 %
    Julian Wissel | BI for NAV @ http://en.navbi.com | Blog @ blog.navida.eu

  • Analysis Authorization Pre Filtered Values

    Hi all Gurus,
    I am currently using Analysis Authorization setup and when I run report with no values input in the variable input screen it seems to display ALL the records in the info provider BUT not by what I am able to see based on my authorization defined.
    Example:
    I am authorized to see Personnel Area = A but when i run the report it hits authorization error and I understand that it is displaying ALL the records.
    So my question is is it possible that this filter is automatically for Analysis Authorization handled by the system like how the OLD Authorization handle this?
    Thanks

    Hello Julie,
    It is not necessary to use Hierarchy or customer exit inorder to restrict the access based on company code.
    1. First of all make, Company code as authorization relevent in IO settings
    2. In RSECADMIN, create one authorization object. It is a good practice to include all SAP Technical objects also. Just click on Inster special characts.
    3. For the company code assign required value.
    4. Assign this authorization to user in USER tab
    5. In the report, If you want to defualt the value of company code, create one authorization relevent variable for company code. You can make this variable as ready for input/Not ready for input.
    6. Execute the report.
    The user will only get data related to authorized company code.
    Regards,
    Ravindra

  • Filtering values of a query in a web template through URL. Help please!

    Hi all,
    I've designed some web templates based on 3.x queries and I'm facing a problem trying to filter the values the users can see, though URL.
    I know how to filter a value of a characteristic in the URL, for example:
    http://.../SAP/BW/BEX?...&CMD=LDOC&TEMPLATE_ID="web_template_name"&FILTER_IOBJNM=0AREA&FILTER_Value=001
    It shows the default values for the characteristics (Area=1), but it doesn't restrict the query to these values. The problem is that the user can choose another value of the characteristic, through the navigation_block for example (Area=2 or 3 or...).
    What I need is to restrict the query in the URL with some values (Area=1 for example) so that the other areas don't appear in the query.
    I've read some documents but I don't have the solution yet. For example:
    http://help.sap.com/saphelp_nw04/helpdata/en/44/b26a3b74a4fc31e10000000a114084/frameset.htm
    Any ideas please??
    Iñaki

    Hi,
    For your scenario you could use variables which are not changeable during runtime. Please refer to the following documentation. If you do not check the option 'Can Be Changed with Query Navigation' the variable will not be changeable during navigation.
    http://help.sap.com/saphelp_nw04/helpdata/en/22/1e9b3c334d8c15e10000000a114084/frameset.htm
    If you want to restrict certain users to certain data please also consider the authorization concept, which is the safest way of doing this.
    Best regards,
    Janine

  • Filtering values in Matrix

    Hi All,
    We have a UDO with three tables. In fact it contains a Mater table, a child table and child to child. But in UDO we defined the  third table as a child to master itself.
    We created a  form in which we have header part for master table and two matrix for child tables.
    The problem we facing is that  when user selects a record in first matrix, he should be able to enter data related to that row in the second matrix. When he moves to the next row in first matrix, second matrix should hide existing data and should be ready to accept data related to current row in first matrix without loosing the earlier entered data related to first row. The same should happen while updation also.
    Please help
    Thanks in Advance
    Ajith G

    Hi Satish,
    This is Toms on behalf of Mr Ajith. on the above query.
    The functionality is like this:
    We want to create an Item Property master screen.
    Defining new properties and its applicability to Item Groups and  its values
    applicable to each Item Group.
    Property:.......Item group...........Values
    Colour.........   Refrigerator.........Silver
    .. ...........................................Steel
    .. ...........................................Red
    .. ...........................................Grey etc.
    .....................TV.... ................Black
    ..............................................Silver etc.
    Here, Item Groups are in the 1st matrix, and Applicable Values corresponding to the Property is in the 2nd matrix.
    There are 3 tables, one for the property, other one for the Applicable Item groups
    and the third one for the applicable property values corresponding to each Item group.
    Regards,
    Toms
    Edited by: TomsPA on Jan 29, 2010 1:27 PM

  • Filtering values in BMM layer

    Hi All,
    can we filter values or add filter condition for logical column in the BMM layer, i could see we can add where condition only in LTS of the logical table, i could see we could use FILTER display function but it can be used only with measure, i want to filter store values which is a dimension, is there any way round we could do this without creating any extra aliases and extra logical table.
    Thanks,
    Sreekanth
    Edited by: JUPS on Sep 6, 2010 6:21 PM

    hi,
    1)Create one session variable by writing a query in initialization block like
    select 'order' ,order_name from order_dim where order_name like '%Abc%'
    2) Variable to be row-wise-initialization
    3) In report pull order_name and click on Filter-->Advanced-->convert to sql
    give condition like
    SRC_ORDER_LINES.ORDER_ID = (VALUEOF(NQ_SESSION.order))
    Let me know if this doesn't work
    Thanks,
    Saichand.v

  • Filtered Value in Reports

    Hi all,
    I have a requirement where in whenever a user filters on any characteristic in the report a dynamic text should appear on a screen which says, "Report filtered by - XXXX".
    I tried using info item and dynamic filters but that doesnt serve my purpose , because they are always visible on the screen even if the data is not filtered on any characterictic.
    Can anyone please help me with this.
    Any ideas or suggestions will be very helpfull.
    I promise to assign points for helpfull answers.
    Thanks in advance,
    Vivek

    If you are using the web application designer, the "filter" web item could be entered above the query results.  The properties of the "filter" could be set to always show by removing the checkmark from "collapsed".
    If you are not using a web template, a simple BEX query that has the first object placed in the rows section would sort the results by the characteristic which the user entered via a variable.  The column heading could be changed to be anything that you want it to say.

  • Oracle OA Framwork Personalizations - Filtering values in LOV

    The launch journal wizard screen gives us a pick list to choose an ADI template from.
    Our list of values have 3 templates for Actuals journals and 3 for Budgets.
    Our requirement is that the Business Analyst responsibility should only see Budget templates and not the Actuals.
    I am thinking of using personalizations to filter the list of values.
    In Forms Builder page this personalization is a piece of cake. You build a new record group on the fly and attach it to the LOV. This way you can restrict values in a LOV in the context of a particular responsibility.
    Is that even do-able in a OA Framework page? Can we build a record group equivalent (LOV Region?) on the fly and attach it to an existing LOV? When I click on personalize button on this page I dont see any such options. In fact the personalize page for OA Framework looks so daunting as oppose to a Forms Builder page perhaps because my OA Framework skills are not as good as Forms Builder.
    Any help is appreciated on: if this is possible using personalizations and how?
    Thank you in advance.

    Try the OA Framework forum

  • Filtering values in a dropdown list box

    Hello Team
    In the BSP application CRM_IC, we want a drop down list box to be filled based on the entry selected from another dropdown list box. We have all the entries for the second drop down box in ABAP internal table .However, we do not want a server round trip to happend in doing so. Thus we have used the attribute 'Onclientselect' and we are trying to call a java script function call on this event to filter this ABAP internal table . In this function, we would like to fill the contents of the second dropdown list box after reading the contents of the first dropdown list box. Please advice us as to how this can be achieved. Basically, we observed that ABAP server side script is not executed in the java function.
    Thanks
    Rony

    Rony,
    I have used the following technique to synchronize the
    contents of two drop down list boxes.
    <b>Scenario:</b>
    The selection in listbox ddlbxSystemEquipNum, which I
    will call "A", determines the contents of listbox
    ddlbxModuleEquipNum, which I will call "B".
    I use a JavaScript array to shadow the ABAP internal
    table containing the possible values for listbox B.
    When the page is initially displayed, listbox B is
    populated from the ABAP internal table.
    When a new selection is made in listbox A, I use the
    onClientSelect event to call a JavaScript function,
    updateModuleList(), to update the contents of listbox B
    from the JavaScript shadow array based on the selected
    value in listbox A.
    <b>Code Excerpts:</b>
    <u>Declare the JavaScript shadow array and listbox B update function</u>
    <script language="javascript" type="text/javascript">
        var moduleArray = new Array();
        function updateModuleList() {
            var selSystem = frmNrg1100.ddlbxSystemEquipNum;
            var selModule = frmNrg1100.ddlbxModuleEquipNum;
            // Get selected system equipment number
            var selected_system =
                    selSystem.options[selSystem.selectedIndex].value;
            // Clear module select options
            selModule.options.length = 0;
            // Add module select options for the selected system
            var j = 0;
            for (var k = 0; k < moduleArray.length; k++) {
                if ( (selected_system == moduleArray[k].system) ||
                                         moduleArray[k].system == "") {
                    selModule.options[j++] = new Option(moduleArray[k].text,
                                   moduleArray[k].value,
                                   moduleArray[k].selected) ;
    </script>
    <u>Specify the onClientSelect event handler on list box A</u>
    <htmlb:dropdownListBox
        id = "ddlbxSystemEquipNum"
        width      = "400"
        onClientSelect = "updateModuleList()"
    <u>ABAP and JavaScript to populate internal table and shadow array of possible values for listbox B</u>
    <%
    loop...
            wa_module_options-system   = wa_customer_tool-equipment_num_t.
            wa_module_options-text     = tool_list_text.
            wa_module_options-value    = wa_customer_tool-equipment_num_m.
            wa_module_options-selected = selected.
            append wa_module_options to module_options.
    %>
    <script language="javascript" type="text/javascript">
        // Add all possible Module select options to a JavaScript array of objects
        moduleArray[moduleArray.length] = {  system:"<%=wa_module_options-system %>",
                                               text:"<%=wa_module_options-text %>",
                                              value:"<%=wa_module_options-value %>",
                                           selected:"<%=wa_module_options-selected %>" } ;
    </script>
    <%
    endloop.
    %>
    Hope this helps.
    Regards,
    Shawn

  • Filtering values in prompts

    Hi Everybody
    We have a requirement where a column called "Role" will have a both numberic and character values in it.
    Ex: 01 , 02 , .99 , .98 , 101 , PRM , PRS , EOS , PMS etc.
    Now the user doesnt want any of these numeric values to appear in prompts where user wants to select the values while running it in a dashboard.
    How can i restrict numeric values appearing for the user , so that they can only be able to see these characters instead of numeric values?
    Please help me on this as this is a bit critical requirement for us to deliver.
    Thanks a lot for your time on this in advance.
    Regds
    Mano

    Hi Mano,
    Within the dashboard prompt, set the SQL statement to be something like the following...
    SELECT *<your role column>* FROM *<your subject area>*
    WHERE *<your role column>* BETWEEN 'A' and 'Z'
    JB

  • BD64 Filtering Value (Sale org/ Distri Channel) need to get in EXIT_SAPLMV01_002

    IHi ,
    In BD64, Under MATMAS Data filtration is set on Sales Org and Distribution Channel. When I am sending material from BD10 , I need to get these values ( Sale Org / Distribu Channel ). B'cos on the basis of these values I need to fetch PLANT from MVKE table by passing SOrg and Dchl .
    I am reading Segment value in exit EXIT_SAPLMV01_002, but , these values are present at MVKE Segment but I need those values at MARC Segment and MVKE Segment trigger at last where MARC segment trigger initially , So I am not able capture values in Segment also.
    On the basis on MARC-MATERIAL & MVKE-PLANT , I need to fetch TRLT (Lead Time) from MARC.
    How to retrieve Sale Org/ Dch either from Filtration Set at BD64 or from MVKE Segment that is triggering later then MARC Segemnt??
    Regards
    Ankesh

    Hello Ankesh,
    Modify MARC segment after MVKE is filled.
    Please find the below sample code :-
    Loop at IDOC_DATA  into WA_ IDOC_DATA  .
    case wa_idoc_data-SEGNAM.
    when 'E1MVKEM'
    READ TABLE IDOC_DATA into WA_ido WITH KEY segname = E1MARCM     
    if sy-subrc = 0.
    *write your logic here and modify idoc_data
    endif.                               
    endcase.
    Endloop.
    Thanks

  • Getting filtered values from TableView

    Hi,
      We have a TableView whose columns can be sorted. Iwant to select a few rows and make the selected rows editable in another page.
      If it is a unsorted/unfiltered TableView, am able to do it as the ABAP Internal Table and the TableView are the same in terms of record index positions. But am facing problem after i sort/filter the TableView because now the index of the TableView are different from the index of the ABAP Internal Table present in server.
      Anybody who has dealt with this problem earlier and can guide us.
    Thanks,
    Chathia.

    Welcome to SDN.
    Search the forum before you post a question, generally in mose cases you would find a answer, if not you can post a new thread.
    here is a list of threads where your question was discussed. (as others mentioned its about using keyColumn attribute of htmlb:tableview)
    check out these threads, its got code samples as well.
    Re: HTMLB Tableview: questions..;
    Re: pic actual data from a table view
    Re: Error when using Filter and Sort together on a tableview
    Re: Change rendering of the title column...
    Have a great time in SDN.
    Regards
    Raja

  • Filtering values in segment search

    Hi,
    I want to show only profle sets in the result view in segment search( Component name SEGAS_SEG). Currently system is showing up the result in tree structure profile set, profile and TG. How can I stop to show profile and TG?
    Thanks.

    Hi,
    You are removing the row from a particular table. This doesn't mean you are removing row, you are removing contents of the row.
    To achieve your requirement create a new table and add rows except your unwanted rows.
    Regards,
    Sateesh Chandra

Maybe you are looking for