How to dynamically sum rows?

Hi Gurus,
I am facing a problem in my report. The requirement is that I have to sum every 8th row in the report starting from 1st row upto the end of the report.
For eg. I have to sum 1st,9th, 17th row and so on. The total should come after the end of the report.
I am using local members to show "TOTAL" at the end of the report.
The problem that I am facing is that the number of rows are according to the number of members of the PROFITCTR dimension of the row axis.
If we select 1 member of the dimension, then only 1st row sum should show in the bottom. If there are 2 members, then sum of 1st and 9th row should show in 17th row and so on. If I write a simple sum formula adding the cells till the maximum possible members of the dimension, then the sum is coming fine of all members are selected but it comes to 0 if any lesser members are there. I hope I am clear with the requirement.
Kindly help out.

Hi Vaibhav,
I managed to create the required report using 14 local members and complex SUMIF's with INDIRECT(ADDRESS(...))
In general in local member formula you can use EPMPOSITION(1) to get the first data row number and you can generate the range from the first data row till the current row of local member - ROW().
Result:
Some local members:
To calculate Variance for each title:
Variance # =EPMMEMBER([PLANTYPE].[].[ACTUAL])-EPMMEMBER([PLANTYPE].[].[BUDGET])
Variance % =(EPMMEMBER([PLANTYPE].[].[ACTUAL])-EPMMEMBER([PLANTYPE].[].[BUDGET]))/EPMMEMBER([PLANTYPE].[].[BUDGET])
To create the column with combined INACCT and PLANTYPE:
INACCTandPLANTYPE =EPMMemberProperty(, EPMMemberID(EPMDIM_CURRENT_MEMBER(INACCT)), "ID")&EPMMemberProperty(, EPMMemberID(EPMDIM_CURRENT_MEMBER(PLANTYPE)), "ID")
To calculate Total:
Total 202020202 ACTUAL =SUMIF(INDIRECT(ADDRESS(ROW(EPMPOSITION(1)),4)&":"&ADDRESS(ROW()-1,4)),"202020202ACTUAL",INDIRECT(ADDRESS(ROW(EPMPOSITION(1)),COLUMN())&":"&ADDRESS(ROW()-1,COLUMN())))
Total 202020202 BUDGET =SUMIF(INDIRECT(ADDRESS(ROW(EPMPOSITION(1)),4)&":"&ADDRESS(ROW()-1,4)),"202020202BUDGET",INDIRECT(ADDRESS(ROW(EPMPOSITION(1)),COLUMN())&":"&ADDRESS(ROW()-1,COLUMN())))
Total 202020201 ACTUAL =SUMIF(INDIRECT(ADDRESS(ROW(EPMPOSITION(1)),4)&":"&ADDRESS(ROW()-1,4)),"202020201ACTUAL",INDIRECT(ADDRESS(ROW(EPMPOSITION(1)),COLUMN())&":"&ADDRESS(ROW()-1,COLUMN())))
Total 202020201 BUDGET =SUMIF(INDIRECT(ADDRESS(ROW(EPMPOSITION(1)),4)&":"&ADDRESS(ROW()-1,4)),"202020201BUDGET",INDIRECT(ADDRESS(ROW(EPMPOSITION(1)),COLUMN())&":"&ADDRESS(ROW()-1,COLUMN())))
To calculate total variances:
Total 202020202 Variance # =INDIRECT(ADDRESS(ROW()-2,COLUMN()))-INDIRECT(ADDRESS(ROW()-1,COLUMN()))
Total 202020202 Variance % =INDIRECT(ADDRESS(ROW()-1,COLUMN()))/INDIRECT(ADDRESS(ROW()-2,COLUMN()))
Total 202020201 Variance # =INDIRECT(ADDRESS(ROW()-2,COLUMN()))-INDIRECT(ADDRESS(ROW()-1,COLUMN()))
Total 202020201 Variance % =INDIRECT(ADDRESS(ROW()-1,COLUMN()))/INDIRECT(ADDRESS(ROW()-2,COLUMN()))
And to present row headers:
TITLES =IF(C6="Total 202020202 ACTUAL","Total",IF(A6=A5,"",A6))
INACCT =IF(C6="Total 202020202 ACTUAL","202020202",IF(C6="Total 202020201 ACTUAL","202020201",IF(B6=B5,"",B6)))
PLANTYPE =IF(LEFT(C6,5)="Total",MID(C6,SEARCH(" ",C6,7),255),C6)
In the final report columns A,B,C,D will be hidden.
B.R. Vadim

