Hide alv grid PR custom subscreen

Hello All,
I have a custom subscreen on PR ( bulit via screen exit) with ALV grid and some screen elements ( to get input data from user) on it.
In create and change PR mode, I need to get the input ( could be multiple rows with the help of create next icon )from user and update ALV grid with the input values. But in PR display mode, I need to hide the ALV grid.
I tried using desctructor method FREE, but dint work.
Any suggestions?
Thanks,
Chandra

I have a similiar problem:
I have a dynpro where there are different possibilities for ALV grids to be shown. I have 10 containers (that's the maximum number of ALV grids that can appear) and want to use the highest first. Now, it might be that I want to show another ALV in a container I have had an ALV before, therefore I must hide / delete / destroy the previous ALV in this container.
I use the FREE( ) method of the alv controls, I clear and free all references, but still, even after leaving and accessing the dynpro again, the ALV is shown. That's why I'd need some help here too...
Thanks in advance, Christopher

Similar Messages

  • ALV grid in a Subscreen

    Hi,
    I have a problem with the display of a ALV grid in a subscreen. I am going to try to explain my problem and maybe somebody knows any solution.
    In a regular screen I have a subscreen that should show the ALV, I am following all the steps like callling the subscreen, creating the container for the ALV grid, ... but it doesn' show anything.
    I have tried some things to check if the calling of the subscreen works, so I just call any other subscreen and it works. Also I have tried to call two alv in the same screen using the custom control and it works.
    I have changed the subscreen into screen and I have added the status and so on and by itself it also works.
    Does anybody know what can be missing??
    Thanks very much

    Hmm, works fine for me. Below code a litte bit tweaked but working one. Try it:
    "ABAP program
    DATA: g_custom_container TYPE REF TO cl_gui_custom_container,
          g_alv_grid_ref TYPE REF TO cl_gui_alv_grid,
          gt_sflight TYPE sflight OCCURS 0.
    SELECT * FROM sflight INTO TABLE gt_sflight UP TO 10 ROWS.
    CALL SCREEN 0100.
    MODULE pbo_0200 OUTPUT.
      IF g_custom_container IS INITIAL.
        "create custom container
        CREATE OBJECT g_custom_container
           EXPORTING
             container_name              = 'CUSTOM_AREA'.
        CREATE OBJECT g_alv_grid_ref
            EXPORTING
               i_parent          =  g_custom_container.
        CALL METHOD g_alv_grid_ref->set_table_for_first_display
          EXPORTING
            i_structure_name = 'SFLIGHT'
          CHANGING
            it_outtab        = gt_sflight.
      ELSE.
        CALL METHOD g_alv_grid_ref->refresh_table_display.
      ENDIF.
    ENDMODULE.                                                  "PBO_0200
    "Main screen 0100 - type normal
    "here on layout ensure subsreen area called SUB_AREA is placed
    PROCESS BEFORE OUTPUT.
      CALL SUBSCREEN sub_area INCLUDING sy-repid '0200'.
    PROCESS AFTER INPUT.
      CALL SUBSCREEN sub_area.
    "Subscreen - type subscreen (please check that in attributes)
    "here custom control named CUSTOM_AREA was placed in layout
    PROCESS BEFORE OUTPUT.
       MODULE pbo_0200.
    Hope this helps
    Marcin

  • Alv grid display in subscreen

    Hi ,
           How can I display ALV grid display in subscreen area that is called in main screen .?
    Thanx in advance  .

    Hi Pallavi,
    Use these parameters in Alv Fm
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
    Hope this will help you.
    Regards,
    Vijay

  • ALV grid on TABSTRIP- Subscreen

    Hi,
    How to display ALV grid screen on Tabstrip- Subscreen.
    Please send sample code.
    Thanks in advance.
    -Mohan

    Its not going to be different that what you do on a normal screen. I am assuming that you are using OO ALV control.
    Here you do this on the sub screen instead of the main screen. Take a look at my weblog.
    /people/ravikumar.allampallam/blog/2005/06/01/alv-reporting-using-controls--part-i
    regards,
    Ravi
    Note :Please close the thread if this resolves the issue

  • Placing ALV grid on subscreen-URGENT

    Hi,
    I have a selection screen in my report program. I have placed a custom container in the selection screen in which I have placed an ALV grid.
    Now my requirement is to place this ALV grid on a subscreen and define this subscreen in my selection screen.
    I have included the following code in my report and also created a new subscreen 0100.
    SELECTION-SCREEN: BEGIN OF TABBED BLOCK sub FOR 197 LINES,
                      END OF BLOCK sub.
    INITIALIZATION.
    sub-prog = sy-repid.
    sub-dynnr = 100.
    Please let me know how do I place the ALV grid on the subscreen.
    Thanks & Regards,
    Srilakshmi B

    Hi,
    1.goto se51.give the module pool name and scrren no.
      2.Select the custom container and give name only.
    3.use that name in the report.
    Regards,
    Shiva.

  • How to make the first row  selected before the display of ALV grid

    Hello Experts,
    I created a ALV grid using custom container in a screen . Now i want do the follwing:
    1. i want that, the  <b>first line must be selected before the display of ALV.</b>
    2. I have selection buttons . But i dont want the multiselect button and the  
        standard  toolbar in the ALV grid.
    Could any one please help me regarding the above?
    Thanks & Regards
    Sudhansu

    can u pls explain in more details with an example?
    I am telling u the scenario.
    1. i have a screen(Modal dialog Box)  containing ALV grid with selection buttons for each row  (top part) and a subscreen(second part).
          Now when i click on a selection button, it will display the corresponding values in the subscreen.
        When this screen will display for the first time , then first row of the ALV grid should be selected and the corresponding values should be displayed in  the subscreen.
    i   wrote the following code in the PAI. But when i select a record its not triggering the PAI.
    DATA:
         gi_index_rows TYPE lvc_t_row, " Internal table for indexes of selected rows
         g_selected_row LIKE lvc_s_row, " Information about 1 row
         l_lines TYPE i.
      CLEAR g_wa_vdmeko.
    *get selected row
      CALL METHOD g_alv_grid->get_selected_rows
        IMPORTING
          et_index_rows = gi_index_rows.
      DESCRIBE TABLE gi_index_rows LINES l_lines.
      LOOP AT gi_index_rows INTO g_selected_row.
        READ TABLE g_int_vdmeko INDEX g_selected_row-index INTO g_wa_vdmeko.
        SELECT SINGLE  *
               FROM vdmepov
               WHERE bukrs = g_wa_vdmeko-bukrs AND
                     styp  = g_wa_vdmeko-styp  AND
                     sbez  = g_wa_vdmeko-sbez  AND
                     svym  = g_wa_vdmeko-svym  AND
                     svnr  = g_wa_vdmeko-svnr.
      ENDLOOP.
    I am displayinng the ALV using method "set_alv_for_first_display".
    Please help if u have any idea..................
    Thanks
    Sudhansu

  • Would like to make the entire ALV Grid invisible.

    Hello everyone,
    I have a screen with 2 alv grids on a custom control.
    Now when required I would like to hide one or both the alv grid. How can I do this?
    Custom controls cannot be made invisible. Is there a method in alv which would make  the entire alv grid disappear?
    Thanks in advance,
    Karan

    > Now when required I would like to hide one or both the alv grid. How can I do this?
    > Custom controls cannot be made invisible. Is there a method in alv which would make  the entire alv
    > grid disappear?
    Custom Control we cannot see directly on the screen output. If one of the Grid you want to make invisible
    then you can follw some thing similar approach ..
    in PBO you will intialize the controls. while initalizing it you pass the wrong Custom control name then it will not display the ALV GRID.
    Custom control name  is name of the Custom control of screen what ever you want to show.

  • Search Helps in ALV grids.

    Hi,
    I am working on ALV grids in custom control.
    My requirement is to provide search helps in the ALV grid for few fields out of which the search help for one field should be populated dynamically.
    Please help me.

    hi
    good
    You can have almost everything you like in a search help. Nice search help examples are:
    MPLAL (exit = F4_MATCHCODE_USER_EXIT) -> calls a selection report (transaction IP03)
    HRBAS00OBJID (exit = RHF4_EXIT_OBJID) and include search helps
    thanks
    mrutyun^

  • Refresh alv grid after user clicks f4( value-request)

    Hello Experts,
    I am currently developing a module pool program wherein after the user selects a value via f4(value request),
    my ALV grid(using custom control) should be refreshed to show the new records selected based
    on the f4 value. How can this be achieved?
    thank you guys and take care!

    Did you try a CALL METHOD [cl_gui_cfw=>set_new_ok_code|http://help.sap.com/saphelp_sm32/helpdata/en/06/3fa1b79f2811d2bd68080009b4534c/frameset.htm] and [=>flush|http://help.sap.com/saphelp_sm32/helpdata/EN/06/3fa1879f2811d2bd68080009b4534c/content.htm] in the POV section or in event onF4 handler method to force execution of PAI (either it works either it dumps)
    Regards,
    Raymond

  • Adding custom fields to notifications-approval tab alv grid

    Transaction IW21 - Create PM Notifications.
    on the Approval Tab - there is an ALV grid that contains lots of fields. I know that i can click on the upper right hand corner and modifiy the layout by hidding fields. I want to add some custom fields to this grid.
    I added my fields to view QMSM and now when I look at the database table using SE16 - i can see my new fields.
    But how do I add them to this ALV grid?
    Please and Thank you,
    Julia Ramos
    Orange County Public Schools.

    I have read SAP OSS NOTE:  586523 Customer-defined fields in list editing. This note helped me add these same fields to many of the standard reporting transactions. IQS8, IW28, IW29, IW38, IW39
    I added my fields to
    QMEL - Quality Notification
    RIHQMEL_LIST - Display structure reporting for QMEL
    RQMQMEL - Quality notification - header data
    RQMQMSM - Quality notification - measures (reporting)
    Then i ran SAP program BALVBUFDEL. This program refreshs the alv buffer. This was very cool in that it allows us to access and report on all of my custom fields thru the standard reporting transactions!
    I thought this same logic might work for transaction IW21. I found the structure used by the approval tab alv program, QMSM,  and created an append structure, ZAQMSM with my fields - ran the balvbufdel program to refresh the alv buffers - but i still can not see my fields in the approval tab. I believe that there must be a way to do this - i will keep trying different things and read thru move OSS notes. If you have any sugestions or ideas - they would be greatly appreciated.
    Thanks

  • Deactivate buttons in ALV GRID being called in subscreen

    Hi,
    In a screen, when a specific tab is selected (tab strip), the subscreen area is filled with ALV GRID. I need to deactivate few buttons on the ALV GRID. How can that be done??
    Advance Thanks

    Hi Aadarsh,
    Check out the following program.
    Global data definitions for ALV
    To allow the declaration of gr_event_handler before the
    lcl_event_receiver class is defined, decale it as deferred in the
    start of the program
    CLASS lcl_event_handler DEFINITION DEFERRED.
    Object reference
    ALV Grid instance reference
    DATA: gr_alvgrid    TYPE REF TO cl_gui_alv_grid,
    Custom container instance reference
          gr_ccontainer TYPE REF TO cl_gui_custom_container,
    Event class reference
          gr_event_handler TYPE REF TO lcl_event_handler.       "IC210507+
    Internal Table
    Field catalog table
    DATA: gt_fieldcat TYPE lvc_t_fcat,
    Internal table holding list data
          gt_list     TYPE STANDARD TABLE OF sflight,
    Table to be filled up for excluding some of the standard function
    buttons
          gt_exclude  TYPE ui_functions.                        "IC210507+
    Work area
    Layout structure
    DATA: gs_layout   TYPE lvc_s_layo,
    Field catalog structure
          gs_fcat     TYPE lvc_s_fcat,
    Exclude button structure
          gs_exclude  TYPE ui_func,                             "IC210507+
    Structure to add button in the ALV toolbar
          gs_toolbar  TYPE stb_button.                          "IC210507+
    Variables
    DATA: ok_code                TYPE sy-ucomm,
          save_ok                TYPE sy-ucomm,
    Name of the custom control added on the screen
          gv_custom_control_name TYPE scrfname VALUE 'CC_ALV'.
    Begin of IC210507
    Local classes
    CLASS lcl_event_handler DEFINITION .
      PUBLIC SECTION.
        METHODS:
    To add new functional buttons to the ALV toolbar
        handle_toolbar      FOR EVENT toolbar OF cl_gui_alv_grid
                            IMPORTING e_object e_interactive,
    To implement user commands
        handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
                            IMPORTING e_ucomm.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    End of IC210507
    Calling the screen where ALV output is displayed
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
          PBO
    MODULE status_0100 OUTPUT.
    ALV display
      PERFORM display_alv.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          PAI
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      IF save_ok EQ 'EXIT'.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  display_alv
          ALV display
    FORM display_alv.
      PERFORM get_data.
      PERFORM create_alv.
    ENDFORM.                    " display_alv
    *&      Form  get_data
          Fetch data to be displayed in the list
    FORM get_data.
      SELECT * FROM sflight
               INTO TABLE gt_list.
    ENDFORM.                    " get_data
    *&      Form  create_alv
          Create and set or Refresh ALV
    FORM create_alv.
    Checking whether an instance of the container (or ALV Grid) exists.
      IF gr_alvgrid IS INITIAL.
    If not, creating and setting ALV for the first display.
    Creating custom container instance
        CREATE OBJECT gr_ccontainer
          EXPORTING
            container_name              = gv_custom_control_name
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
    Creating ALV Grid instance
        CREATE OBJECT gr_alvgrid
          EXPORTING
            i_parent          = gr_ccontainer
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5.
    Begin of IC210507
    Creating an instance for the event handler
        CREATE OBJECT gr_event_handler.
    Registering handler methods to handle ALV Grid events
        SET HANDLER gr_event_handler->handle_user_command FOR gr_alvgrid.
        SET HANDLER gr_event_handler->handle_toolbar FOR gr_alvgrid.
    End of IC210507
    Preparing field catalog.
        PERFORM prepare_field_catalog CHANGING gt_fieldcat.
    Preparing layout structure
        PERFORM prepare_layout CHANGING gs_layout.
    Excluding Unwanted Standard Function Buttons
        PERFORM exclude_tb_functions CHANGING gt_exclude.       "IC210507+
    Method to display ALV grid
        CALL METHOD gr_alvgrid->set_table_for_first_display
          EXPORTING
            is_layout                     = gs_layout
    To exclude buttons the exclusion table must be passed to the following
    field
            it_toolbar_excluding          = gt_exclude          "IC210507+
          CHANGING
            it_outtab                     = gt_list
            it_fieldcatalog               = gt_fieldcat
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
    To make ALV show our additional buttons, we must call the method
    “set_toolbar_interactive” for the ALV Grid instance after the instance
    is created.
        CALL METHOD gr_alvgrid->set_toolbar_interactive.       "IC210507+
      ELSE.
    If an instance of the container (or ALV Grid) exists, refreshing it.
        CALL METHOD gr_alvgrid->refresh_table_display
          EXCEPTIONS
            finished = 1
            OTHERS   = 2.
      ENDIF.
    ENDFORM.                    " create_alv
    *&      Form  prepare_field_catalog
          Subroutine to populate field catalog
         <--P_GT_FIELDCAT  Table to describe the field catalog
    FORM prepare_field_catalog  CHANGING p_gt_fieldcat TYPE lvc_t_fcat.
    Generating the field catalog semi automatically
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'SFLIGHT'
        CHANGING
          ct_fieldcat            = p_gt_fieldcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      LOOP AT p_gt_fieldcat INTO gs_fcat.
        CASE gs_fcat-fieldname.
          WHEN 'CARRID'.
            gs_fcat-outputlen = '10'.
            gs_fcat-coltext = 'Airline Carrier ID'.
            MODIFY p_gt_fieldcat FROM gs_fcat.
          WHEN 'FLDATE'.
            gs_fcat-just = 'C'.
            gs_fcat-hotspot = 'X'.
            MODIFY p_gt_fieldcat FROM gs_fcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " prepare_field_catalog
    *&      Form  prepare_layout
          Preparing layout structure
         <--P_GS_LAYOUT  Layout structure
    FORM prepare_layout  CHANGING p_gs_layout TYPE lvc_s_layo.
      p_gs_layout-zebra = 'X' .
      p_gs_layout-grid_title = 'Flight Info System'.
      p_gs_layout-smalltitle = 'X'.
    ENDFORM.                    " prepare_layout
    Begin of IC210507
    *&      Form  exclude_tb_functions
          Excluding Unwanted Standard Function Buttons
         <--P_GT_EXCLUDE  Table to be filled up to exclude buttons
    FORM exclude_tb_functions  CHANGING p_gt_exclude TYPE ui_functions.
    “MC_FC_” are names for functions directly and the names beginning with
    “MC_MB_” are for the function menus including some subfunctions as menu
    entries.
    In this case 'Maximum' and 'Minimum' options under 'Sum' button & 'Print'
    button are excluded
      gs_exclude = cl_gui_alv_grid=>mc_fc_maximum.
      APPEND gs_exclude TO p_gt_exclude.
      gs_exclude = cl_gui_alv_grid=>mc_fc_minimum.
      APPEND gs_exclude TO p_gt_exclude.
      gs_exclude = cl_gui_alv_grid=>mc_fc_print.
      APPEND gs_exclude TO p_gt_exclude.
    ENDFORM.                    " exclude_tb_functions
    *&       Class (Implementation)  lcl_event_handler
           Event handler for the ALV Grid instance.
    CLASS lcl_event_handler IMPLEMENTATION.
    Handle Toolbar
      METHOD handle_toolbar.
        PERFORM handle_toolbar USING e_object e_interactive .
      ENDMETHOD .                    "handle_toolbar
    Handle User Command
      METHOD handle_user_command .
        PERFORM handle_user_command USING e_ucomm .
      ENDMETHOD.                    "handle_user_command
    ENDCLASS.               "lcl_event_handler
    *&      Form  handle_toolbar
          Subroutine called from event handler method for event toolbar.
          This is to add a new button in the ALV application toolbar
         -->P_E_OBJECT
         -->P_E_INTERACTIVE
    FORM handle_toolbar  USING    p_e_object TYPE REF TO cl_alv_event_toolbar_set
                                  p_e_interactive.
    Begin of 'Adding a new Button'
      CLEAR gs_toolbar.
    Function code
      MOVE 'EXIT' TO gs_toolbar-function.
    Button type that will be added to the toolbar
      gs_toolbar-butn_type = 0.
    Icon for the button
    From the type group ICON in SE11, we can get the value to be passed
    for icon
      gs_toolbar-icon = '@2N@'.
    Quick info for the button
      MOVE 'Exit' TO gs_toolbar-quickinfo.
    Text for the button
      MOVE 'Exit' TO gs_toolbar-text.
    Adds the button as disabled if set to X
      MOVE ' ' TO gs_toolbar-disabled.
    Appending the structure to the table attribute “mt_toolbar” of the object
      APPEND gs_toolbar TO p_e_object->mt_toolbar.
    End of 'Adding a new Button'
    Begin of 'Disabling an existing standard Button'
      LOOP AT p_e_object->mt_toolbar
              INTO gs_toolbar
    Identify which button to disable from the function code
    In this case disabling the 'Filter' button
              WHERE function = '&MB_FILTER'.
    Set the 'DISABLED' field to disable a button
        gs_toolbar-disabled = 'X'.
        MODIFY p_e_object->mt_toolbar FROM gs_toolbar.
      ENDLOOP.
    End of 'Disabling an existing standard Button'
    ENDFORM.                    " handle_toolbar
    *&      Form  handle_user_command
          Implement any new function
         -->P_E_UCOMM  text
    FORM handle_user_command  USING    p_e_ucomm TYPE syucomm.
      IF p_e_ucomm EQ 'EXIT'.
        LEAVE PROGRAM.
      ENDIF.
    ENDFORM.                    " handle_user_command
    End of IC210507
    Award points if found useful.
    Regards
    Indrajit.

  • Custom F4 for a field in ALV GRID

    I am want to provide a custom f4 fro a field in alv gird
    similiar to the functionality of process on value request
    on a normal screen

    Hi Kaushik
    You can find some information at page 37 of the document:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an easy reference for alv grid control.pdf
    *--Serdar

  • Runtime error while trying to execute custom F4 help in OOP ALV grid.

    Dear All,
    I am trying to add custom search help for one of my column in ALV grid. I'm using OOP ALV, when i click for search help for that column, the system shows runtime error like below.
    I am new to OOP concept and tried to follow program BCALV_EDIT_03. But not getting this error occur. Please help me.
    With regards.

    Hi,
    In order to be able to provide a search help for a field in an ALV you must do the following things.
    1) The field where F4 help need to be attached needs to be made editable.
    2) Create an event handler class to handle the ONF4 event. You can refer the following code:
        CLASS lcl_alv1_handler DEFINITION.
        PUBLIC SECTION.
           "Tohandle F4 helps
           METHODS handle_f4 FOR EVENT onf4 OF cl_gui_alv_grid
                   IMPORTING e_fieldname e_fieldvalue es_row_no er_event_data
                             et_bad_cells e_display.
        ENDCLASS.
       CLASS lcl_alv1_handler IMPLEMENTATION.
          METHOD handle_f4.
    CASE e_fieldname.
         WHEN 'LIFNR'.               "Set F4 for courier vendor
             SELECT lifnr name1 FROM lfa1 INTO TABLE lt_lifnr.
           IF lt_lifnr IS NOT INITIAL.
             CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
               EXPORTING
                 retfield           = 'LIFNR'
                 window_title   = 'Vendors'
                 value_org       = 'S'
               TABLES
                 value_tab       = lt_lifnr
                 return_tab      = lt_return
               EXCEPTIONS
                 parameter_error = 1
                 no_values_found = 2
                 OTHERS          = 3.
             IF sy-subrc = 0.
               READ TABLE gt_final INTO wa_final_t INDEX es_row_no-row_id.
               IF sy-subrc = 0.
                 READ TABLE lt_return INTO wa_return INDEX 1.
                 IF sy-subrc = 0.
                   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                     EXPORTING
                       input  = wa_return-fieldval
                     IMPORTING
                       output = lv_lifnr.
                   wa_final_t-lifnr  = lv_lifnr.
                   MODIFY gt_final FROM wa_final_t INDEX es_row_no-row_id.
                 ENDIF.
               ENDIF.
             ENDIF.
           ENDIF.
          ENDCASE.
             CALL METHOD o_alv->refresh_table_display.
          ENDMETHOD.
       ENDCLASS.
        In the above method, GT_FINAL-LIFNR is being overwritten by the LIFNR you had selected       from F4 help. So we will call the refresh_table_display after it to see the result in the ALV.
    3) After creating the ALV object, add the fields to which the F4 has to be added. For this you
        need to declare an internal table based on  lvc_t_f4. Use the following code. Here O_ALV is    my ALV object.:
       CREATE OBJECT o_container
           EXPORTING
             container_name              = 'CUSTCON'
           EXCEPTIONS
             cntl_error                  = 1
             cntl_system_error           = 2
             create_error                = 3
             lifetime_error              = 4
             lifetime_dynpro_dynpro_link = 5
             OTHERS                      = 6.
         IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
         CREATE OBJECT o_alv
           EXPORTING
             i_parent          = o_container
           EXCEPTIONS
             error_cntl_create = 1
             error_cntl_init   = 2
             error_cntl_link   = 3
             error_dp_create   = 4
             OTHERS            = 5.
         IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
       CLEAR : gt_f4, wa_f4.
       wa_f4-fieldname   = 'LIFNR'.
       wa_f4-register    = 'X'.
       wa_f4-getbefore   = space.
       wa_f4-chngeafter  = space.
       APPEND wa_f4 TO gt_f4.
       Here I am assigning F4 to LIFNR field in the final internal table that is displayed using ALV.
       After this register this field for F4.
        CALL METHOD o_alv->register_f4_for_fields
           EXPORTING
              it_f4 = gt_f4.
       CREATE OBJECT o_alv_handler.
       SET HANDLER : o_alv_handler->handle_f4 FOR o_alv1.
       The object o_alv_handler is created based on the event handler class.
    I hope that this will solve your issue. Revert if this is solved.
    Rgards,
    Abijith

  • Custom total/subtotal formula in an ALV Grid and printing.

    I have an ALV grid using OOPs method (Class cl_gui_alv_grid). The table that I am displaying is a dynamic table.
    call method o_grid->set_table_for_first_display
        exporting
          is_variant      = gx_variant
          i_save          = 'A'
          is_layout       = gs_layout
        changing
          it_fieldcatalog = it_fldcat
          it_outtab       = <gt_tabletotal>.
    On one of the columns in the ALV grid, instead of the regular summation, I had to do weighted averages (not avg).
    I built a logic to manipulate this total field for that column using field symbols.
    CALL METHOD o_grid->get_subtotals
        IMPORTING ep_collect00 = total
                  ep_collect01 = subto.
    ASSIGN total->* TO <ftotal>.
    ASSIGN subto->* TO <fsubto>.
    CALL METHOD o_grid->refresh_table_display
       EXPORTING I_SOFT_REFRESH = '1' .
    I manipulated <ftotal>-mycustomformulafield field there using some logic.
    In my field catalog i have the above field with wa_it_fldcat-do_sum = 'X ' .
    Now, II am able to see my custom formula on the screen. But when I print the grid using the print button or when I export to an excel sheet(I use export to local file and then select excel there) , my custom formula that i calculated above is reset to 0.000 .
    (Also when I email the grid, my custom formula is wiped). How can I avoid this ? Any useful suggestion is well appreciated.

    Hi, Shareen,
    We have the same problema here.
    Could you solve it?
    Thanks in advance

  • How to hide the grid lines between two rows in a ALv? Please help!

    Hi Experts,
             I have a ABAP ALV(reuse alv grid FM) report.
    The last field in the ALV is "Description" which can contain data of size more than 130 chars.
    Since the max field length in ALV grid is 130 chars hence I am splitting this field value whenever the field length is more than 130 chars.
    After splitting I am generating duplicate rows but with different "Description" field values ( each contains the splitted values".
    For example:
    Name| City | Description                             |
    Hari|HK    |Employee responsible for time management |
    Hari|HK    |and issue resolution                     |
    Now I want to hide the grid line between these two rows
    and just for Description field.
    In other words I want ALV to display like this:
    Name| City | Description                             |
    Hari|HK    |Employee responsible for time management |
    Hari|HK    |and issue resolution                     |
    How can I acheive this?
    Please provide some sample code.
    Please help. I will be really greatfull to your help.
    Thanks
    Gopal

    Hi Rich,
          If that is the case then atleast how can I hide the complete row grid line?
    Please give some sample code.
    Thanks
    Gopal

Maybe you are looking for