Dynamic ALV Grid Footer

Hi experts,
I have a ALV Grid display, for example I selected 2 rows out of 5 from the display ALV, then I have a footer which contains: number of line items selected : v_no_lines. The v_no_lines is the number of rows selected from the display ALV which is 2. The total number of line items selected should be displayed on the bottom section of the ALV Grid.

DATA:wf_data TYPE REF TO data,
     wf_str TYPE REF TO data.
DATA: wf_alv TYPE REF TO cl_salv_table.
FIELD-SYMBOLS:<fs_tab> TYPE STANDARD TABLE,
              <fs_line> TYPE ANY,
              <fs_f> TYPE ANY,
              <fs_t> TYPE ANY..
CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
  EXPORTING
    class              = 'ENG-DATA-METALS'
    classtext          = ' '
    classtype          = 'Z03'
    features           = 'X'
    language           = sy-langu
    object             = '338127-1'
    objecttable        = 'MARA' "tcla-obtab
    key_date           = sy-datum
    initial_charact    = ' '
    change_service_clf = ' '
    inherited_char     = ' '
    change_number      = ' '
  TABLES
    t_class            = i_sclass[]
    t_objectdata       = i_object[]
  EXCEPTIONS
    no_classification  = 1
    no_classtypes      = 2
    invalid_class_type = 3
    OTHERS             = 4.
CHECK sy-subrc = 0.
lines = LINES( i_object ).