Similar Messages

  • How to identify the last instance of a dynamic table row

    Hi all,
    I am trying to figure out how to create an action for my form in Livecycle Designer ES2 that will affect the most recent instance of a dynamic table row. I have a table with a repeatable row where the user will enter information about a purchased part and I have buttons that allow the user to add and remove rows. I need to create an additional add row button that will add a new instance of the repeatable table row (this is not an issue) and will disable and change the background color of the first cell in the added row. The problem I am having is how to have an action that affects the last instance of a row.
    If anyone knows how to do this in Javascript I would appreciate some advice/help.

    Hi,
    I think this is beyond what an action will provide. You will a have to write some JavaScript directly.  When you call the addInstance method it returns the new row, so you can do something like;
    var row = Table1._Row1.addInstance();
    row.TextField1.border.fill.color.value = "255,0,0";
    row.TextField1.access = "protected";
    To find the last row and do the same thing you can do something like;
    var row = Table1.resolveNode("Row1[" + (Table1._Row1.count - 1) + "]");
    row.TextField1.border.fill.color.value = "255,0,0";
    row.TextField1.access = "protected";
    Regards
    Bruce

  • BEX formula.. How to know the row value in formulas dynamically

    Hi all,
    I just need to clarify a doubt..
    Requirement:
    COL1      -               COL2
    Y1            -               X
    Y2            -               X + 12
    Y3            -               X + 12 + 12
    YN           -               X + 12 + 12 + u2026 12(n)
    Y is dynamic from the source datau2026.. Itu2019s the year (2009,2008u2026 etc..)
    X value is from the user (i/p variable value). Some dummy valueu2026
    Now, the main logic I want to incorporate is like using a formula for COL2
    COL2 Formula looks like thisu2026.          X + (12 * N)             where N= 0 for the 1st row; 1 for the 2nd row; 2 for the 3rd row like thatu2026..
    How to dynamically allocate value for N based on the row count?
    Pls. let me know if you find somethingu2026.
    Thanks.
    Edited by: Arun Bala G on May 21, 2010 10:59 AM

    how abt this:
    This approach only valid for Workbboks..
    create COLUMN3 just type like this
    0
    12
    24
    and drag this upto end of Col1 and Col2 so it will poulate multiples of 12 then in Column 4 apply the C1-C2+C3..
    hope it helps
    Sorry Bhaskar,
    Hardcoding the formula is not relevant at all. May be you had not read this query properly. Its no way related to being dynamic right... If it was Excel workbook, anyone would have used a simple formula & moved values like cakewalk.
    So unfortunate! BEx has some limitations..
    All I need in my query is some counter like 1,2,3.... till the end of the last record. That's all.
    Pl. find the sample data
    COL1     COL2          
    2009     1.3          
    2008     13.3          Which is 1.3+12
    2007     25.3          Which is 1.3+12+12
    2006     37.3          Which is 1.3+12+12+12
    Do let me know if you have any clues?
    Thanks!
    Edited by: Arun Bala G on May 21, 2010 11:20 AM

  • How to fetch indivdual rows from a dynamic query.

    Hi,
    I wish to fetch the individual rows returned from a dynamic query.
    if my dynamic query is:
    dyn_stmt := select col1, col2, col3
    from tab1;
    The query returns multiple rows.
    Then how to fetch individual rows of this query ?
    Please explain.

    declare
      cur_test sys_refcursor;
      c1 varchar2(30);
      c2 number;
      c3 date;
    begin
      dyn_stmt := select col1, col2, col3 from tab1;
      OPEN cur_test FOR dyn_stmt;
      LOOP
        FETCH cur_test INTO c1, c2, c3;
        IF cur_test%NOTFOUND THEN
          EXIT;
        END IF;
        -- Process this row
      END LOOP;
      CLOSE cur_test;
    END;

  • Design problem with dynamically added row in datatable

    Hello all,
    I have a dataTable and have developped a method that dynamically adds rows to the dataTable. Each row is made up of two form controls. The problem I have now is that I don't know how to retrieve the values from the mutiple rows. Ideally I would need the values to be stored into a list.
    Can anyone help?
    Thanks in advance,
    Julien.
    Here is my code:
    <h:dataTable var="line" binding="#{TradeClientsAndQuantitiesBean.clientsAndQuantities}"  value="#{TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers}">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="S�lectionnez un client"/>
                    </f:facet>
                    <h:selectOneMenu value="#{TradeClientsAndQuantitiesHelperBean.selectedClientTemp}">
                        <f:selectItems value="#{TradeClientsAndQuantitiesHelperBean.concatenatedLabelMap}"/>
                    </h:selectOneMenu>
                </h:column>   
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Renseignez une quantit�"/>
                    </f:facet>
                    <h:inputText value=""/>
                </h:column>   
            </h:dataTable>

    The values will just be put in the same row object you added to TradeClientsAndQuantitiesBean.listOfMiddleFormHelpers.
    It might be worth to read this article: http://balusc.xs4all.nl/srv/dev-jep-dat.html

  • Omit the final SUM row in a report using breaks

    We have a report using breaking whereby it is broken for current day, week to date and month to date. We want to use the column SUM feature so that we have a count of all records for the day, week to date and month to date.
    This works fine, however we also get a final sum row on the bottom of the report which is a sum of the month, week and day count. This is meaningless as the month includes the week which in turn includes the day - all it gives is a useless large number! :)
    Is there a way to stop this final column being displayed?
    Thanks in advance

    I have managed to remove the last row in a table using the following code:
    <script type="text/javascript">
    $(document).ready(function() {
       $("#JK_TEST .t7standard tr:last").remove();
    </script>However, the report uses a bottom border implemented using a <TR> so I actually need to remove the second to last row. I have tried to work out how to do this but am still trying!!! Any suggestions?
    EDIT::
    DONE IT!!! :D:D :D
    Cheers for the help!
    <script type="text/javascript">
    $(document).ready(function() {
       $("#JK_TEST .t7standard tr:last").prev($('<TR>')).remove();
    </script>Cheers!
    Edited by: /dev/null on Mar 24, 2009 4:49 PM

  • Reading the Data from dynamically added rows of a table...

    Hi,
                  I am using adobe interactive form (WD ABAP) in which i am adding the table rows dynamically (using Jscript code).  I have to fech these data into an internal table. But I can read only the first row data..
                  Also While adding rows dynamically the same data is repeating for the consecutive rows..
                  I have found many similar posts in sdn, but i cannot get the solution. They have mentioned about adding in WDDOINIT method. Can anyone explain me what should be done,..?
    1) How to solve repeatative data while adding rows..?
    2) How to read dynamically added row data during runtime into internal table..?
    Thanks,
    Surya.

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Dynamically deleting row in struts

    Hi All,
    Can any one suggest me how to delete a row by highlighting it. I am using struts frame work and my home page consists of a table with the data populated from the database, my requirement here is to give an option to the user to delete a row by highlight it. I do not have any idea of doing this. Do we have any specific functionality in struts to do this??
    Please help me out.
    Thanks.

    Hi ,
    Sorry if the previous link was of no use to you. May be this will help you to add/ remove table rows from html using js.
    http://www.mredkj.com/tutorials/tableaddrow.html
    and add/remove html elements using js
    http://www.dustindiaz.com/add-and-remove-html-elements-dynamically-with-javascript/
    Not sure , how to highlight a row and delete it , but you can have onClick,onKeyDown,ondblclick ..... events on TR which may be used to trigger the deletion.

  • How to dynamically set column name in Answers

    Hi.
    How to dynamically set column name in Answers, for example I want to put presentation variable in column header. Is this possible?
    Regards,
    Goran Ocko
    http://108obiee.blogspot.com/

    May be a rude way .. but it works.
    Add narrative view and use Java script to change the column headings based on the variables.
    <script language="javascript" type="text/javascript">
    var a = document.getElementById('idResultsTableParent');
    var rows= a.getElementsByTagName('tr');
    rows[1].cells[1].innerText ="@{Presentation Variable}";
    </script>
    Editing the same post to remove irrelevant information.
    - Girish

  • How can I sum up raws? the sum function seems to work for columns only and right now I have to create a separate formula for each raw

    How can I sum up raws? the Sum function seems to work only on columns. Right now I have to create a separate formula for each raw

    Hi dah,
    "Thanks, but can I do one formula for all present and future raws? as raws are being added, I have to do the sum function again and again"
    You do need a separate formula for each group of values to be summed.
    If the values are in columns, you need a copy of the formula for each column.
    If the values are in rows, you need a copy of the formula for for each row.
    If you set up your formulas as SGIII did in his example (shown below), where every non-header row has the same formula, Numbers will automtically add the formula to new rows as you add them.
    "Same formula" in this context means exactly the same as all the formulas above, with one exception: the row reference in each formula is incremented (by Numbers) to match the row containing the formula.
    Here the formula looks like this in the three rows shown.
    B2: =SUM(2)
    B3: =SUM(3)
    B4: =SUM(4)
    That pattern will continue as rows are added to the table.
    Also, because the row token (2) references all of the non-header cells in row 2, the formula will automatically include new columns as they are added to the table.
    Regards,
    Barry

  • Different units in total sum row

    Hello Bex Experts,
    I have orders with different Units in a report. currently the total sum row show * for Mix
    How can I get the total sum for ST and KG like
    Total Sum 366 KG
    Total Sum 342 ST
    BR Matthias

    Hi Matthias,
    If you want to sum their numbers regardless of the UNITS, just use the NODIM() in formula..But if you need to add them and have 1 unit for the result, you must convert one of the them to another unit..
    Regards,
    Loed

  • How can i sum the columns by condition?

    ID    Type    QTY
    1      A         20
    2      A         20
    3      B         20
    I want to some QTY group by A but I also need the ID column to identify the order of  row.
    How can I sum QTY group by A and the result is sort by ID ?
    Thanks you 

    Whats your expected output?
    Is this the below?
    Create Table test(id int,[Type] char(1), QTY int)
    Insert into test Values(1,'A',20),
    (2,'A',20),
    (3,'B',20)
    SElect *,SUM(qty)Over(partition by Type) From test Order by id
    Drop table test

  • How to dynamic field insert into intenal table?

    hi friends
    this is my urgent requirements .... how to dynamic field insert into internal table if it possible please tell me
    thanks & regards
    pauldharma

    Hi,
    Go through this
    REPORT  yusmm_text1  NO STANDARD PAGE HEADING
                         LINE-SIZE 199.
    T A B L E S
    TABLES: MARA,
            MAKT,
            THEAD.
    GLOBAL TYPE-POOLS
    TYPE-POOLS : SLIS.
       GLOBAL TYPES
    TYPES : BEGIN OF TP_FINAL,
           MATNR TYPE MARA-MATNR,
           BEGRU TYPE MARA-BEGRU,
           MTART TYPE MARA-MTART,
           MAKTX TYPE MAKT-MAKTX,
           SPRAS TYPE MAKT-SPRAS,
           LTXT(2000)  TYPE C ,
           SRNO TYPE N ,
          END OF TP_FINAL.
    TYPES : BEGIN OF TP_T002,
            SPRAS TYPE T002-SPRAS,
            LAISO TYPE T002-LAISO,
            SRNO TYPE N ,
            END OF TP_T002.
    TYPES : BEGIN OF TP_MARA_MAKT,
            MATNR TYPE MARA-MATNR,
            BEGRU TYPE MARA-BEGRU,
            MTART TYPE MARA-MTART,
            SPRAS TYPE MAKT-SPRAS,
            MAKTX TYPE MAKT-MAKTX,
           END OF TP_MARA_MAKT.
    Types: BEGIN OF tp_matnr,
           matnr TYPE mara-matnr,
           END OF tp_matnr.
       GLOBAL ELEMENTARY VARIABLES
    DATA : gv_date TYPE sy-datum.
    DATA : gv_repid TYPE sy-repid.
    DATA : g_var1(10) TYPE C.
    DATA : gv_index TYPE sy-tabix.
    DATA: gv_strg TYPE string,
          gv_strg1(2000) TYPE C.
    DATA : gv_lang TYPE sy-langu.
    DATA : g_v(3) TYPE N .
    DATA : gv_lines(3) TYPE N .
    DATA : gv_var(3) TYPE N .
    DATA : gv_var1(3) TYPE N.
    DATA: gv_str TYPE STRING.
    DATA: gv_str1 TYPE STRING.
    DATA : gv_li TYPE I,
           gv_lit TYPE I,
           gv_lin TYPE I.
    DATA: g_var11(3) TYPE N,
          gv_li1(3) TYPE N,
          g_var2(3) TYPE N.
    DATA : gv_i1 TYPE I.
    DATA : gv_i TYPE I.
    DATA: gl_lenght TYPE I.
       GLOBAL STRUCTURES
    DATA:   T_NEWTABLE TYPE REF TO DATA,
            T_NEWLINE  TYPE REF TO DATA,
            T_FLDCAT1   TYPE SLIS_T_FIELDCAT_ALV,
            T_FLDCAT   TYPE LVC_T_FCAT,
            WA_IT_FLDCAT TYPE LVC_S_FCAT,
            WA_IT_FLDCAT1 TYPE SLIS_FIELDCAT_ALV,
            WA_COLNO(2) TYPE N,
            WA_FLNAME(5) TYPE C,
            L_LT TYPE SLIS_LAYOUT_ALV.
       GLOBAL INTERNAL TABLES (WITH INCLUDE STRUCTURE)
    DATA : IG_MARA_MAKT TYPE STANDARD TABLE OF TP_MARA_MAKT,
           WG_MARA_MAKT TYPE TP_MARA_MAKT.
    DATA : IG_T002 TYPE STANDARD TABLE OF TP_T002,
           WG_T002 TYPE TP_T002.
    DATA : IG_FINAL TYPE STANDARD TABLE OF TP_FINAL,
           WG_FINAL TYPE TP_FINAL.
    data : IG_MATNR TYPE STANDARD TABLE OF TP_MATNR WITH HEADER  LINE,
           WG_MATNR TYPE TP_MATNR.
    DATA:BEGIN OF IG_THEAD OCCURS 0.
            INCLUDE STRUCTURE THEAD .
    DATA: END OF IG_THEAD.
    DATA:BEGIN OF IG_TLINE OCCURS 0.
            INCLUDE STRUCTURE TLINE  .
    DATA:END OF IG_TLINE.
    FIELD-SYMBOLS
    FIELD-SYMBOLS: <T_DYNTABLE> TYPE STANDARD TABLE,"Dynamic internal
                                                            "tablename
                   <FS_DYNTABLE>,  "Field symbol to create work area
                  <FS_FLDVAL> TYPE ANY.   " Field symbol to assign values
    COMPULSORY
    FIELD-SYMBOLS: <FS_DATA> TYPE REF TO DATA,
                   <FS_DATA1> TYPE REF TO DATA,
                   <FS_2>    TYPE STANDARD TABLE,
                   <FS_22>   TYPE STANDARD TABLE,
                   <FS_1>,
                   <FS_11>,
                   <F>,
                   <FA>,
                   <LWA_LINE_WA>,
                   <LWA_LINE_WA1>.
    ------- Create Dyn Table From FC
    DATA: LT_DATA        TYPE   REF TO DATA,
          LT_DATA1        TYPE   REF TO DATA,
          LWA_LINE       TYPE   REF TO  DATA,
          LWA_LINE1       TYPE   REF TO  DATA,
          LI_FIELD_CAT   TYPE   LVC_T_FCAT,
          LWA_FIELD_CAT  TYPE   LVC_S_FCAT.
       PARAMETERS & SELECT-OPTIONS
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_SPRAS FOR MAKT-SPRAS NO INTERVALS  DEFAULT 'EN'
                                                            OBLIGATORY ,
                     S_MATNR FOR MARA-MATNR,
                     S_MTART FOR MARA-MTART.
    PARAMETERS: GP_SIZE TYPE I DEFAULT '200'.
    SELECTION-SCREEN : END OF BLOCK B1.
       INITIALIZATION
    INITIALIZATION.
      gv_repid = sy-repid.
      gv_date = sy-datum.
    AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
      IF GP_SIZE < 0.
       MESSAGE E002(00).
      ENDIF.
      IF GP_SIZE > 50000.
       MESSAGE W130(26) WITH TEXT-004.
        SET CURSOR FIELD 'gp_size'.
      ENDIF.
    START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM FIELDCAT.
      PERFORM LAYOUT.
      PERFORM DATA_FETCH.
      PERFORM READ_DATA_TO_FINAL.
      SORT ig_final BY matnr spras.
      gv_lin = gv_li.
      gv_li = gv_li - 2.
      LOOP AT ig_final INTO wg_final.
        ASSIGN COMPONENT 1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
        <FA> = 'Material Number'.
        ASSIGN COMPONENT 2 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
        <FA> = 'Authorization Group'.
        g_VAR11 = wg_final-srno + 2.
        gv_li1 = gv_li1 + 2.
        MOVE : g_var11 TO gv_i1.
        ASSIGN COMPONENT g_var11 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
        <FA> = 'MatDesc'.
        g_var2 = g_var11 + gv_lines.
        ASSIGN COMPONENT g_var2 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
        <FA> = 'BasicData'.
        APPEND <LWA_LINE_WA1> TO <FS_22>.
        EXIT.
       ENDLOOP.
      LOOP AT ig_final INTO wg_final.
        AT NEW matnr.
          gv_index = sy-tabix.
          ASSIGN COMPONENT 1 OF STRUCTURE <LWA_LINE_WA> TO <F>.
          <F> = wg_final-matnr.
          ENDAT.
        AT NEW MATNR.
        GV_INDEX = SY-TABIX.
        ASSIGN COMPONENT 1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
        <FA> = wg_final-matnr.
         ENDAT.
        ASSIGN COMPONENT 2 OF STRUCTURE <LWA_LINE_WA> TO <F>.
        <F> = wg_final-begru.
        ASSIGN COMPONENT 2 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
        <FA> = wg_final-begru.
        gv_var = wg_final-srno + 2.
        gv_li = gv_li + 2.
        MOVE : gv_var TO gv_i.
        ASSIGN COMPONENT gv_var OF STRUCTURE <LWA_LINE_WA> TO <F>.
        <F> = wg_final-maktx.
        ASSIGN COMPONENT gv_var OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
        <FA> = wg_final-maktx.
        gv_var1 = gv_var + gv_lines  .
        ASSIGN COMPONENT gv_var1 OF STRUCTURE <LWA_LINE_WA> TO <F>.
       <F> = wg_final-ltxt.
        ASSIGN COMPONENT gv_var1 OF STRUCTURE <LWA_LINE_WA1> TO <FA>.
        <FA> = wg_final-ltxt.
        AT END OF matnr.
          APPEND <LWA_LINE_WA> TO <FS_2>.
          CLEAR <LWA_LINE_WA>.
        ENDAT.
        AT END OF matnr.
         APPEND <LWA_LINE_WA1> TO <FS_22>.
         CLEAR <LWA_LINE_WA1>.
        ENDAT.
      ENDLOOP.
      PERFORM display..
    *&      Form  data_fetch
          text
    -->  p1        text
    <--  p2        text
    FORM DATA_FETCH .
      SELECT matnr
              from mara up to gp_size rows
             appending corresponding fields of table ig_matnr
             where matnr in s_matnr
             and mtart in s_mtart.
    loop at ig_matnr.
      SELECT  MARA~MATNR
              MARA~BEGRU
              MARA~MTART
              MAKT~SPRAS
              MAKT~MAKTX FROM MARA INNER JOIN MAKT
        ON MARAMATNR = MAKTMATNR
       appending corresponding fields of TABLE ig_mara_makt  UP TO GP_SIZE
    ROWS
        WHERE makt~spras IN s_spras
        AND   mara~matnr IN s_matnr
        AND   mara~mtart IN s_mtart
        AND   mara~matnr EQ ig_matnr-matnr.
        endloop.
      IF sy-subrc = 0.
        SORT ig_mara_makt.
      ENDIF.
    ENDFORM.                    " data_fetch
    *&      Form  read_data_to_final
          text
    -->  p1        text
    <--  p2        text
    FORM READ_DATA_TO_FINAL .
      LOOP AT ig_mara_makt INTO wg_mara_makt .
        wg_final-MATNR = wg_mara_makt-MATNR.
        wg_final-BEGRU = wg_mara_makt-BEGRU.
        wg_final-MTART = wg_mara_makt-MTART.
        wg_final-SPRAS = wg_mara_makt-SPRAS.
        wg_final-MAKTX = wg_mara_makt-MAKTX.
        READ TABLE ig_t002 INTO wg_t002 WITH KEY spras = wg_final-spras.
        IF sy-subrc = 0.
          wg_final-srno = wg_t002-srno.
        ENDIF.
        CLEAR ig_thead[].
        ig_thead-TDOBJECT = 'MATERIAL'.
        ig_thead-TDNAME   = wg_final-matnr.
        ig_thead-TDID     = 'GRUN'.
        ig_thead-TDSPRAS  = wg_final-spras.
        CALL FUNCTION 'TEXT_READ'
          EXPORTING
            I_HEADER   = IG_THEAD
            I_READONLY = 'X'
          IMPORTING
            E_HEADER   = IG_THEAD
          TABLES
            T_LINES    = IG_TLINE[]
          EXCEPTIONS
            NOTFOUND   = 1.
        IF sy-subrc  EQ 0.
          LOOP AT  ig_tline.
            gv_strg = ig_tline-tdline.
            IF gv_strg1 <> ' '.
              CONCATENATE gv_strg1 ';' gv_strg INTO gv_strg1.
            ELSE.
              gv_strg1 = gv_strg.
            ENDIF.
          ENDLOOP.
          wg_final-ltxt = gv_strg1.
          APPEND wg_final TO ig_final.
          CLEAR wg_final.
          gv_strg1 = ' '.
        ELSE.
          APPEND wg_final TO  ig_final.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " read_data_to_final
    " read_data_to_final
    *&      Form  layout
          text
    -->  p1        text
    <--  p2        text
    FORM LAYOUT .
      CLEAR L_LT.
      L_LT-ZEBRA = 'X'.
      L_LT-COLWIDTH_OPTIMIZE = 'X'.
      L_LT-WINDOW_TITLEBAR = 'MATERIAL DETAILS'.
    ENDFORM.                    " layout
    *&      Form  fieldcat
          text
    -->  p1        text
    <--  p2        text
    FORM FIELDCAT .
      SELECT SPRAS
               LAISO FROM t002 INTO  CORRESPONDING FIELDS OF TABLE ig_t002
          WHERE spras IN s_spras.
      DESCRIBE TABLE ig_t002 LINES gv_lines.
      LOOP AT ig_t002 INTO wg_t002.
        g_v = g_v + 1.
        Wg_t002-srno = g_v.
        MODIFY ig_t002 FROM wg_t002 TRANSPORTING SRNO.
      ENDLOOP.
      LOOP AT ig_t002 INTO wg_t002.
        CLEAR WA_IT_FLDCAT.
        MOVE SY-INDEX TO WA_COLNO.
        CONCATENATE 'MD-' wg_t002-LAISO
                          WA_COLNO
                         INTO WA_FLNAME.
        WA_IT_FLDCAT-FIELDNAME = WA_FLNAME.
        WA_IT_FLDCAT-DATATYPE = 'CHAR'.
        WA_IT_FLDCAT-SELTEXT = WA_FLNAME.
        WA_IT_FLDCAT-INTLEN = 250.
        WA_IT_FLDCAT-TABNAME = '<FS_2>'.
        APPEND WA_IT_FLDCAT TO T_FLDCAT.
        CLEAR wg_t002.
        ENDLOOP.
      LOOP AT ig_t002 INTO wg_t002.
        CLEAR WA_IT_FLDCAT.
        MOVE SY-INDEX TO WA_COLNO.
        CONCATENATE 'BD-' wg_t002-LAISO
                           WA_COLNO
                        INTO WA_FLNAME.
        WA_IT_FLDCAT-FIELDNAME = WA_FLNAME.
        WA_IT_FLDCAT-DATATYPE = 'CHAR'.
        WA_IT_FLDCAT-SELTEXT = WA_FLNAME.
        WA_IT_FLDCAT-INTLEN = 250.
        WA_IT_FLDCAT-TABNAME = '<FS_2>'.
        APPEND WA_IT_FLDCAT TO T_FLDCAT.
        CLEAR wg_t002.
        ENDLOOP.
      MOVE 'MATNR' TO WA_FLNAME.
      WA_IT_FLDCAT-FIELDNAME = WA_FLNAME.
      WA_IT_FLDCAT-DATATYPE = 'CHAR'.
      WA_IT_FLDCAT-SELTEXT = 'Material No'.
      WA_IT_FLDCAT-INTLEN = 18.
      WA_IT_FLDCAT-TABNAME = '<FS_2>'.
      INSERT WA_IT_FLDCAT INTO T_FLDCAT INDEX 1.
      MOVE 'BEGRU' TO WA_FLNAME.
      WA_IT_FLDCAT-FIELDNAME = WA_FLNAME.
      WA_IT_FLDCAT-DATATYPE = 'CHAR'.
      WA_IT_FLDCAT-SELTEXT = 'Authorization Group'.
      WA_IT_FLDCAT-INTLEN = 4.
      WA_IT_FLDCAT-TABNAME = '<FS_2>'.
      INSERT WA_IT_FLDCAT INTO T_FLDCAT INDEX 2.
      DESCRIBE TABLE T_FLDCAT LINES gv_li.
      ASSIGN LT_DATA TO <FS_DATA>.
    Creating the Dynamic Internal Table
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG           = T_FLDCAT         " Fieldcatalogue
        IMPORTING
          EP_TABLE                  = <FS_DATA>   " Dynamic Internal Table
        EXCEPTIONS
          GENERATE_SUBPOOL_DIR_FULL = 1
          OTHERS                    = 2.
    Assign Dyn Table To Field Sumbol
      ASSIGN <FS_DATA>->* TO <FS_1>.
    Assigning the Internal Table TYPE ANY to Standard internal Table
      ASSIGN <FS_1> TO <FS_2>.
    Creating a Workarea
      CREATE DATA LWA_LINE LIKE LINE OF <FS_2> .
    Assigning the Content to the workares as a Pointer
      ASSIGN LWA_LINE->* TO <LWA_LINE_WA>.
      LOOP AT T_FLDCAT INTO WA_IT_FLDCAT.
        WA_IT_FLDCAT1-FIELDNAME = WA_IT_FLDCAT-FIELDNAME.
        WA_IT_FLDCAT1-TABNAME =  WA_IT_FLDCAT-TABNAME.
        WA_IT_FLDCAT1-SELTEXT_L = WA_IT_FLDCAT-SELTEXT.
       WA_IT_FLDCAT1-REF_TABNAME = 'MARC'.
        APPEND WA_IT_FLDCAT1 TO T_FLDCAT1.
        CLEAR : WA_IT_FLDCAT,WA_IT_FLDCAT1.
      ENDLOOP.
      ASSIGN LT_DATA1 TO <FS_DATA1>.
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG           = T_FLDCAT         " Fieldcatalogue
        IMPORTING
          EP_TABLE                  = <FS_DATA1>  " Dynamic Internal table
        EXCEPTIONS
          GENERATE_SUBPOOL_DIR_FULL = 1
          OTHERS                    = 2.
    Assign Dyn Table To Field Sumbol
      ASSIGN <FS_DATA1>->* TO <FS_11>.
    Assigning the Internal Table TYPE ANY to Standard internal Table
      ASSIGN <FS_11> TO <FS_22>.
    Creating a Workarea
      CREATE DATA LWA_LINE1 LIKE LINE OF <FS_22> .
    Assigning the Content to the workares as a Pointer
      ASSIGN LWA_LINE1->* TO <LWA_LINE_WA1>.
    ENDFORM.                    " fieldcat
    *&      Form  show
          text
    -->  p1        text
    <--  p2        text
    FORM Display .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
       I_INTERFACE_CHECK                 = ' '
       I_BYPASSING_BUFFER                = ' '
       I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = GV_REPID
        I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS_SET'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
       I_CALLBACK_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                         = L_LT
         IT_FIELDCAT                       = T_FLDCAT1[]
       IT_EXCLUDING                      =
       IT_SPECIAL_GROUPS                 =
       IT_SORT                           =
       IT_FILTER                         =
       IS_SEL_HIDE                       =
       I_DEFAULT                         = 'X'
       I_SAVE                            = ' '
       IS_VARIANT                        =
       IT_EVENTS                         =
       IT_EVENT_EXIT                     =
       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
       I_HTML_HEIGHT_TOP                 = 0
       I_HTML_HEIGHT_END                 = 0
       IT_ALV_GRAPHICS                   =
       IT_HYPERLINK                      =
       IT_ADD_FIELDCAT                   =
       IT_EXCEPT_QINFO                   =
       IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
       E_EXIT_CAUSED_BY_CALLER           =
       ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = <FS_2>
    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 PF_STATUS_SET USING RS_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'DISPLAY' .
    ENDFORM. "PF_STATUS_SET
    *& Form Name: user_command *
    *& Form Desc: For Handling USER_COMMAND *
    FORM USER_COMMAND USING IF_UCOMM TYPE SY-UCOMM
                         IS_SELFIELD TYPE SLIS_SELFIELD.
      CASE IF_UCOMM.
        WHEN 'DOWNLOAD'.
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
      TITLEBAR                    = ' '
      DIAGNOSE_OBJECT             = ' '
              TEXT_QUESTION               = 'Data download to excel'
      TEXT_BUTTON_1               = 'Ja'(001)
      ICON_BUTTON_1               = ' '
      TEXT_BUTTON_2               = 'Nein'(002)
      ICON_BUTTON_2               = ' '
      DEFAULT_BUTTON              = '1'
      DISPLAY_CANCEL_BUTTON       = 'X'
      USERDEFINED_F1_HELP         = ' '
      START_COLUMN                = 25
      START_ROW                   = 6
      POPUP_TYPE                  =
    IMPORTING
      ANSWER                      =
    TABLES
      PARAMETER                   =
    EXCEPTIONS
      TEXT_NOT_FOUND              = 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.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
        BIN_FILESIZE                  =
              FILENAME                     = 'C:\Material-Text.xls'
             FILETYPE                      = 'ASC'
        APPEND                        = ' '
         WRITE_FIELD_SEPARATOR         = 'X'
        HEADER                        = '00'
         TRUNC_TRAILING_BLANKS         = 'X'
        WRITE_LF                      = 'X'
        COL_SELECT                    = ' '
        COL_SELECT_MASK               = ' '
         DAT_MODE                      = 'X'
       IMPORTING
         FILELENGTH                    = GL_LENGHT
            TABLES
              DATA_TAB                      = <FS_22>
      EXCEPTIONS
        FILE_WRITE_ERROR              = 1
        NO_BATCH                      = 2
        GUI_REFUSE_FILETRANSFER       = 3
        INVALID_TYPE                  = 4
        NO_AUTHORITY                  = 5
        UNKNOWN_ERROR                 = 6
        HEADER_NOT_ALLOWED            = 7
        SEPARATOR_NOT_ALLOWED         = 8
        FILESIZE_NOT_ALLOWED          = 9
        HEADER_TOO_LONG               = 10
        DP_ERROR_CREATE               = 11
        DP_ERROR_SEND                 = 12
        DP_ERROR_WRITE                = 13
        UNKNOWN_DP_ERROR              = 14
        ACCESS_DENIED                 = 15
        DP_OUT_OF_MEMORY              = 16
        DISK_FULL                     = 17
        DP_TIMEOUT                    = 18
        FILE_NOT_FOUND                = 19
        DATAPROVIDER_EXCEPTION        = 20
        CONTROL_FLUSH_ERROR           = 21
        OTHERS                        = 22
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          IF GL_LENGHT NE 0.
            MESSAGE S398(00) WITH 'DATA downloaded to EXCEL'.
          ENDIF.
    Thanks
      ENDCASE.
    ENDFORM.                    "user_command

  • Dynamic add row/columns to data forms(11.1.1.3) v/s (11.1.2.1)

    Hello All,,
    There used to be an option in Hyperion planning 11.1.1.3 to Dynamic add rows in data form. I don't see this option in planning 11.1.2.1 ?
    Could you please suggest how we can grant right users to add dynamic add rows and columns in data forms? or it is possible in 11.1.2.1 ?
    out user want to have a feature of adding row in data forms (planning forms)
    Thank you
    Edited by: 842804 on Aug 17, 2011 12:49 PM

    Do you mean 11.1.2, if so then adhoc web forms really take over from adding rows as they add much more functionality.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to access specific row of a database table.

    hi all,
    i am saving all the hr tables in a internal table.
    say, mtable = 'pa0002'  is the content of mtable on looping above internal table.
    LOOP AT i_itf_list INTO wa_list.  "wa_list contains list of hr tables.
       mtable = wa_list-tabname.
       LOOP AT persno.  "persno contains list of personal numbers.
    "how to acess particular row of (mtable)  dynamically where pernr = persno-pernr."
       ENDLOOP.
    ENDLOOP.
    thanks.

    Hi,
    Use below code for your reference.
    data : ref_table_des type ref to cl_abap_structdescr,
              dref type ref to data.
    field-symbols : <itab> type standard table,
                            <wtab> type any.
    data : mtable type tabname.
    LOOP AT i_itf_list INTO wa_list. "wa_list contains list of hr tables.
    clear mtable.
    mtable = wa_list-tabname.
    LOOP AT persno. "persno contains list of personal numbers.
    ref_table_des ?= cl_abap_typedescr=>describe_by_name( mtable ).
    create data dref type handle ref_table_des.
    assign dref->* to <wtab>.
    create data dref like standard table of <wtab>.
    assign dref->* to <itab>.
    ***if you want to select multople rows use below select***********
    select * from (mtable)
    into table <itab>
    where pernr = persno-pernr.
    ********if you want to select single row use below select************
    select single * from (mtable)
    into <wtab>
    where pernr = persno-pernr.
    ENDLOOP.
    ENDLOOP.
    Vijay

Maybe you are looking for

  • UCM 11g File missing from search result although file is accessable

    When I do search without any criteria in UCM 11g, some files missing from search result although I know the files were checked into UCM already since I'm able to see these files using url similar to: http://ucm/cs/idcplg?idcService=GET_FILE&dID=12345

  • Sound in only one ear?

    I mainly use my logitech headsets (G35 & G930 Both 7.1 Gaming headsets) to listen to audio from my computer. Any audio coming from firefox such as a youtube video for example, The sound only outputs into one ear, My right ear more specifically. It's

  • After effects cc and cinema4d lite

    Hi, after installing after effects cc on MacPro i tried to open cinema4d lite for test. By doubleclick on the App Icon nothing happens. Are there any additional operations to make it run? Thanks for help Jörg

  • [SOLVED]Modem-manager won't start with Network manager

    Hi, I have a problem with getting modem-manager work under gnome. After first Arch install to this laptop, Network manager didn't show my 3G-modem, so I installed modem-manager and usb_modeswitch. Modem is Huawei E367 and it works well with wvdial. O

  • Script for password

    Hello I need help in writing a script that scans the /etc/shadow file for user passwords that expire within 5 days and forces the users to change their password as soon as they login. The /etc/shadow file has entries like this: UserX:<password>:12669