Multiple level of subtotal in alv

Hi Experts,
                Can any one tell me how to get multiple level of subtotal in alv?
I am using function module to get the output.

Hi Surajit
can you explain ur requirement
Regards
Prabumanoharan

Similar Messages

  • Multiple levels in ALV Hierarchy

    Hi All
    How to display Multiple levels in ALV Hierarchy.
    I have header and Item Tables but Under Header Expansions I have to display one more Expansion.
    Means Multiple levels.

    Hi,
      I think you can check standard program BCALV_TEST_HIERSEQ_LIST
    Regards,
    Himanshu

  • Adding row after subtotal in ALV

    Hi Guys,
    can we add one row after the subtotal in ALV.
    Like the below...
    field1 field2 field3 field4
    Sub total. 120 121 125 130
    Test 150
    can you help me about the above...
    Thanks,
    Lingesh

    Hi
    If you use GROUPLEVEL_CHANGE you have to creare a form like this:
    FORM GROUPLEVEL_CHANGE
                   USING P_LINEINFO TYPE SLIS_LINEINFO
                         LS_GROUPS   TYPE KKBLO_GROUPLEVELS.
    ENDFORM.                    "GROUPLEVEL_CHANGE
    In the P_LINEINFO you have details of row and in the LS_GROUPS details of level of sorting.
    For example I used it to re-write subtotal:
    FORM GROUPLEVEL_CHANGE USING P_LINEINFO TYPE SLIS_LINEINFO
                                LS_GROUPS   TYPE KKBLO_GROUPLEVELS.
      PERFORM WRITE_SUB_TOTAL USING LS_GROUPS.
    ENDFORM.                    "GROUPLEVEL_CHANGE
    FORM WRITE_SUB_TOTAL  USING    P_GROUPS TYPE KKBLO_GROUPLEVELS.
      DATA: TOT_SALDO_A     LIKE BSID-DMBTR,
            TOT_FATTURATO_A LIKE BSID-DMBTR,
            TOT_DSO_A       LIKE BSID-DMBTR.
      DATA: WA_GROUP        TYPE KKBLO_GROUPLEVELS.
      DATA: RUN_LEVEL       TYPE I.
      DATA: BEGIN OF T_LEVEL OCCURS 1,
              LEVEL       TYPE I,
              INDEX_FROM  TYPE I,
              INDEX_TO    TYPE I,
            END   OF T_LEVEL.
      T_LEVEL-LEVEL      = P_GROUPS-LEVEL.
      T_LEVEL-INDEX_FROM = P_GROUPS-INDEX_FROM.
      T_LEVEL-INDEX_TO   = P_GROUPS-INDEX_TO.
      APPEND T_LEVEL.
    Check livel:
      CALL FUNCTION 'ALV_GROUPLEVELS_GET'
       IMPORTING
         ET_GROUPS                 = GT_GROUP
        TABLES
          T_OUTTAB                  = <FS_OUTPUT>.
      RUN_LEVEL = P_GROUPS-LEVEL + 1.
      IF RUN_LEVEL <= LEVEL.
        DO.
          LOOP AT GT_GROUP INTO WA_GROUP
                    WHERE INDEX_FROM => P_GROUPS-INDEX_FROM
                      AND INDEX_TO   <= P_GROUPS-INDEX_TO
                      AND LEVEL      = RUN_LEVEL.
            T_LEVEL-LEVEL      = RUN_LEVEL.
            T_LEVEL-INDEX_FROM = WA_GROUP-INDEX_FROM.
            T_LEVEL-INDEX_TO   = WA_GROUP-INDEX_TO.
          ENDLOOP.
          IF SY-SUBRC = 0.
            APPEND T_LEVEL.
          ENDIF.
          RUN_LEVEL = RUN_LEVEL + 1.
          IF RUN_LEVEL > LEVEL. EXIT. ENDIF.
        ENDDO.
      ENDIF.
      SORT T_LEVEL BY LEVEL DESCENDING.
      LOOP AT T_LEVEL.
        TOT_SALDO_A = TOT_FATTURATO_A = 0.
        LOOP AT <FS_OUTPUT> INTO <FS_WA_OUT>
                            FROM T_LEVEL-INDEX_FROM
                              TO   T_LEVEL-INDEX_TO.
          ASSIGN COMPONENT 'ZSALDO'
              OF STRUCTURE <FS_WA_OUT> TO <FS_SALDO>.
          ASSIGN COMPONENT 'ZFATTURATO'
              OF STRUCTURE <FS_WA_OUT> TO <FS_FATTURATO>.
          TOT_SALDO_A     = TOT_SALDO_A     + <FS_SALDO>.
          TOT_FATTURATO_A = TOT_FATTURATO_A + <FS_FATTURATO>.
        ENDLOOP.
        TOT_SALDO     = TOT_SALDO     + TOT_SALDO_A .
        TOT_FATTURATO = TOT_FATTURATO + TOT_FATTURATO_A.
        PERFORM CALCULATE_DSO USING TOT_FATTURATO_A
                                    TOT_SALDO_A TOT_DSO_A.
        PERFORM WRITE_TOT_DSO
                      USING TOT_SALDO_A
                            TOT_FATTURATO_A TOT_DSO_A
                            T_LEVEL-LEVEL T_LEVEL-INDEX_FROM.
      ENDLOOP.
    ENDFORM.                    " WRITE_SUB_TOTAL
    Max

  • How to apply List box for multiple selection of rows  in ALV report ?

    Hi Exprots,
    1: How to apply List box for multiple selection of rows  in ALV report ?
    Thanking you.
    Subash

    hi,
    check the below program.
    REPORT zalv_dropdowns.
    *Type pools declarations for ALV
    TYPE-POOLS : slis.
    *data declarations for ALV container,ALV grid, Fieldcatalogues & layout
    DATA: g_grid  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          gt_fieldcat TYPE lvc_t_fcat,
          gs_layout TYPE lvc_s_layo.*INTERNAL TABLE AND WA DECLARATIONS FOR t517 A table
    DATA: gt_outtab TYPE STANDARD TABLE OF t517a INITIAL SIZE 0,
          wa_outtab TYPE t517a.
    START-OF-SELECTION.*Call to ALV
      CALL SCREEN 600.*On this statement double click  it takes you to the screen painter SE51.
    *Create a Custom container and name it CCONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    *Now a normal screen with number 600 is created which holds the ALV grid.
    PBO of the actual screen , Here we can give a title and customized menus
    Here we also call the subroutine for ALV output.
          MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      PERFORM alv_output.
    ENDMODULE.                    "pbo OUTPUT
          MODULE PAI INPUT                                              *
    MODULE pai INPUT.
    ENDMODULE.                    "pai INPUT
    *&      Form  BUILD_FIELDCAT
    FORM build_fieldcat.
    DATA ls_fcat TYPE lvc_s_fcat.
    *Build the field catalogue
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'T517A'
        CHANGING
          ct_fieldcat      = gt_fieldcat.
    To assign dropdown in the fieldcataogue
      LOOP AT gt_fieldcat INTO ls_fcat.   
    CASE ls_fcat-fieldname.
       WHEN 'SLART'.
    *is the first list box
            ls_fcat-drdn_hndl = '1'.
            ls_fcat-outputlen = 15.
            MODIFY gt_fieldcat FROM ls_fcat.
    is the second list box    
    WHEN 'ABART'.       
            ls_fcat-drdn_hndl = '2'.
            ls_fcat-outputlen = 15.
            MODIFY gt_fieldcat FROM ls_fcat.   
    ENDCASE.
      ENDLOOP.
    ENDFORM.                    "build_fieldcat
    *&      Form  ALV_OUTPUT
    FORM alv_output .*Create object for container
      CREATE OBJECT g_custom_container
             EXPORTING container_name = 'CCONT'.
    *create object for grid
      CREATE OBJECT g_grid
             EXPORTING i_parent = g_custom_container.
    Build fieldcat and set column
    *Assign a handle for the dropdown listbox.
      PERFORM build_fieldcat.
    *Build layout
      PERFORM build_layout.
    Define a drop down table.
      PERFORM dropdown_table.
    *fetch values from the T517A table
      SELECT * FROM t517a INTO TABLE gt_outtab.
    *Display ALV output
      CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
        CHANGING
          it_fieldcatalog = gt_fieldcat
          it_outtab       = gt_outtab.ENDFORM.                               "ALV_OUTPUT
    *&      Form  dropdown_table
          text
    -->  p1        text
    <--  p2        text
    FORM dropdown_table.*Declarations for drop down lists in ALV.
      DATA: lt_dropdown TYPE lvc_t_drop,
            ls_dropdown TYPE lvc_s_drop.
    First SLART listbox (handle '1').
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '01 Primary school'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '1'.
      ls_dropdown-value = '02 Lower Secondary'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '1'.
      ls_dropdown-value = '03 Upper Secondary'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '04 Professional School'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '05 College'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '06 University'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '09 Other Establishment'.
      APPEND ls_dropdown TO lt_dropdown.* Second ABART listbox (handle '2').  ls_dropdown-handle = '2'.
      ls_dropdown-value = '10 Primary School certificate'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = '20 Lower secondary/Junior high'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '30 High school diploma(B-levels)'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = '31 Vocational'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '32 Matriculation'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '40 Specialist vocational certificate'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '50 College degree Level1'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '51 College degree Level2'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '52 Masters degree'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '60 Univ Degree level1'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '61 Bachelors degree'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '62 Masters degree'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '63 Licenciate'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '64 Doctors Degree Ph.D'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '89 None'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '90 Unknown'.
      APPEND ls_dropdown TO lt_dropdown.*method to display the dropdown in ALV
      CALL METHOD g_grid->set_drop_down_table
        EXPORTING
          it_drop_down = lt_dropdown.ENDFORM.                               " dropdown_table
    *&      Form  build_layout
          text
    *layout for ALV output
    FORM build_layout .  gs_layout-cwidth_opt = 'X'.
      gs_layout-grid_title = 'ALV DROPDOWN LISTS'.
      gs_layout-no_toolbar = 'X'.ENDFORM.                    " build_layout
    endform.
    Edited by: S.r.v.r.Kumar on Jun 1, 2009 2:48 PM

  • SUBTOTAL  IN  ALV   REPORT

    hello freinds,
    I am facing problem of subtotal in alv report.
    I am explaining my problem.....................
    In my report there are 8 columns...
    in first colum there is <b>'Acount Number'</b> field. I have to sort out it.and I have done it succesfully. Now in my seventh and eighth column there are fields 'PAYMENT GROSS AMOUNT' and ' IVA AMOUNT' respectively.
    Now I have to do subtotal of these two columns (7th & 8th) according to first column value i.e Acount Number.
    Please send me solution.
    Thanks in Advance........

    Hi,
    try this code ,hope usefull to u, please reward point if usefull to u.
    *& Report  ZALV_SUBTOTAL
    This program lists orders (VBAK) with sort and sub-total for        *
    'sold-to-party' (KUNNR) and 'Sales organization' (VKORG)            *
    REPORT  ZALV_SUBTOTAL.
    TABLES : vbak.
    TYPE-POOLS: slis.                      " ALV Global types
    SELECT-OPTIONS :
      s_vkorg FOR vbak-vkorg,              " Sales organization
      s_kunnr FOR vbak-kunnr,              " Sold-to party
      s_vbeln FOR vbak-vbeln.              " Sales document
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
    PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    DATA:
      BEGIN OF gt_vbak OCCURS 0,
        vkorg LIKE vbak-vkorg,             " Sales organization
        kunnr LIKE vbak-kunnr,             " Sold-to party
        vbeln LIKE vbak-vbeln,             " Sales document
        netwr LIKE vbak-netwr,             " Net Value of the Sales Order
        waerk LIKE vbak-waerk,             " Document currency
      END OF gt_vbak.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data.
      PERFORM f_display_data.
         Form  f_read_data
    FORM f_read_data.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
               FROM vbak
                 UP TO p_max ROWS
              WHERE kunnr IN s_kunnr
                AND vbeln IN s_vbeln
                AND vkorg IN s_vkorg.
    ENDFORM.                               " F_READ_DATA
         Form  f_display_data
    FORM f_display_data.
      DEFINE m_fieldcat.
        add 1 to ls_fieldcat-col_pos.
        ls_fieldcat-fieldname   = &1.
        ls_fieldcat-ref_tabname = 'VBAK'.
        ls_fieldcat-do_sum      = &2.
        ls_fieldcat-cfieldname  = &3.
        append ls_fieldcat to lt_fieldcat.
      END-OF-DEFINITION.
      DEFINE m_sort.
        add 1 to ls_sort-spos.
        ls_sort-fieldname = &1.
        ls_sort-up        = 'X'.
        ls_sort-subtot    = &2.
        append ls_sort to lt_sort.
      END-OF-DEFINITION.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv,
        lt_sort     TYPE slis_t_sortinfo_alv,
        ls_sort     TYPE slis_sortinfo_alv,
        ls_layout   TYPE slis_layout_alv.
      m_fieldcat 'VKORG' ''  ''.
      m_fieldcat 'KUNNR' ''  ''.
      m_fieldcat 'VBELN' ''  ''.
      m_fieldcat 'NETWR' 'X' 'WAERK'.
      m_fieldcat 'WAERK' ''  ''.
      m_sort 'VKORG' 'X'.                  " Sort by vkorg and subtotal
      m_sort 'KUNNR' 'X'.                  " Sort by kunnr and subtotal
      m_sort 'VBELN' ''.                   " Sort by vbeln
      ls_layout-cell_merge = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                is_layout   = ls_layout
                it_fieldcat = lt_fieldcat
                it_sort     = lt_sort
           TABLES
                t_outtab    = gt_vbak.
    ENDFORM.                               " F_DISPLAY_DATA
    END OF PROGRAM Z_DEMO_ALV_SORT **********************
    Regards
    fareedas

  • Multiple Lines in a Single ALV Grid Cell

    Is there any way to Display Multiple Lines in a Single ALV Grid Cell.
    This can be accomplished by Sorting the First 3 fields and Make it Looks like below displayed format.
    But My problem is while downloading also it should be Displayed in the same format.
    All inputs are highly appreciated.

    there was a post similar to this some days back... search it..
    any ways...
    what u can do is...
    arrange ur final internal table so that it will look like same line...
    like...lets say ur internal table is :
    A1 B1 C1 D1 123
    A1 B1 C2 D2 123
    A1 B2 C1 D1 123
    A1 B2 C2 D2 123
    and u can rearrange ur table to be like
    A1 B1 C1 D1 123
          C2 D2 123
    A1 B2 C1 D1 123
          C2 D2 123
    what i mean to say is dont pass the fields if they are same in the previous line... try it out..
    and then pass it two ur ALV.
    it will look like they are in one line
    Edited by: soumya prakash mishra on Jun 17, 2009 1:31 PM

  • How to find out the total, subtotal in alv report

    hi dears,
    how to find out the total, subtotal in alv report?
    pls tell me logic ,
    i will be waiting for eply
    regards
    eswar

    Hi,
    <b>ALV Grid List with sub-totals</b>
    REPORT z_demo_alv_sort.
    * This program lists orders (VBAK) with sort and sub-total for        *
    * 'sold-to-party' (KUNNR) and 'Sales organization' (VKORG)            *
    TABLES : vbak.
    TYPE-POOLS: slis.                      " ALV Global types
    SELECT-OPTIONS :
      s_vkorg FOR vbak-vkorg,              " Sales organization
      s_kunnr FOR vbak-kunnr,              " Sold-to party
      s_vbeln FOR vbak-vbeln.              " Sales document
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(27) v_1 FOR FIELD p_max.
    PARAMETERS p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    DATA:
      BEGIN OF gt_vbak OCCURS 0,
        vkorg LIKE vbak-vkorg,             " Sales organization
        kunnr LIKE vbak-kunnr,             " Sold-to party
        vbeln LIKE vbak-vbeln,             " Sales document
        netwr LIKE vbak-netwr,             " Net Value of the Sales Order
        waerk LIKE vbak-waerk,             " Document currency
      END OF gt_vbak.
    INITIALIZATION.
      v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data.
      PERFORM f_display_data.
    *      Form  f_read_data
    FORM f_read_data.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE gt_vbak
               FROM vbak
                 UP TO p_max ROWS
              WHERE kunnr IN s_kunnr
                AND vbeln IN s_vbeln
                AND vkorg IN s_vkorg.
    ENDFORM.                               " F_READ_DATA
    *      Form  f_display_data
    FORM f_display_data.
      DEFINE m_fieldcat.
        add 1 to ls_fieldcat-col_pos.
        ls_fieldcat-fieldname   = &1.
        ls_fieldcat-ref_tabname = 'VBAK'.
        ls_fieldcat-do_sum      = &2.
        ls_fieldcat-cfieldname  = &3.
        append ls_fieldcat to lt_fieldcat.
      END-OF-DEFINITION.
      DEFINE m_sort.
        add 1 to ls_sort-spos.
        ls_sort-fieldname = &1.
        ls_sort-up        = 'X'.
        ls_sort-subtot    = &2.
        append ls_sort to lt_sort.
      END-OF-DEFINITION.
      DATA:
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv,
        lt_sort     TYPE slis_t_sortinfo_alv,
        ls_sort     TYPE slis_sortinfo_alv,
        ls_layout   TYPE slis_layout_alv.
      m_fieldcat 'VKORG' ''  ''.
      m_fieldcat 'KUNNR' ''  ''.
      m_fieldcat 'VBELN' ''  ''.
      m_fieldcat 'NETWR' 'X' 'WAERK'.
      m_fieldcat 'WAERK' ''  ''.
      m_sort 'VKORG' 'X'.                  " Sort by vkorg and subtotal
      m_sort 'KUNNR' 'X'.                  " Sort by kunnr and subtotal
      m_sort 'VBELN' ''.                   " Sort by vbeln
      ls_layout-cell_merge = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                is_layout   = ls_layout
                it_fieldcat = lt_fieldcat
                it_sort     = lt_sort
           TABLES
                t_outtab    = gt_vbak.
    ENDFORM.                               " F_DISPLAY_DATA
    ***************** END OF PROGRAM Z_DEMO_ALV_SORT **********************
    Regards
    Sudheer

  • CL_SALV_HIERSEQ_TABLE - Multiple level heirachial sequential list

    Class CL_SALV_HIERSEQ_TABLE  -  Can this class be used for multiple level heirarchial sequential list ?
    It works perfect for 2 level heirarchial list u2013 Thanks to Rich Heilman. Say for Eg, SCARR and SFLIGHT.
    My requirement has more levels. I looked into all the methods of the class, but none of them seems to help to append more levels.
    Here is my requirement.
    Selection screen had date range,  partner functions etc ..
    -->Select all Inquiries for given date range or (TABLE u2013 VBAK) given sold to party/ship to party etcu2026
    -->Get all statuses (system status /user status etc (TABLE u2013 JCDS and TJ30T ).
    -->Select all Quotations for given inquiry, if any
    -->Select all Orders for the selected quotations, if any
    -->Select all deliveries for selected orders, if any and read status, whether shipped or not (VBFA/LIKP/ VBUK )
    And list these in a multilevel heirarchial mode
    Inquiry1/created by/created on/ sold to party/ Application engineer/inside sales Rep
         Status1 / description/ active /  changed by / date      
         Status2/ description/ active /  changed by / date
         u2026..
         u2026..
         Status 5u2026..
              Quotation1 / Created on /created by/quantityu2026
                   Order1/created on/created by/
                        Delivery1 /created on / created by/ not shipped
                        Delivery2/ created on / created by / partially shipped
                   Order2/created on/created by
    Inquiry2/created by/created on/ sold to party/ Application engineer/inside sales Rep
         Status1 / description/ active /  changed by / date      
         Status2/ description/ active /  changed by / date
         u2026..
         u2026..
         Status 5u2026..
              Quotation1 / Created on /created by/quantityu2026
    I need atleast 3 internal tables, 1 for Inquiry, another for status data, another for Quotation/order/delivery.
    Anyone has any clue, how to achieve this ? cl_salv_tree also doesnu2019t seems to helpu2026
    As per my understanding, we could pass only 1 single structure to a tree output.
    For eg, all lines of the tree output should be of the same structure. (please correct me if I am wrong )..
    But In my case, the fields on each level are different, and I need to pass different structures to the tree.
    Please let me know, if anyone have a clue..
    Thanks much

    Sujamol (or anyone),
    did you ever manage to do this? I would like to do the same.
    Report SALV_DEMO_HIERSEQ_COLUMN does it for two levels. What about 3, 4.....?
    Thanks.

  • Problem in Aggregate with Multiple level of dimension

    Hi,
    I have a BI repository with a snowflake schema. I have also designed the business model with snowflake, It works with drilling and all but I am facing problem when I am
    creating  a logical column aggregating with a higher level of dimentation. Let me illustrate that :
      I have the Following Hierarchy :
    Tournament(id, Name) ---- > Round (id, name, tournament_id) -------> Match (id, Name, RoundId ) |  Match is fact table and other 2 dimension.
      I also created a logical dimension called tournament with 3 levels.
      Now say I want to create a logical column Total Number of Matches , aggregating  to the dimension level of Tournament. The result gives counts a 0 for every tournament. However
      it is working perfectly when the dimension level is Round (which is the immediate next level after fact).
      The Logical request generated (in case of Tournament level) :
       MatchId:[DAggr(Measure1.MATCHID by [ Matches$.TournamentId]  SB Tournament)] as c1 GB.   
        There is no such column as TournamentId in Matches$ table. How does the BI server got this ?
       The execution plan  evaluate this:
         cast(NULL as  INTEGER )  as c1 GB [for database 0:0,1]
       Can someone please explain why is this happening, is it because of the snowflake schema, but I guess if BI server can handle a snowflake schema it should work the Aggregate
       properly in multiple levels of dimensions, or it is something I am doing wrong.
       Execution Environment:
         Windows XP ,  OBI 10g on OC4J.  Data source : MS Excel (ODBC 3.5)
      Regards,
      Ru

    Hi,
    With reference to your question.
    Can any operator perform this task..I don't think any single operator will help you.
    I suggest using an intermediate (staging) table by using a PL SQL procedure with output port to store the values of account number provided the number of accounts are limited. Else use an array variable for account of an employee.
    In short no simple solution because of the bad source design else the pivot/unpivot operator would have helped you.
    Cheers
    - Mohammed

  • ALV Total and Subtotal in ALV

    Hi,
          I want to display the Total and Subtotal in Alv in Webdynpro Abap, and i am getting this  Error( Access via 'NULL' object reference not possible) and also i have checked the Cardinality also. Please get me a Good Solution.

    I think your node( the node which is binded to data node of alv interface controller ) having collection cardinality of 1:1, if yes, then change it to 0:N,
    i hope this will solve the issue.
    If you still get the error, go to st22, open your error, go down that page (keep pressing pagedown button ), then you will find your code and there find this arrow >>>>> then let me know that code line.
    Regards
    Srinivas

  • Multiple levels in a mobile game

    Hi
    Im a little confused on multiple levels in a j2me game with respects to re-initialising the level, once level 1 is complete.
    How, and what would be the best code practise, once level1=true(complete) to load level 2. Where do i actually send my code back too, to start the next level. Do i do some kind of garbage collection/reset, then simply load all the graphics in for level 2?.
    Also, some games feature levels like in an RPG, where each room is loaded when the character reaches the exit - how is this being called from the j2me code?
    Thanks
    Steve

    Would you be able to explain it to me?  Here is a picture of what i'm trying to do..
    When 'player_mc' touches' hitbox_mc', the movieclip 'bat_mc' plays once and erases itself.
    And for the level change its the same concept... Player touches box and gets sent to second frame on timeline which is t he next level...
    Been trying to figure this out all weekend and just turned to pros for help now..

  • ARRAY and records at multiple level ? please help

    Hi experts!!
    I am struck up with a problem. If u can please help me.
    I need a structure of this type.
    create type GRADE as object(
    grade varchar2(30)
    / -- works fine , creates
    create type GRADE_ARRAY as VARRAY(10) of GRADE;
    / -- works fine and creates
    create type SPECIES as object
    Species_number number,
    array_of_grade GRADE_ARRAY
    / works fine
    create type SPECIES_ARRAY as VARRAY(20) of SPECIES;
    -- error comes here.. Can not have multiple level..type error
    and so can not go ahead. In fect I wanted to use next level also. like this.
    The next command remains my dream only then because I could not create the SPECIES ARRAY it self..
    create type TIMBER as object
    timber_mark varchar2(6),
    no_species number,
    array_of_species(20) SPECIES_ARRAY
    the problem is for multiple level ARRAY AND RECORD/object combination..
    I tried with OBJECT AND VARRAY it does only for one level.. not even two level.
    my Mail ID:
    [email protected]
    Thanks and Regards..
    Virendra chauhan

    I think multi-level collections was first implemented in 9.2. You failed to mention what version of the DB you are using.

  • Multiple level bursting in OBIEE

    I am creating a report in OBIEE, which needs to be bursted.
    the bursting should be done at multiple levels
    For ex:
    take a sample report of employees table, dept table.
    I want to burst by dept-wise , Job-wise and manager-wise.
    i mean, 10 dept PDF , 7 position PDF and X manager PDF.
    Will i be able to do this by using bursting query ??

    I was at a conference and heard that someone actually uses OBIEE. Is that you? Or is it two people now?

  • Why doesn't the back button have a dropdown to jump back multiple levels in Firefox 4? Is there an option to re-enable that?

    Before I upgraded to Firefox 4, the back button (as it is in every other browser under the sun,) had a dropdown so you could skip one tier of going back and drop back multiple levels. This is especially important when there is a site redirecting you and you can't rewind past it with single Back clicks. However, FF4 doesn't have this -- at least not by default -- and I don't see it anywhere in the options to add it. Is it hiding somewhere I haven't found, or was that removed?

    You have to either click and hold the back button or right click to access the drop down selection.

  • Problem in Subtotal in ALV

    Hi Experts,
    I wanted to do the subtotal in ALV report. For subtotal which data type we need to take. Is it really affect with data type??
    My problem is: I wanted to do the subtotal based on Purchase order number. I need to do the subtotal of field LV_VAR based on purchase order number. The field LV_VAR having TYPE packed decimal.
    Do I need to change the data type of field LV_VAR for getting subtotal?
    For implementing the Subtotal functionality in my alv report, I did following changes
    1. Declared one sort catalog as
    gs_sort-fieldname = 'EBELN'.
    gs_sort-up  = 'X'.
    gs-sort-subtot = 'X'.
    append gs_sort to gt_sort.
    2. In fieldcatalog of field LV_VAR
    i_fieldcatalog-fieldname = 'LV_VAR'.
    i_fieldcatalog-tabname = 'ITAB'.
    i_fieldcatalog-do_sum = 'X'.
    append i_fieldcatalog.
    Then in FM REUSE_ALV_GRID_DISPLAY, I had passed sort catalog as
    it_sort = gt_sort[]
    But I did not get the subtotal functionality.
    Any suggestion pls?

    Hi ,
    I will give you one sample code which has a functionality of subtotal and grand total also .
    And this code will help you in many aspects also.
    *& Report  ZSAND_SUBTOTAL                                              *
    REPORT  ZSAND_SUBTOTAL LINE-COUNT 65                        .
    *& Report ZALV_LIST
    TABLES : mseg.
    TYPE-POOLS : slis.
    DATA : BEGIN OF itab OCCURS 0,
            mblnr LIKE mseg-mblnr,
            matnr LIKE mseg-matnr,
            werks LIKE mseg-werks,
            menge LIKE mseg-menge,
            line_color(4) TYPE c,
           END OF itab.
    DATA : BEGIN OF itab1 OCCURS 0,
            mblnr LIKE mseg-mblnr,
            matnr LIKE mseg-matnr,
            werks LIKE mseg-werks,
            menge LIKE mseg-menge,
            line_color(4) TYPE c,
            END OF itab1.
    data: it_sortcat   type slis_sortinfo_alv occurs 1,
           wa_sort like line of it_sortcat.
    DATA: it_header TYPE slis_t_listheader,
            wa_header TYPE slis_listheader.
    data: var1(1).
    DATA  var2.
    data:mytabix like sy-tabix.
    data:wtab1 like line of itab,
         wtab2 like line of itab.
    DATA : t_fcat TYPE slis_t_fieldcat_alv,
    t_eve TYPE slis_t_event,
    t_subtot TYPE slis_t_sortinfo_alv,
    subtot LIKE LINE OF t_subtot,
    wa_fcat LIKE LINE OF t_fcat,
    gd_layout TYPE slis_layout_alv.
    DATA : gt_menge LIKE mseg-menge,
    st_menge LIKE mseg-menge.
    data:it_extab type SLIS_t_EXTAB,
         wa_extab like line of it_extab.
    SELECTION-SCREEN : BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : doc FOR mseg-mblnr.
    SELECTION-SCREEN : END OF BLOCK blk1.
    START-OF-SELECTION.
    PERFORM build_cat USING t_fcat.
    PERFORM build_layout.
    PERFORM build_eve.
    perform fill_sort.
    PERFORM get_data.
    PERFORM display.
    *& Form build_cat
    *text
    *-->TEMP_FCAT text
    FORM build_cat USING temp_fcat TYPE slis_t_fieldcat_alv.
    wa_fcat-tabname = 'ITAB'.
    wa_fcat-fieldname = 'MBLNR'.
    wa_fcat-seltext_m = 'Material Doc.'.
    APPEND wa_fcat TO temp_fcat.
    CLEAR wa_fcat.
    wa_fcat-tabname = 'ITAB'.
    wa_fcat-fieldname = 'MATNR'.
    wa_fcat-seltext_m = 'Material'.
    APPEND wa_fcat TO temp_fcat.
    CLEAR wa_fcat.
    wa_fcat-tabname = 'ITAB'.
    wa_fcat-fieldname = 'WERKS'.
    wa_fcat-seltext_m = 'Plant'.
    APPEND wa_fcat TO temp_fcat.
    CLEAR wa_fcat.
    wa_fcat-tabname = 'ITAB'.
    wa_fcat-fieldname = 'MENGE'.
    wa_fcat-seltext_m = 'Quantity'.
    wa_fcat-do_sum = 'Y'.
    APPEND wa_fcat TO temp_fcat.
    CLEAR wa_fcat.
    ENDFORM. "build_cat
    *& Form build_eve
    *text
    FORM build_eve.
    DATA : wa_eve TYPE slis_alv_event.
    data:mytabix type sy-tabix.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    i_list_type = 0
    IMPORTING
    et_events = t_eve
    EXCEPTIONS
    list_type_wrong = 1
    OTHERS = 2.
    IF sy-subrc  <> 0.
    *MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE t_eve  into wa_eve WITH KEY name = slis_ev_top_of_page.
    *INTO wa_eve.
    IF sy-subrc = 0.
    mytabix = sy-tabix.
    MOVE 'TOP_OF_PAGE' TO wa_eve-form.
    append  wa_eve  to t_eve.
    *modify t_eve from wa_eve index mytabix transporting form.
    ENDIF.
    READ TABLE t_eve  into wa_eve WITH KEY name = slis_ev_end_of_page.
    *INTO wa_eve.
    IF sy-subrc = 0.
    mytabix = sy-tabix.
    MOVE 'END_OF_PAGE' TO wa_eve-form.
    append  wa_eve  to t_eve.
    *modify t_eve from wa_eve index mytabix transporting form.
    ENDIF.
    ENDFORM. "build_eve
    *& Form build_layout
    *text
    FORM build_layout.
    *gd_layout-no_input = 'X'.
    gd_layout-colwidth_optimize = 'X'.
    gd_layout-info_fieldname = 'LINE_COLOR'.
    gd_layout-subtotals_text = 'SUBTOTAL'.
    *gd_layout-totals_text = 'TOTAL'.
    gd_layout-EDIT = 'X'.
    ENDFORM. " BUILD_LAYOUT
    *& Form get_data
    *text
    FORM get_data.
    SELECT mblnr matnr werks menge FROM mseg INTO CORRESPONDING FIELDS OF
    TABLE itab
    WHERE mblnr IN doc.
    SORT itab BY mblnr.
    sort itab by mblnr matnr.
    read table itab into wtab1 index 1.
    mytabix = 1.
    loop at itab into wtab2 from 2.
    if wtab1-mblnr = wtab2-mblnr and wtab1-matnr = wtab2-matnr.
    wtab1-menge = wtab1-menge + wtab2-menge.
    modify itab from wtab1 index mytabix.
    else.
    modify itab from wtab1 index mytabix.
    clear wtab1.
    mytabix = sy-tabix.
    move wtab2 to wtab1.
    endif.
    clear wtab2.
    endloop.
    delete ADJACENT DUPLICATES  from itab comparing mblnr matnr.
    ENDFORM. "get_data
    *& Form display
    *text
    FORM display.
    wa_extab-fcode = '&ETA'.
    append wa_extab to it_extab.
      wa_header-typ  = 'H'.
       wa_header-info = 'SANDY is Great'.
       append wa_header to it_header.
       clear wa_header.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = 'ZSAND_SUBTOTAL'
      I_CALLBACK_PF_STATUS_SET          = ' '
       I_CALLBACK_USER_COMMAND           = 'USERCOMMAND'
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         = gd_layout
       IT_FIELDCAT                       = t_fcat
       IT_EXCLUDING                      = it_extab
      IT_SPECIAL_GROUPS                 =
       IT_SORT                           = it_sortcat
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
       IT_EVENTS                         = t_eve[]
      IT_EVENT_EXIT                     = 'BUILD_EVE'
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          = itab
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. "display
    ***& Form top_of_page
    *text
    FORM top_of_page.
    if var1 is initial.
      wa_header-typ  = 'H'.
       wa_header-info = 'SANDY is Great'.
       append wa_header to it_header.
       clear wa_header.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = it_header
        I_LOGO                   = 'HR_LOGO'
      I_END_OF_LIST_GRID       =
              var1 = 'X'.
    endif.
      ENDFORM. "top_of_page
      FORM end_of_page.
    if var2 is initial.
      wa_header-typ  = 'H'.
       wa_header-info = 'SANDY is Great'.
       append wa_header to it_header.
       clear wa_header.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = it_header
        I_LOGO                   = 'HR_LOGO'
      I_END_OF_LIST_GRID       =
              var2 = 'X'.
    endif.
      ENDFORM. "top_of_page
    *&      Form  fill_sort
          text
    -->  p1        text
    <--  p2        text
    form fill_sort .
    wa_sort-spos      = 1.
      wa_sort-fieldname = 'MBLNR'.
      wa_sort-SUBTOT    = 'X'. "subtotals any totals column by this field
    gd_sortcat-tabname
      APPEND wa_sort TO it_sortcat.
      wa_sort-spos      = 2.
      wa_sort-fieldname = 'MATNR'.
    gd_sortcat-tabname
      APPEND wa_sort TO it_sortcat.
    endform.                    " fill_sort
    FORM status USING rt_extab TYPE slis_t_extab.
    set pf-status  'ZSTANDARD'.
    endform.
    form USERCOMMAND USING R_UCOMM type sy-ucomm
                           rselfield type slis_selfield .
    set parameter id 'MAT'  field rselfield-value .
    call transaction 'MM03' and  skip first screen.
    endform.
    I hope this program will help you out.
    Help children of U.N World Food Program by rewarding  points and encourage others to answer your queries.

Maybe you are looking for

  • I can't get texting to work on new iPhone 5...any suggestions?

    I have been trying to transfer from my iPhone3GS to the new iPhone 5.  I am having trouble getting the message/texting feature to work.  Any suggestions would be appreciated!

  • IPod mini broken...how can I fix it?!?!

    Hi there, Can anyone give me some advice on how to solve my iPod mini problem (and yes, I have followed the support instructions to ABSOLUTELY NO AVAIL). My iPod mini always says I have no battery left, even when I have just charged it overnight. Now

  • Can the Zen Stone Plus coexist with iTun

    I am a runner and I am interested in the Zen Stone Plus. I use iTunes and various iPods. How would the Zen software coexist with iTunes. Most of the music in my library is from?my own CD's?and not from the iTunes Store. Thank you. Bob Michiel?

  • After Flash 11 install: Adobe Connect requires Flash Player 10.1 or above.

    Adobe Connect will not run on my XP Pro workstation. Flash (11.1.102.63) has been installed several times, with and without AVG. We get the Flash Successful Installation Screen, try to launch Connect again, and always bounce right into the same messa

  • Doubt regarding DynPage....can anyone help..

    hi all.. i ve a basic doubt as to why is there an innerclass(extending DynPage) being created when a new Dynpage  is created using SAP-IDE...