Similar Messages

  • Create deep structure to disable some cells in Dynamic ALV GRID

    Hi,
    I want to disable some cells in a Dynamic ALV Grid before calling "SET_tABLE_Display" Method.
    I check the BCALV_EDIT_02, where some cells are grayed out by assign the  CL_GUI_ALV_GRID-MC_STYLE_DISABLED  to the field name.
    But I want the same using Field symbol.
    I'm creating Dynamic table and dynamic structure based on the Dynamic field catalog.
    Example: <FT_TAB> TYPE STANDARD TABLE,
                    <FS_TAB> TYPE ANY,            
    DATA: INT_TAB  is my dynamic table values.
    For the INT_TAB internal table, I created dynamic Structure and dynamic field symbol table.
    LOOP AT INT_TAB.
    ASSIGN COMPONENT 'MATNR'  OF STRUCTURE <FS_TAB> TO <F_VALUE>
    <F_VALUE> = INT_TAB-MATNR.
    APPEND <FS_TAB> TO <FT_TAB>
    "Here is the problem occurs, I want to grayed out the MATNR value based on some condition.
    ENDLOOP.
    I would like to set the 'MATNR' value to be grayed out by passing the CL_GUI_ALV_GRID-MC_STYLE_DISABLED.
    and update into <FT_TAB>(       <FT_TAB> structure will have 2 structures)
    Finally the fieldsymbol should have two structure ( <F_TAB> = DYNAMIC STRUCTURE + LVC_S_STYLE )
    Display alv grid by passing <FT_TAB> to set_table_display method.
    Thanks in advance,
    Kumar.

    Hi,
    I am  not sure whether I really understand your request. Let me try to help.
    > Example: <FT_TAB> TYPE STANDARD TABLE,
    >                 <FS_TAB> TYPE ANY,            
    >
    > DATA: INT_TAB  is my dynamic table values.
    >
    >
    > LOOP AT INT_TAB.
    >  ASSIGN COMPONENT 'MATNR'  OF STRUCTURE <FS_TAB> TO <F_VALUE>
    > <F_VALUE> = INT_TAB-MATNR.
    >  APPEND <FS_TAB> TO <FT_TAB>
    Here <FT_TAB> must already be assigned to some internal table with a given (dynamic) structure. Did this happen before this piece of code?
    What I would do is to create a dynamic table (see documentation to CREATE DATA) with MATNR and the STYLE field (LVC_T_STYL). See the documentation for CREATE DATA - creation of internal tables. When collection the field descriptions for that internal table I would also build the field catalogue for the ALV.
    Then assign <FT_TAB> to that newly created internal table, <FS_TAB> to a newly created structure (same as a table line).
    Move the MATNR to component 1 (or component 'MATNR') of the table and fill the style table according to your needs. Then insert the <FS_TAB> into <FT_TAB>.
    Finally call the ALV SET_TABLE... method with your dynamic table and your field catalogue.
    Regards,
    Gerd Rother

  • Dynamic ALV Grid is not displaying !!

    Hi all,
      I am trying to create dynamic alv grids and upto five levels(five grids) out put is displaying fine without any problem. But when I try to display the 6th grid, the program is going into infinite loop and getting timed out. Even I tried to increse the height of the grid even though it is not displaying.
    Please correct me if any thing is wrong in below code.
    *1st Level grid
    IF <table1> IS ASSIGNED AND <table1> IS NOT INITIAL.
       CREATE OBJECT ob_split1
           EXPORTING
             parent      = ob_custom
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
        PERFORM set_split_height USING ob_split1  '20'.
        CREATE OBJECT ob_grid1
          EXPORTING
            i_parent = ob_split1->top_left_container.
    ELSE.
        CREATE OBJECT ob_split1
           EXPORTING
             parent      = ob_custom
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
        PERFORM set_split_height USING ob_split1  '0'.
    ENDIF.
    *2nd Level grid
    IF <table2> IS ASSIGNED AND <table2> IS NOT INITIAL.
       CREATE OBJECT ob_split2
           EXPORTING
             parent      = ob_split1->bottom_right_container
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
          PERFORM set_split_height USING ob_split2   '20'.
        CREATE OBJECT ob_grid2
          EXPORTING
            i_parent = ob_split2->top_left_container.
      ELSE.
         CREATE OBJECT ob_split2
            EXPORTING
              parent      = ob_split1->bottom_right_container
              orientation = cl_gui_easy_splitter_container=>orientation_vertical.
         PERFORM set_split_height USING ob_split2    '0'.
      ENDIF.
    (Created 3rd,4th,5th same like above).
    *6th Level grid
    IF <table6> IS ASSIGNED AND <table6> IS NOT INITIAL.
    CREATE OBJECT ob_split6
           EXPORTING
             parent      = ob_split5->bottom_right_container
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
         PERFORM set_split_height USING ob_split6  '20'.
         CREATE OBJECT ob_grid6
           EXPORTING
             i_parent = ob_split6->top_left_container.
      ELSE.
         CREATE OBJECT ob_split6
           EXPORTING
             parent      = ob_split5->bottom_right_container
             orientation = cl_gui_easy_splitter_container=>orientation_vertical.
         PERFORM set_split_height USING ob_split6  '0'.
      ENDIF.
    Appreciated your reply. Please let me know for additional info.
    Thanks,
    Ranjith.
    Edited by: Thomas Zloch on Dec 8, 2010 5:44 PM - please use code tags

    Hi romanch,
    defining the field catalog you must reference all currency fields to the respective currency key field (type CUKY).
    <alv_fieldcat>-cfieldname         = 'HWAER'.
    This is sample for alv output of a currency field. The alv structure has a field HWAER which carries the currency key, e.g. USD or so.
    Obviously you do not provide a cutrrency key for your values. If they are initial (zero), ALV will not display them as 0,00 but leave the field empty if the reference too currency key is not established.
    If you define a DDIC structure for the ALV output this refernce is enforced. You can pass the DDIC structure name to the ALV and don not have to create the field catalog manually.
    Regards,
    Clemens

  • Two dynamic ALV grid

    Hi experts,
      I am having a dynamic ALV grid. How to create a new grid(second grid) in the same page with different values?
    Thanks&Regards,
    vino

    Add 2 view containers, create 2 different usages of AVL component and embed the view of these 2 alv components in 2 view containers..
    Hope this helps
    manas dua

  • Radio button in dynamic ALV grid

    Hi guys!
    I want to implement a dynamical ALV grid with a radiobutton in the first column.
    when clicking a button, or processing the program i want to get the information of the selected row and perform other things....
    Can someone help me with a code example for this, or just tell me where i can find the necessary information`?
    regards
    thomas

    Hi,
    I dont understand why you need Radio button, If you use REUSE_ALV_GRID_DISPLAY the output grid will by default allow you to select only one row.
    see the program - BCALV_FULLSCREEN_DEMO for more information

  • How to validate the columns in dynamic alv grid

    Hi Friends,
    I want to validatethe value of all the columens (min 1 and max 40) which i create dynamically in alv grid.
    value must be between 0 and 1 only.
    Please help ,, need urgently.

    method handle_data_changed.
         data: ls_good type lvc_s_modi,
               li_diff type i,
               value type p DECIMALS 3,
               old_value type p DECIMALS 3,
               lw_outtab1 type gt_tab.
    clear value.
           loop at er_data_changed->mt_good_cells into ls_good.
           value = ls_good-value.
           old_value = ls_good-value.
            if value lt 0 or value gt 1.
               MESSAGE 'Value is out of range' TYPE 'I'.
              Read table gt_outtab1 into lw_outtab1 index ls_good-row_id .
               perform show_alv.
               clear ls_good.
            ENDIF.
          ENDCASE.
           ENDLOOP.
    I again created the table.. actually data is not changed in the internal table but still it shows the changed value in the alv grid. even in build the table again and call the refersh alv grid method..

  • Dynamic ALV GRID screen in a class? Possible?

    I have created a class(I have done it locally as to be able to use it for mutiple clients) that I include in programs that I want to implement the alv grid for using the FM approach. Doing this allows me to easily implement the ALV quickly. However, I am wanting to use the OO ALV grid approach since there is more flexibility and control doing it this way. But I do not want to have to create a screen for every program that I want to do this for, I would like to just have a method in my existing class that would call a screen and then be able to control it like normal. I know that screens can not be called from a method so I was thinking of doing something similiar to another post using a FM to call the screen. I realize that this could be complicated because certain methods for the ALV GRID are called in the  PBO/PAI events. Any help or suggestions would be appreciated.
    Note: I am on 6.20 and have searched all over the web before posting.
    Thanks.

    Yes,  i have written a function module which calls a generice ALV grid in a dialog box.  Everything about the ALV grid is encapsulated in a function module.  In this case, all I need to do is send this function module a fieldcatalog and the data,  that's about it.  Doing this may limit the functionality of event handling  or you would just have to handle everything by doing more code for it..   This function module is very simple, not a whole lot to it.   You could do something like this only instead of using a model dialog box, you would throw a regular dynpro.
    function z_popup_with_alvgrid.
    *"*"Global interface:
    *"  IMPORTING
    *"     REFERENCE(ENDPOS_COL) TYPE  I DEFAULT 90
    *"     REFERENCE(ENDPOS_ROW) TYPE  I DEFAULT 22
    *"     REFERENCE(STARTPOS_COL) TYPE  I DEFAULT 10
    *"     REFERENCE(STARTPOS_ROW) TYPE  I DEFAULT 2
    *"     REFERENCE(TEXTLINE1) TYPE  C OPTIONAL
    *"     REFERENCE(TEXTLINE2) TYPE  C OPTIONAL
    *"     REFERENCE(TEXTLINE3) TYPE  C OPTIONAL
    *"     REFERENCE(TEXTLINE4) TYPE  C OPTIONAL
    *"     REFERENCE(TITLE) TYPE  C OPTIONAL
    *"     REFERENCE(FIELDCAT) TYPE  LVC_T_FCAT
    *"  TABLES
    *"      I_ALV
      call screen 0200 starting at startpos_col
                                   startpos_row
                         ending at endpos_col
                                   endpos_row.
    endfunction.
    *      Module  STATUS_0200  OUTPUT
    module status_0200 output.
      set pf-status '0200'.
      set titlebar  '0200' with title.
      data: alv_container  type ref to cl_gui_custom_container.
      data: alv_grid       type ref to cl_gui_alv_grid.
      data: xfieldcat type lvc_t_fcat.
      xfieldcat = fieldcat.
    * Create Controls
      create object:
         alv_container
                 exporting
                       container_name    = 'ALV_CONTAINER',
         alv_grid
                 exporting
                       i_parent          =  alv_container.
    *  Set grid for first display
      call method alv_grid->set_table_for_first_display(
          exporting
               i_structure_name       = 'I_ALV'
          changing
               it_outtab       = i_alv[]
               it_fieldcatalog = xfieldcat[] ).
    endmodule.
    *     Module  USER_COMMAND_0100  INPUT
    module user_command_0200 input.
      case sy-ucomm.
        when 'CONTINUE' or 'CANCEL'.
          set screen 0.
          leave screen.
      endcase.
    endmodule.
    Regards,
    Rich Heilman

  • User Command in Dynamic ALV Display

    Hi,
    I have an requirement where i'm displaying Dynamic ALV grid by calling the method by passing the field Symbol in  it_outtab parameter:
    CALL METHOD cl_gui_alv_grid->set_table_for_first_display
    For this i'm creating a custom container in my screen container
    CREATE OBJECT cl_gui_custom_container
            EXPORTING container_name = lv_container.
    Now in the output every record is having a checkbox in the end.Now if the user check this checkbox n clicks on push button(added in Application toolbar) then this record should be kept and rest all the records should be deleted.
    This can be done if an internal table is passed to the method as the field symbol doesnt hold any data after the output is displayed.
    Is there any solution where this can be made possible.
    Thanks in advance.
    Sheetal

    try this ..
    before displaying ALV , store all the data in the fieldsymbol into another internal table
    then display ALV with field symbol
    after u click the pushbutton , get the seleted rows into another table using get_selected rows,
    now again call CALL METHOD cl_gui_alv_grid->set_table_for_first_display
    and give the new selected rows of internal table and refresh the grid

  • Need to add Header  and footer in an alv grid display output.

    How can I add header and footer in an alv grid dispay output.
    For the grid display, I am using the function module "REUSE_ALV_GRID_DISPLAY".

    HI,
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'
                i_callback_html_end_of_list = 'END_OF_LIST_HTML'
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    FORM end_of_list_html USING end TYPE REF TO cl_dd_document.
      DATA: ls_text TYPE sdydo_text_element,
            l_grid     TYPE REF TO cl_gui_alv_grid,
            f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.
      ls_text = 'Footer title'.
    adds and icon (red triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'IL'.
    adds test (via variable)
      CALL METHOD end->add_text
        EXPORTING
          text         = ls_text
          sap_emphasis = 'strong'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Bold text'
          sap_emphasis = 'strong'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Nor'.
    adds new line (start new line)
      CALL METHOD end->new_line.
    display text(bold)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Yellow '
          sap_emphasis = 'str'.
    adds and icon (yellow triangle)
      CALL METHOD end->add_icon
        EXPORTING
          sap_icon = 'IC''.
    display text(normal)
      CALL METHOD end->add_text
        EXPORTING
          text         = 'Mor'.
    *set height of this section
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = l_grid.
      CALL METHOD l_grid->parent->parent->(f)
        EXPORTING
          id     = 3
          height = 14.
    ENDFORM. "end_of_list_html.
    This will solve  it. Post if you need more help in this.
    Regards,
    Madhu.

  • How to download only some fields(dynamically) from alv grid layouts

    I have ALV grid list.
    I have layouts for selecting sets of fields dynamically.
    If I select a particular layout, I want to download only those fields into an Excel sheet.
    If I select another layout, I want to download only fields of that layout , into an Excel sheet.
    Can u plz write examples.
    Narendra

    Hello ,
    Here it is.
      FIELD-SYMBOLS <FS> TYPE ANY.
      DATA: GR_ATTACHMENT TYPE Z48S3_ATTACHMENT,
            GT_ATTACHMENT TYPE Z48S3_ATTACHMENT_TAB,
            L_F_TITLE     TYPE SO_OBJ_DES,
            L_R_FIELDCAT  LIKE LINE OF GT_FIELDCAT,
            L_F_FIELD     LIKE L_R_FIELDCAT-FIELDNAME,
            L_F_EMAILID   TYPE Z48S3_RECEIVER,
            L_F_FIRST     TYPE C.
      IF SY-SYSID EQ G_C_DEV_SYSTEM OR
         SY-SYSID EQ G_C_QUA_SYSTEM.
        CONCATENATE SY-SYSID '/' SY-MANDT ':' INTO L_F_TITLE.
        CONDENSE L_F_TITLE.
        CONCATENATE L_F_TITLE SY-TITLE INTO L_F_TITLE SEPARATED BY SPACE.
      ELSE.
        L_F_TITLE = SY-TITLE.
      ENDIF.
      G_R_VARIANT-REPORT = SY-REPID.
      G_R_VARIANT-VARIANT = P_VARIAN.
      CALL FUNCTION 'REUSE_ALV_VARIANT_SELECT'
           EXPORTING
                I_DIALOG            = 'N'
                I_USER_SPECIFIC     = 'A'
                I_DEFAULT           = 'X'
                IT_DEFAULT_FIELDCAT = G_T_FIELDCAT
                I_LAYOUT            = GR_LAYOUT
           IMPORTING
                ET_FIELDCAT         = G_T_FIELDCAT
                ES_LAYOUT           = GR_LAYOUT
           CHANGING
                CS_VARIANT          = G_R_VARIANT
           EXCEPTIONS
                ERROR_MESSAGE       = 4
                OTHERS              = 4.
      SORT G_T_FIELDCAT BY COL_POS.
      PERFORM CREATE_EXCEL_ATTM_HEADING_ROW TABLES GT_ATTACHMENT
                                                   G_T_FIELDCAT.
      LOOP AT G_T_ALVLIST.
        L_F_FIRST = 'X'.
        LOOP AT G_T_FIELDCAT INTO L_R_FIELDCAT WHERE NO_OUT IS INITIAL.
          CLEAR GR_ATTACHMENT-XNEWLINE.
          IF NOT L_F_FIRST IS INITIAL.
            GR_ATTACHMENT-XNEWLINE = 'X'.
            CLEAR L_F_FIRST.
          ENDIF.
          CLEAR L_F_FIELD.
          CONCATENATE 'G_T_ALVLIST-' L_R_FIELDCAT-FIELDNAME
                 INTO L_F_FIELD.
          CONDENSE L_F_FIELD.
          ASSIGN (L_F_FIELD) TO <FS>.
          WRITE <FS> TO GR_ATTACHMENT-FIELDVALUE.
          UNASSIGN <FS>.
          APPEND GR_ATTACHMENT TO GT_ATTACHMENT.
        ENDLOOP.
      ENDLOOP.
    Regards,
    Vasanth

  • Dynamic creation of variables and alv grid output/internal table

    Dear Experts
    I am stuck in an inventory ageing report which is to be done year wise. the scenario is as follow.
    selection screen i enter the year 2011 or 2010 or 2009.
    the output should show me 2011-2007 or 2010-2007 or 2009-2007. the alv grid should always start from 2007 and end at the year that is entered in the selection screen.
    Now how can i create a dynamic variables to store the values of the corresponding yr and also how can i create a dynamic internal table to store these values.
    Thanks & Regards
    Zamir Parkar

    Hi Zamir,
    if you are new to ABAP you may leave old and buggy techniques behind.
    If you want to create the table dynamically, please do not use l_alv_table_create=>create_dynamic_table because it is limited and always triggers a possibly unwanted database commit.
    You better use RTTS dynamic runtime type services, i.e. check the example for [Creating Flat and Complex Internal Tables Dynamically using RTTI|http://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI].
    As done here, leave all outdated ALV technologies behind and start with CL_SALV_TABLE. It is following the object-oriented approach and does not need a field catalog.
    You will get used to field-symbols that can be compared to the data referenced by a pointer. For dynamic fields, you may build the field names dynamically, i.e.
    DATA:
          lo_structdescr         TYPE REF TO cl_abap_structdescr,
          lo_typedescr           TYPE REF TO cl_abap_typedescr,
          lo_tabledescr          TYPE REF TO cl_abap_tabledescr,
          lr_data                TYPE REF TO data,
          lt_comp_all            TYPE cl_abap_structdescr=>component_table,
          lv_index               TYPE numc2.
        FIELD-SYMBOLS:
          <any>                  TYPE ANY,
          <component>            TYPE LINE OF abap_component_tab,
           <table>                TYPE table.
        DO nnn TIMES.
          lv_index = sy-index.
          lo_typedescr   =  cl_abap_typedescr=>describe_by_name( <name of data element> ).
          APPEND INITIAL LINE TO lt_comp_all ASSIGNING <component>.
          <component>-type ?= lo_typedescr.
          CONCATENATE 'YEARVAL' lc_underscore lv_index INTO <component>-name.
          <component>-as_include  = abap_true.
          CONCATENATE lc_underscore lv_index INTO <component>-suffix.
        ENDDO.
    * create description object for structured type
        lo_structdescr = cl_abap_structdescr=>create( lt_comp_all ).
    *  create table description object for this
        lo_tabledescr = cl_abap_tabledescr=>create(
                        p_line_type  = lo_structdescr
                        p_table_kind = cl_abap_tabledescr=>tablekind_std
                        p_unique     = abap_false ).
    * create data object
        CREATE DATA lr_data TYPE HANDLE lo_tabledescr.
    ASSIGN lr_data->* to <table>.
    This is a fragment. Please adapt to your needs.
    Regards,
    Clemens

  • Change the total and subtotal dynamically in ALV GRID

    Hi guys,
               I need to change the total and subtotal of field "AMOUNT" dynamically.I am using ALV GRID CONTROL(oops concept).I need to override the standard functionality.I need to show my own subtotal and total line instead of standard one .

    Hi
    I've understood it, I wanted to use OO Grid too, but I had to use the ALV list in order to write my total.
    If you need to use OO grid u can try to exclude all funcitonalities for the total, subtotal and sorting and insert in the output table the lines with your totals.
    Max

  • Alv grid display with dynamic colums

    Hi,
    i have an alv grid program in which i have to display the 22 fields as rows and i want to freeze them.i also want to display data for the 22 fields for a variable date range i.e. if you consider i have colums A to Z then i have have this sort of display:
    Sel screen:
    year(select-options):
    alv output:
                   Year1 Year2 ...........................Year N
    A
    B
    C
    D
    E
    F
    Z
    Please help me.
    i tried using fieldcatalog-row_pos = my row numbers i.e. 1,2....22.
    Thanks,
    Anand.

    Hi Anand,
    U need to create a dynamic field catalog as well as internal table to handle the year select option and to display the grid.
    See the below code creating dynamic field catalogue and internal table.   The same requirement like urs.
        LOOP AT i_month.
          CASE i_month-date+4(2).
            WHEN '01'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual JAN-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With JAN-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '02'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual FEB-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With FEB-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '03'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual MAR-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With MAR-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '04'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual APR-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With APR-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '05'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual MAY-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With MAY-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '06'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual JUN-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With JUN-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '07'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual JUL-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With JUL-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '08'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual AUG-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With AUG-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '09'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual SEP-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With SEP-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '10'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual OCT-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With OCT-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '11'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual NOV-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With NOV-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '12'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual DEC-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With DEC-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
          ENDCASE.
          MODIFY i_month.
          IF i_month-tag = 'A'.
    Field for reference month surcharge
           CONCATENATE i_month-tag i_month-date(6) INTO
    fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = 18.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
          ELSE.
    Fields for Compared month surcharge
           CONCATENATE i_month-tag i_month-date(6) INTO
    fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = 18.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
    Field for indicator
            CONCATENATE 'I' i_month-date(6) INTO fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = 1.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
    Field for difference surcharge
            CONCATENATE 'D' i_month-date(6) INTO fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = '18'.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
          ENDIF.                           " IF i_month-tag = 'A'.
        ENDLOOP.                           " LOOP AT i_month.
      ENDIF.                               " IF NOT i_month[] IS INITIAL.
    Method to create dynamic table.
      IF NOT i_fldcat[] IS INITIAL.
        CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog           = i_fldcat[]
          IMPORTING
            ep_table                  = i_table
          EXCEPTIONS
            generate_subpool_dir_full = 1
            OTHERS                    = 2
        IF sy-subrc <> 0.
        ENDIF.                             " IF sy-subrc <> 0.
        ASSIGN i_table->* TO <i_output>.
        CREATE DATA fs_line LIKE LINE OF <i_output>.
        ASSIGN fs_line->* TO <fs_output>.
      ENDIF.                               " IF NOT i_fldcat[] IS INITIAL.

  • How to get a Footer text in alv grid?

    Hi,
    am using RESUE_ALV_COMMENTARy_write... it is getting only on top of page..
    suggest me to get Footer text in ALV GRiD.
    Regards,
    sodanapalli
    Moderator message: please do more research before asking, all points removed (both replies were copy/pasted anyway)
    Edited by: Thomas Zloch on May 19, 2011 5:41 PM

    Step1: Populate the ALV event table with 'END_OF_LIST' event
    Step2: Populate the footer text in to an internal table which is of type
    slis_t_listheader.
    Step3: Create a subroutine with name 'END_OF_LIST' and with in this form we have to call the function module u2018REUSE_ALV_COMMENTARY_WRITEu2019.
    Step4: Now call the function module REUSE_ALV_GRID_DISPLAYu2019 to display the ALV report. Whenever u2018END_OF_LIST' event is get fired it executes the subroutine END_OF_LIST and displays the text into the footer of the ALV GRID.
    Code:
    *& Report Z_TEST_ALV
    REPORT z_test_alv.
    TYPE-POOLS: slis.
    DATA: i_mara TYPE STANDARD TABLE OF mara INITIAL SIZE 0,
                i_events TYPE slis_t_event,
                i_end_of_page TYPE slis_t_listheader,
                w_events TYPE slis_alv_event,
                v_repid LIKE sy-repid.
    START-OF-SELECTION.
    SELECT * FROM
    mara INTO TABLE i_mara
    UP TO 100 ROWS.
    CHECK sy-subrc = 0.
    PERFORM populate_alv_event.
    PERFORM comment_build USING i_end_of_page[].
    PERFORM display_grid.
    *& Form POPULATE_ALV_EVENT
    FORM populate_alv_event .
    Populate event table
    w_events-name = 'END_OF_LIST'.
    w_events-form = 'END_OF_LIST'.
    APPEND w_events TO i_events.
    ENDFORM. " POPULATE_ALV_EVENT
    *& Form COMMENT_BUILD
    FORM comment_build USING p_i_end_of_page TYPE slis_t_listheader.
    DATA: ls_line TYPE slis_listheader.
    REFRESH p_i_end_of_page.
    CLEAR ls_line.
    ls_line-typ = 'H'.
    ls_line-info = 'This is end of list'(001).
    APPEND ls_line TO p_i_end_of_page.
    ENDFORM. " COMMENT_BUILD
    *& Form end_of_list
    FORM end_of_list.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = i_end_of_page.
    ENDFORM. "end_of_list
    *& Form DISPLAY_GRID
    FORM display_grid .
    v_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = v_repid
    i_structure_name = 'MARA'
    it_events = i_events
    TABLES
    it_outtab = i_mara
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    ENDIF.
    ENDFORM. " DISPLAY_GRID
    Check the output  where footer will be displayed as 'THIS IS END OF LIST'

  • Dsiplay Dynamic Column in ALV Grid

    Hellow everyone,
    i am using alv grid to display the stock in detail , I need date and stock qnty with labour hour dynamic , my requriend output is:
                                LVside                                 HV side                      Coreside
    StockNumber             Qnty        Date                         Qnty    Date              Qnty      Date
    10000014               14.1          10/11/2011                12.2  11/11/2011
    Plz tell me how can iget this , The LVside and HVside is constant and Qnty date label also constant only date and Qnty will change.
    Thanks

    Hi venkatesh   even my requirment is same,
    yes you are correct venkatesh actually i have static column but as you see i am getting the data as per follow
    in LVside total Qnty is 14.2 on Date 10.11.2011 of stockNum 100008 , so my requried out put is something like below
    StockNum                        LVside .... ..........................HVside
                              Qnty   | Date                              Qnty   | Date
    1000008                   14.2    10.11.2011                          5.2    11.11.2011
    My current Out put is :
    StockNum                10.11.2011 .................11.11.2011
    1000008                   14.2                            5.2   
    my refer code is :
    DATA: BEGIN OF i_alv OCCURS 0,
          ARBID TYPE AFRU-ARBID,
          BUDAT TYPE AFRU-BUDAT,
          WERKS TYPE AFRU-WERKS,
          LMNGA TYPE AFRU-LMNGA,
          AUFNR TYPE AFRU-AUFNR,
          KDAUF TYPE AUFK-KDAUF,
          KDPOS TYPE AUFK-KDPOS,
          VBELN TYPE VBAK-VBELN,
          KUNNR TYPE VBAK-KUNNR,
          NAME1 TYPE KNA1-NAME1,
          MATNR TYPE VBAP-MATNR,
          KDKG1 TYPE VBKD-KDKG1,
      end of i_alv.
    TYPES: BEGIN OF ty_data,
             BUDAT TYPE AFRU-BUDAT,
             ARBID TYPE AFRU-ARBID,
             aufnr TYPE AFRU-AUFNR,
             kdauf TYPE AUFK-KDAUF,
             name1 TYPE KNA1-NAME1,
             matnr TYPE VBAP-MATNR,
             kdkg1 TYPE VBKD-KDKG1,
            lmnga TYPE AFRU-LMNGA,
           END OF ty_data,
           tt_data TYPE STANDARD TABLE OF ty_data,
           BEGIN OF ty_dyn1,                                    "#EC NEEDED
    *         ARBID TYPE AFRU-ARBID,
    *         aufnr TYPE AFRU-AUFNR,
             kdauf TYPE AUFK-KDAUF,
             name1 TYPE KNA1-NAME1,
             matnr TYPE VBAP-MATNR,
             kdkg1 TYPE VBKD-KDKG1,
             kdkg2 TYPE VBKD-KDKG2,
             lmnga TYPE AFRU-LMNGA,
           END OF ty_dyn1,
           BEGIN OF ty_dyn2,                                    "#EC NEEDED
             date  TYPE AFRU-LMNGA,
           END OF ty_dyn2,
           BEGIN OF ty_cols,
             date TYPE BUDAT,
           END OF ty_cols,
           tt_cols TYPE SORTED TABLE OF ty_cols WITH UNIQUE KEY date.
    DATA: gt_data TYPE tt_data,
          gt_data2 type tt_data,
          gt_cols TYPE tt_cols,
          gs_col  TYPE ty_cols.
    thanks

Maybe you are looking for

  • Whenever I try to open the iTunes store, it won't load.

    Whenever I try to open the iTunes store, the page will load about halfway and then a blank white screen will appear. I don't receive an error message or anything. The only thing that I can view is my iTunes account settings. I have tried uninstalling

  • PS CC 2014, how do I enable nvidia GeForce 765M GPU on Alienware 17 after latest upgrade?

    Have tried DDU in Safe Mode, for both Nvidia (with reinstall), and Intel 4600 removal.  Am using the Dell nvidia version, since latest upgrade direct from nvidia will not install. Getting GPU acceleration seems to be a problem with every upgrade!

  • ODI Question(s)

    I have some ODI questions Can i install ODI without having Fusion installed? Wouldn't ODI without Fusion be merely an ETL tool? (assuming that you can install without Fusion) Can i use ODI in an pub/sub architectural model for event driven data chang

  • Turn USB Drive into External Hard Drive

    I have an aging iBook G3 with a 20 GB HDD. I'm running low on space and was wondering if I could turn an usb drive into an external hard drive (I plan to install applications to it). I have several 32 GB sticks that I bought for other uses but it wou

  • Override doDML for custom type

    Hi, I'm overriding the doDML method of my entity class. Instead of inserting directly into a certain table I redirect the insert handling to a special PL/SQL package method. This works fine, until I want to use a custom as one of the columns of the t