Problem in linking F4 help in alv grid display.

Hi,
     I am linking F4 help in my program.My program gets activated properly but i am getting runtime error as : DYNPRO_NOT_FOUND and short text as
Dynpor existiert nicht.Please help me in removing this error.Below is the simple code in which i am getting the error for ur reference:
Thanks.
REPORT  ZALVF4.
Global data definitions for ALV.......................................
DATA : alvgrid TYPE REF TO cl_gui_alv_grid,
       custom_container TYPE REF TO cl_gui_custom_container,
       fieldcatalog TYPE lvc_t_fcat.
table to contain fields that require f4...............................
DATA : lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
ok_code declaration...................................................
DATA : ok_code TYPE sy-ucomm.
Tables declaration....................................................
TABLES : zharry.
Types declaration.....................................................
TYPES : BEGIN OF ty_emp,
  empid LIKE zharry-student,
  empname LIKE zharry-sname,
END OF ty_emp.
Internal table declaration............................................
DATA : i_emp TYPE TABLE OF ty_emp.
Workarea declaration..................................................
DATA : wa_emp TYPE ty_emp.
Selection screen parameters...........................................
SELECT-OPTIONS : s_sno FOR zharry-student.
      CLASS lcl_event_handler DEFINITION
CLASS lcl_event_handler DEFINITION.
  PUBLIC SECTION.
    METHODS :
             handle_on_f1 FOR EVENT onf1 OF cl_gui_alv_grid
                          IMPORTING e_fieldname es_row_no er_event_data,
             handle_on_f4 for event onf4 of cl_gui_alv_grid
                          importing e_fieldname es_row_no er_event_data
ENDCLASS.
      CLASS lcl_event_handler IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
  METHOD handle_on_f1.
custom f1 help for empid field.......................................
    IF e_fieldname = 'STUDENT'.
      CALL SCREEN 3001.
    ENDIF.
to prevent processing of standard f1 help............................
    er_event_data->m_event_handled = 'X'.
  ENDMETHOD.
  Method handle_on_f4.
standard f4 help will be invoked......................................
  endmethod.
ENDCLASS.
start of selection....................................................
START-OF-SELECTION.
  SELECT STUDENT SNAME FROM ZHARRY
                       INTO CORRESPONDING FIELDS OF TABLE i_emp
                       WHERE student IN s_sno.
  CALL SCREEN 3000.
*&      Module  STATUS_3000  OUTPUT
      text
MODULE status_3000 OUTPUT.
  SET PF-STATUS 'ZTOOL'.
  SET TITLEBAR 'ZTITLE'.
  IF alvgrid IS INITIAL.
    CREATE OBJECT custom_container
      EXPORTING
        container_name = 'ZCONTAINER'.
    CREATE OBJECT alvgrid
      EXPORTING
        i_parent = custom_container.
    PERFORM prepare_f4.
    CALL METHOD alvgrid->register_f4_for_fields
      EXPORTING
        it_f4  = lt_f4[]
creating instance for event handler..................................
    DATA : event_handler TYPE REF TO lcl_event_handler.
    CREATE OBJECT event_handler.
    SET HANDLER event_handler->handle_on_f1 FOR alvgrid.
    SET HANDLER event_handler->handle_on_f4 FOR alvgrid.
preparing field catalog..............................................
    PERFORM prepare_fieldcatalog CHANGING fieldcatalog.
    CALL METHOD alvgrid->set_table_for_first_display
     EXPORTING
       I_BYPASSING_BUFFER            =
       I_BUFFER_ACTIVE               =
       I_CONSISTENCY_CHECK           =
       I_STRUCTURE_NAME              =
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
       IS_LAYOUT                     =
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
      CHANGING
         it_outtab                     = i_emp
         it_fieldcatalog               = fieldcatalog
       IT_SORT                       =
       IT_FILTER                     =
     EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ENDIF.
ENDMODULE.                 " STATUS_3000  OUTPUT
preparing field catalog...............................................
FORM prepare_fieldcatalog CHANGING i_fieldcatalog TYPE lvc_t_fcat.
  DATA : ls_fcat TYPE lvc_s_fcat.
  ls_fcat-fieldname = 'STUDENT'.
  ls_fcat-ref_table = 'ZHARRY'.
  ls_fcat-coltext = 'STUDENT NO'.
  APPEND ls_fcat TO i_fieldcatalog.
  CLEAR ls_fcat.
  ls_fcat-fieldname = 'SNAME'.
  ls_fcat-ref_table = 'ZHARRY'.
  ls_fcat-coltext = 'STUDENT NAME'.
  APPEND ls_fcat TO i_fieldcatalog.
ENDFORM.
*&      Module  USER_COMMAND_3000  INPUT
      text
MODULE user_command_3000 INPUT.
  CASE ok_code.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_3000  INPUT
*&      Module  USER_COMMAND_3001  INPUT
      text
MODULE user_command_3001 INPUT.
  CASE ok_code.
    WHEN 'SAVE'.
      LEAVE TO SCREEN 0.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_3001  INPUT
*&      Module  STATUS_3001  OUTPUT
      text
MODULE status_3001 OUTPUT.
  SET PF-STATUS 'GUI'.
  SET TITLEBAR 'TITLE'.
ENDMODULE.                 " STATUS_3001  OUTPUT
preparing fields to be registered for f4 help.........................
FORM prepare_f4.
  lt_f4-fieldname = 'EMPNAME'.
  lt_f4-register = 'X'.
  lt_f4-getbefore = 'X'.
  lt_f4-chngeafter = 'X'.
  APPEND lt_f4.
ENDFORM.

Hi,
     I am linking F4 help in my program.My program gets activated properly but i am getting runtime error as : DYNPRO_NOT_FOUND and short text as
Dynpor existiert nicht.Please help me in removing this error.Below is the simple code in which i am getting the error for ur reference:
Thanks.
REPORT  ZALVF4.
Global data definitions for ALV.......................................
DATA : alvgrid TYPE REF TO cl_gui_alv_grid,
       custom_container TYPE REF TO cl_gui_custom_container,
       fieldcatalog TYPE lvc_t_fcat.
table to contain fields that require f4...............................
DATA : lt_f4 TYPE lvc_t_f4 WITH HEADER LINE.
ok_code declaration...................................................
DATA : ok_code TYPE sy-ucomm.
Tables declaration....................................................
TABLES : zharry.
Types declaration.....................................................
TYPES : BEGIN OF ty_emp,
  empid LIKE zharry-student,
  empname LIKE zharry-sname,
END OF ty_emp.
Internal table declaration............................................
DATA : i_emp TYPE TABLE OF ty_emp.
Workarea declaration..................................................
DATA : wa_emp TYPE ty_emp.
Selection screen parameters...........................................
SELECT-OPTIONS : s_sno FOR zharry-student.
      CLASS lcl_event_handler DEFINITION
CLASS lcl_event_handler DEFINITION.
  PUBLIC SECTION.
    METHODS :
             handle_on_f1 FOR EVENT onf1 OF cl_gui_alv_grid
                          IMPORTING e_fieldname es_row_no er_event_data,
             handle_on_f4 for event onf4 of cl_gui_alv_grid
                          importing e_fieldname es_row_no er_event_data
ENDCLASS.
      CLASS lcl_event_handler IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
  METHOD handle_on_f1.
custom f1 help for empid field.......................................
    IF e_fieldname = 'STUDENT'.
      CALL SCREEN 3001.
    ENDIF.
to prevent processing of standard f1 help............................
    er_event_data->m_event_handled = 'X'.
  ENDMETHOD.
  Method handle_on_f4.
standard f4 help will be invoked......................................
  endmethod.
ENDCLASS.
start of selection....................................................
START-OF-SELECTION.
  SELECT STUDENT SNAME FROM ZHARRY
                       INTO CORRESPONDING FIELDS OF TABLE i_emp
                       WHERE student IN s_sno.
  CALL SCREEN 3000.
*&      Module  STATUS_3000  OUTPUT
      text
MODULE status_3000 OUTPUT.
  SET PF-STATUS 'ZTOOL'.
  SET TITLEBAR 'ZTITLE'.
  IF alvgrid IS INITIAL.
    CREATE OBJECT custom_container
      EXPORTING
        container_name = 'ZCONTAINER'.
    CREATE OBJECT alvgrid
      EXPORTING
        i_parent = custom_container.
    PERFORM prepare_f4.
    CALL METHOD alvgrid->register_f4_for_fields
      EXPORTING
        it_f4  = lt_f4[]
creating instance for event handler..................................
    DATA : event_handler TYPE REF TO lcl_event_handler.
    CREATE OBJECT event_handler.
    SET HANDLER event_handler->handle_on_f1 FOR alvgrid.
    SET HANDLER event_handler->handle_on_f4 FOR alvgrid.
preparing field catalog..............................................
    PERFORM prepare_fieldcatalog CHANGING fieldcatalog.
    CALL METHOD alvgrid->set_table_for_first_display
     EXPORTING
       I_BYPASSING_BUFFER            =
       I_BUFFER_ACTIVE               =
       I_CONSISTENCY_CHECK           =
       I_STRUCTURE_NAME              =
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
       IS_LAYOUT                     =
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
      CHANGING
         it_outtab                     = i_emp
         it_fieldcatalog               = fieldcatalog
       IT_SORT                       =
       IT_FILTER                     =
     EXCEPTIONS
       INVALID_PARAMETER_COMBINATION = 1
       PROGRAM_ERROR                 = 2
       TOO_MANY_LINES                = 3
       others                        = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
  ENDIF.
ENDMODULE.                 " STATUS_3000  OUTPUT
preparing field catalog...............................................
FORM prepare_fieldcatalog CHANGING i_fieldcatalog TYPE lvc_t_fcat.
  DATA : ls_fcat TYPE lvc_s_fcat.
  ls_fcat-fieldname = 'STUDENT'.
  ls_fcat-ref_table = 'ZHARRY'.
  ls_fcat-coltext = 'STUDENT NO'.
  APPEND ls_fcat TO i_fieldcatalog.
  CLEAR ls_fcat.
  ls_fcat-fieldname = 'SNAME'.
  ls_fcat-ref_table = 'ZHARRY'.
  ls_fcat-coltext = 'STUDENT NAME'.
  APPEND ls_fcat TO i_fieldcatalog.
ENDFORM.
*&      Module  USER_COMMAND_3000  INPUT
      text
MODULE user_command_3000 INPUT.
  CASE ok_code.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_3000  INPUT
*&      Module  USER_COMMAND_3001  INPUT
      text
MODULE user_command_3001 INPUT.
  CASE ok_code.
    WHEN 'SAVE'.
      LEAVE TO SCREEN 0.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_3001  INPUT
*&      Module  STATUS_3001  OUTPUT
      text
MODULE status_3001 OUTPUT.
  SET PF-STATUS 'GUI'.
  SET TITLEBAR 'TITLE'.
ENDMODULE.                 " STATUS_3001  OUTPUT
preparing fields to be registered for f4 help.........................
FORM prepare_f4.
  lt_f4-fieldname = 'EMPNAME'.
  lt_f4-register = 'X'.
  lt_f4-getbefore = 'X'.
  lt_f4-chngeafter = 'X'.
  APPEND lt_f4.
ENDFORM.

Similar Messages

  • Problem in placing the background in ALV Grid display

    I have created one image of the business flow, and it have to be displayed in the background of ALV grid display.
    For this I have gone to T.Code –<b>OAER</b> , Given class name as <b>PICTURES</b> , Class type as <b>OT</b> , Object Key <b>BACKGROUND</b>, clicked on the triangle of Standard Doc , then double click on screen, and finally uploaded the background into SAP.
    In the function module <b>‘REUSE_ALV_GRID_DISPLAY’</b> I passed this background to the parameter I_BACKGROUND_ID.
    It is working fine, and I was able to see the back ground in my program.
    (developed in IDES)
    But the same is not working in my development client, will some one suggest be the reason for the problem. Please kindly help me out from this problem.

    hello Dinesh,
    I have created the object key in the development client itself and used in the grid display of the same client. i am not understanding where the problem is, any how thank you very much for your responce. if you have any other solution please let me know.
    Thank you

  • Help on ALV GRID display outputting format for 2 internal tables

    Hi,
        I have requirement in ALV GRID where I need to display the data from 2 internal tables. The first internal table has the content of Delivery due list data and second the internal table has the corresponding stock transfer data of the Delivery Due list. I have a checbox on my selection screen, when unchecked it should output the 1st internal table data, i.e for Delivery due list. When it is checked then it should output 1st Internal table data + 2nd internal table data of stock transfer. For example, 1 document delivery due list data and 2nd line for that document should show the stock transfer data. You can also check the transaction code VL10E for that will show a delivery due list...and for stock tranfer,you need to check with Purchase order in in the USer Role tabstrip. Pls suggest.
    Regards,
    Mira

    Hi,
    U can try out this code
    REPORT zzz_test NO STANDARD PAGE HEADING
                           MESSAGE-ID zz.
    The Data Declarations
    INCLUDE zzm_test_alv_data.
    The Selection Screen Definition
    INCLUDE zzm_test_alv_selscrn.
    The definition and implementation of the event reciever class
    INCLUDE zzm_test_alv_class.
    START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM f1000_load_itabs.
    END-OF-SELECTION
    END-OF-SELECTION.
      IF NOT cb_disp IS INITIAL.
        CALL SCREEN 9001.
      ENDIF.
    Include for getting data
      INCLUDE zzm_test_alv_forms.
    Include for PAI and PBO of screen
      INCLUDE zzm_test_alv_screen.
      INCLUDE ZZM_TEST_ALV_DATA                                          *
    This include has all the data declaration defined
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    Table Declarations:
    TABLES: mara,
            makt.
    Internal Tables:
    The following structure type must be defined in the data dictionary
    DATA:  i_fieldcat  TYPE lvc_t_fcat,
           i_fieldcat1 TYPE lvc_t_fcat,
           i_output1   TYPE STANDARD TABLE OF mara,
           i_output2   TYPE STANDARD TABLE OF makt,
    Work Areas:
           w_output1   TYPE STANDARD TABLE OF mara,
           w_output2   TYPE STANDARD TABLE OF makt.
    Variable:
    DATA: lv_repid    LIKE sy-repid.
    lv_repid = sy-repid.
      INCLUDE ZZM_TEST_ALV_SELSCRN                                       *
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    SELECTION-SCREEN BEGIN OF BLOCK b_main WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS: cb_disp AS CHECKBOX.
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN END OF BLOCK b_main.
      INCLUDE ZZM_TEST_ALV_CLASS                                         *
    This include has all the data declaration defined for ALV
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    INCLUDE <icon>.
    Predefine a local class for event handling to allow the
    declaration of a reference variable before the class is defined.
    DATA : o_alvgrid1 TYPE REF TO cl_gui_alv_grid ,
           o_alvgrid2 TYPE REF TO cl_gui_alv_grid ,
           cont_for_cognos1   TYPE scrfname VALUE 'BCALC_GRID_01_9100',
           cont_for_cognos2   TYPE scrfname VALUE 'BCALC_GRID_01_9200',
           custom_container1 TYPE REF TO cl_gui_custom_container,
           custom_container2 TYPE REF TO cl_gui_custom_container,
          Work Area
           w_layout TYPE lvc_s_layo ,
           w_variant TYPE disvariant.
          Constants
    CONSTANTS : c_lay(1) TYPE c VALUE 'A' .                  " All Layouts
    CONSTANTS: BEGIN OF c_main_tab,
               tab1 LIKE sy-ucomm VALUE 'MAIN_TAB_FC1',   "
               tab2 LIKE sy-ucomm VALUE 'MAIN_TAB_FC2',   "
               END OF c_main_tab.
      INCLUDE ZZM_TEST_ALV_FORMS                                         *
    This Include has the various forms used in the program
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    *&      Form  f9001_build_field_cat
          To Build Field Catalog
         -->P_I_FIELDCAT  text
         -->P_0021   text
    FORM f9001_build_field_cat TABLES   p_fieldcat STRUCTURE lvc_s_fcat
                          USING value(p_structure).
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name       = p_structure
           CHANGING
                ct_fieldcat            = p_fieldcat[]
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE i005 WITH 'Error in ALV field catalogue creation'.
                                                                " text-e05.
        LEAVE LIST-PROCESSING.
      ENDIF.
    ENDFORM.                    " f9001_build_field_cat
    *&      Form  f9000_objects_create
          For creating Custom Containers
    -->  p1        text
    <--  p2        text
    FORM f9000_objects_create.
      CREATE OBJECT custom_container1
          EXPORTING
              container_name = cont_for_cognos1
          EXCEPTIONS
              cntl_error = 1
              cntl_system_error = 2
              create_error = 3
              lifetime_error = 4
              lifetime_dynpro_dynpro_link = 5.
      CREATE OBJECT custom_container2
          EXPORTING
              container_name = cont_for_cognos2
          EXCEPTIONS
              cntl_error = 1
              cntl_system_error = 2
              create_error = 3
              lifetime_error = 4
              lifetime_dynpro_dynpro_link = 5.
      IF sy-subrc NE 0.
    add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = lv_repid
                  txt2  = sy-subrc
                  txt1  = 'The control could not be created'(510).
      ENDIF.
      CREATE OBJECT o_alvgrid1
           EXPORTING i_parent = custom_container1.
      CREATE OBJECT o_alvgrid2
           EXPORTING i_parent = custom_container2.
    ENDFORM.                    " f9000_objects_create
    *&      Form  f9003_layout
          To define the layout
         -->P_SY_TITLE  text
         -->P_0030   text
         -->P_0031   text
         -->P_0032   text
    FORM f9003_layout USING  value(ptitle)
                             value(pzebra)
                             value(pmode)
                             value(pwidth).
      w_layout-grid_title  = ptitle.
      w_layout-zebra       = pzebra.
      w_layout-sel_mode    = pmode.
      w_layout-cwidth_opt  = pwidth.
      w_variant-report     = sy-repid.
    ENDFORM.                    " f9003_layout
    *&      Form  f9006_error_handle
         To handle event
         -->P_PTEXT  text
    FORM f9006_error_handle USING value(ptext).
      IF sy-subrc NE 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = text-e03 " Error Note
                  txt2  = sy-subrc
                  txt1  = ptext.
      ENDIF.
    ENDFORM.                    " f9006_error_handle
          FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      CALL METHOD custom_container1->free.
      CALL METHOD custom_container2->free.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc NE 0.
        CALL FUNCTION 'POPUP_TO_INFORM'
             EXPORTING
                  titel = lv_repid
                  txt2  = sy-subrc
                  txt1  = 'Error in FLush'(500).
      ENDIF.
    ENDFORM.
    *&      Form  f1000_load_itabs
          Select from Database
    -->  p1        text
    <--  p2        text
    form f1000_load_itabs.
      SELECT * FROM mara
               INTO TABLE i_output1
               UP TO 50 rows.
      SELECT * FROM makt
               INTO TABLE i_output2
               UP TO 50 rows.
    endform.                    " f1000_load_itabs
      INCLUDE ZZM_TEST_ALV_SCREEN                                        *
    2/ Description / Include functions
    This include contains PBO and PAI events for the screen of report
    ZZZJJ_TEST_ALV
    3/ Responsibility
    Author............: Judith Jessie Selvi
    Creation Date.....: 28/03/2005
    DATA FOR TABSTRIP 'MAIN_TAB'
    CONTROLS:  main_tab TYPE TABSTRIP.
    DATA:      BEGIN OF i_main_tab,
                 subscreen   LIKE sy-dynnr,
                 prog        LIKE sy-repid VALUE
                                  'ZZZ_TEST',
                 pressed_tab LIKE sy-ucomm VALUE c_main_tab-tab1,
               END OF i_main_tab.
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE status_9001 OUTPUT.
    IF custom_container1 IS INITIAL.
      SET PF-STATUS 'ZSTATUS'.
      SET TITLEBAR 'ZTITLE'.
      Creating Object
        PERFORM f9000_objects_create.
      Building the field catalog
        PERFORM f9001_build_field_cat TABLES i_fieldcat
                                USING 'MARA'.
        PERFORM f9001_build_field_cat TABLES i_fieldcat1
                                USING 'MAKT'.
      Modifying the field catalog
       PERFORM f9002_modify_field_cat TABLES i_fieldcat.
      For Layout
        PERFORM f9003_layout USING sy-title 'X' 'B' 'X'.
    ENDIF.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  MAIN_TAB_ACTIVE_TAB_SET  OUTPUT
          Call method to display in the output grid
    MODULE main_tab_active_tab_set OUTPUT.
      main_tab-activetab = i_main_tab-pressed_tab.
      CASE i_main_tab-pressed_tab.
        WHEN c_main_tab-tab1.
      To display report
         i_main_tab-subscreen = '9100'.
          CALL METHOD o_alvgrid1->set_table_for_first_display
          EXPORTING
             is_variant                    = w_variant
             i_save                        = c_lay
             is_layout                     = w_layout
          CHANGING
             it_outtab                     = i_output1[]
             it_fieldcatalog               = i_fieldcat[]
          EXCEPTIONS
             invalid_parameter_combination = 1
             program_error                 = 2
             too_many_lines                = 3
             OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH text-e06."Error in ALV report display
        LEAVE LIST-PROCESSING.
      ENDIF.
        WHEN c_main_tab-tab2.
      To display report
          i_main_tab-subscreen = '9200'.
          CALL METHOD o_alvgrid2->set_table_for_first_display
          EXPORTING
             is_variant                    = w_variant
             i_save                        = c_lay
             is_layout                     = w_layout
          CHANGING
             it_outtab                     = i_output2[]
             it_fieldcatalog               = i_fieldcat1[]
          EXCEPTIONS
             invalid_parameter_combination = 1
             program_error                 = 2
             too_many_lines                = 3
             OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE i005 WITH text-e06."Error in ALV report display
        LEAVE LIST-PROCESSING.
      ENDIF.
    WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 “MAIN_TAB_ACTIVE_TAB_SET OUTPUT
    *&      Module MAIN_TAB_ACTIVE_TAB_GET INPUT
          Check & Process the selected Tab
    MODULE main_tab_active_tab_get INPUT.
      CASE sy-ucomm.
        WHEN c_main_tab-tab1.
          i_main_tab-pressed_tab = c_main_tab-tab1.
        WHEN c_main_tab-tab2.
          i_main_tab-pressed_tab = c_main_tab-tab2.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 “MAIN_TAB_ACTIVE_TAB_GET INPUT
    *&      Module USER_COMMAND_9001 INPUT
          User Command
    MODULE user_command_9001 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.
          PERFORM exit_program.
          SET SCREEN '0'.
        WHEN 'EXIT' OR  'CANC'.
          PERFORM exit_program.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 “USER_COMMAND_9000 INPUT
    *&      Module MAIN_TAB_ACTIVE_TAB_SET INPUT
          Set sunscreen
    MODULE main_tab_active_tab_set INPUT.
      main_tab-activetab = i_main_tab-pressed_tab.
      CASE i_main_tab-pressed_tab.
        WHEN c_main_tab-tab1.
            i_main_tab-subscreen = '9100'.
        WHEN c_main_tab-tab2.
            i_main_tab-subscreen = '9200'.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.                 “MAIN_TAB_ACTIVE_TAB_SET INPUT
    Thanks & Regards,
    Judith.

  • F4 help in ALV grid display

    hi,
    I need to allow F4 help to an alv field.
    The alv is designed using cl_gui_alv_grid.
    the reference values are in an internal table. how can i get these values for the help?
    thanks,
    Arindam.

    Hi,
    Refer to this link..Re: F4 help for OO ALV Grid

  • TO enable the menu button in ALV Grid Display

    Hi Mates,
    I have a peculiar problem while doing ALV Grid display for screens.
    In the main Screen i have Three coloumns.The 1st coloum will interacted
    next screen 101 and 2nd coloum will interacted to screen 102.
    Now the problem is in the menu of ALV Grid display,the Total button was enabled for screen
    101 and same button is disabled in screen 102.
    But the code semms to be fine .
    Below i have pasted the code and please have a look and help to come out of this cris.
    My Code  :
    FORM CREATE_ALV_GRID USING R_SCREEN.
      DATA: LS_LAYOUT TYPE LVC_S_LAYO,
      ITAB_FUNCTIONS     TYPE UI_FUNCTIONS.   "MHTK903257(+)(add)
      CASE R_SCREEN.
    *--> SCREEN 9000
        WHEN C_SCREEN_9000.
    *-- Build the field catalog for the ALV grid.
          PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_9000
                                      USING:
    *ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
    'ITAB_OVERVIEW' 'WADAT'     'Due date'(004)  'X' 'D' ' ' ' ' ' ' 'C100',
    *'ITAB_OVERVIEW' 'HU_UNLOAD' 'Unloaded HU'(005) 'X' 'I' '15' ' ' ' ' 'C500',  "MHTK903257(-)
    'ITAB_OVERVIEW' 'TOT_TO'    'Total TO'(006)   'X' 'I' ' '  ' ' ' ' 'C30',
    GMTK901103: REMOVE HOTSPOT ON ESTIMATED TO:
    'ITAB_OVERVIEW' 'EST_TO'    'Estim TO'(030)    ' ' 'I' ' '  ' ' ' ' 'C500'.
          LOOP AT ITAB_INB_LOC WHERE OUTPUT = 'X'.
                PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_9000
                                        USING:
       ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
            'ITAB_OVERVIEW' ITAB_INB_LOC-FIELDNAME
            ITAB_INB_LOC-Z_INBND_LOC 'X' '' ' ' ' ' 'R' 'C500'.  "MHTK903418
            ENDLOOP.
          LOOP AT ITAB_STORAGE_TYPE WHERE OUTPUT = 'X'.
            PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_9000
                                        USING:
    *ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
    'ITAB_OVERVIEW' ITAB_STORAGE_TYPE-FIELDNAME
      ITAB_STORAGE_TYPE-LGTYP 'X' 'I' ' ' ' ' 'R' 'C500'.
          ENDLOOP.
    *-- Create the ALV grid object.
          CREATE OBJECT PT_ALV_1000
            EXPORTING
              I_PARENT  = PT_DOCK_1000.
          PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS   "MHTK903257(+)(add)
                                    USING  R_SCREEN.
    *-- Get the title of the ALV grid.
          PERFORM GET_ALV_GRID_TITLE USING    C_SCREEN_1000
                                     CHANGING LS_LAYOUT-GRID_TITLE.
    *-- Display the ALV grid.
          CALL METHOD PT_ALV_1000->SET_TABLE_FOR_FIRST_DISPLAY
            EXPORTING
              IS_LAYOUT       = LS_LAYOUT
              IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
            CHANGING
              IT_OUTTAB       = ITAB_OVERVIEW
              IT_FIELDCATALOG = ITAB_FIELDCAT_9000.
    *--> SCREEN 9100
        WHEN C_SCREEN_1100.
    *-- Build the field catalog for the ALV grid.
          PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1100
                                      USING:
    *ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
    'ITAB_DETIAL' 'WAUHR'     'Due time'(007)  ' ' 'T' ' ' 'X' ' ' 'C100',
    'ITAB_DETAIL' 'TOT_TO'    'Total TO'(006)   'X' 'I' ' '  ' ' ' ' 'C30',
    'ITAB_DETAIL' 'EST_TO'    'Estim TO'(030)   ' ' 'I' ' '  ' ' ' ' 'C500'.
       CLEAR ITAB_INB_LOC.
        LOOP AT ITAB_INB_LOC WHERE SELECTED = 'X'.
             CHECK SY-SUBRC EQ 0.
                PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1100
                                        USING:
       ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
            'ITAB_DETAIL' ITAB_INB_LOC-FIELDNAME
            ITAB_INB_LOC-Z_INBND_LOC '' '' ' ' ' ' 'R' 'C500'.
         ENDLOOP.
         CLEAR: ITAB_STORAGE_TYPE.
          LOOP AT ITAB_STORAGE_TYPE WHERE SELECTED = 'X'.
            CHECK SY-SUBRC EQ 0.
            PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1100
                                        USING:
    *ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
    'ITAB_DETAIL' ITAB_STORAGE_TYPE-FIELDNAME
      ITAB_STORAGE_TYPE-LGTYP 'X' 'I' ' ' ' ' 'R' 'C500'.
          ENDLOOP.
    *-- Create the ALV grid object.
          CREATE OBJECT PT_ALV_1100
            EXPORTING
              I_PARENT  = PT_DOCK_1100.
          PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS   "MHTK903257(+)(add)
                                    USING  R_SCREEN.
    *-- Get the title of the ALV grid.
          PERFORM GET_ALV_GRID_TITLE USING    C_SCREEN_1100
                                     CHANGING LS_LAYOUT-GRID_TITLE.
    *-- Display the ALV grid.
          CALL METHOD PT_ALV_1100->SET_TABLE_FOR_FIRST_DISPLAY
            EXPORTING
              IS_LAYOUT       = LS_LAYOUT
              IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
            CHANGING
              IT_OUTTAB       = ITAB_DETAIL
              IT_FIELDCATALOG = ITAB_FIELDCAT_1100.
    screen 1300 TO detail.
    *--> SCREEN 9300
        WHEN C_SCREEN_1300.
    *-- Build the field catalog for the ALV grid.
          PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1300
                                      USING:
    *ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
    'ITAB_TO2' 'TANUM' 'TO'(020)  ' '   'C' ' ' ' ' ' ' 'C100',
    'ITAB_TO2' 'NLPLA' 'Location'(021) ' '   'C' ' '  ' ' ' ' 'C500',
    'ITAB_TO2' 'LETY1' 'SUT'(013)  ' ' 'C'  ' ' ' ' ' ' 'C500',
    'ITAB_TO2' 'MATNR' 'Material'(016) ' '  'C' ' '  ' ' ' ' 'C500',
    'ITAB_TO2' 'NSOLM' 'Quantity'(017) ' ' 'I' ' '  ' ' ' ' 'C500',
    'ITAB_TO2' 'NLTYP' 'Storage type'(014) ' ' '' ' '  ' ' ' ' 'C500'.  "MHTK903257(-)
    *'ITAB_TO2' 'POSNR' 'Line'(015) ' ' 'C' ' ' ' ' ' ' 'C500'.       "MHTK903257(-)
    *-- Create the ALV grid object.
          CREATE OBJECT PT_ALV_1300
            EXPORTING
              I_PARENT  = PT_DOCK_1300.
    *-- Exclude the non-applicable functions from the ALV grid.
          PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS
                                    USING  R_SCREEN.
    *-- Get the title of the ALV grid.
          PERFORM GET_ALV_GRID_TITLE USING    C_SCREEN_1300
                                     CHANGING LS_LAYOUT-GRID_TITLE.
          SORT ITAB_TO2 BY TANUM VBELN POSNR.
    *-- Display the ALV grid.
          CALL METHOD PT_ALV_1300->SET_TABLE_FOR_FIRST_DISPLAY
            EXPORTING
              IS_LAYOUT       = LS_LAYOUT
              IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
            CHANGING
              IT_OUTTAB       = ITAB_TO2
              IT_FIELDCATALOG = ITAB_FIELDCAT_1300.
    screen 9400 Pre Processing detail.
    *--> SCREEN 9400
        WHEN C_SCREEN_9400.          "MHTK903418(BEgin Of change)
    *-- Build the field catalog for the ALV grid.
          PERFORM BUILD_FIELD_CATALOG TABLES ITAB_FIELDCAT_1400
                                      USING:
    *ref_table|fieldname|coltext|hotspot|inttype|outputlen|lzero|just|color
    'ITAB_PRE_PROC2' 'Z_PRE_PROC' 'Pre Processing Number'(030)  ' '   'C' ' ' ' ' ' ' 'C100',
    'ITAB_PRE_PROC2' 'Z_PRE_PROC_LN' 'Pre Processing Number'(035) ' '   'C' ' '  ' ' ' ' 'C100',
    'ITAB_PRE_PROC2' 'MATNR' 'Material'(035) ' '   'C' ' '  ' ' ' ' 'C500',
    'ITAB_PRE_PROC2' 'Z_PSH_QTY' 'Quantity'(035) ' '   'C' ' '  ' ' ' ' 'C500'.
    *'ITAB_TO2' 'MATNR' 'Material'(016) ' '  'C' ' '  ' ' ' ' 'C500',
    *'ITAB_TO2' 'NSOLM' 'Quantity'(017) ' ' 'I' ' '  ' ' ' ' 'C500',
    *'ITAB_TO2' 'NLTYP' 'Storage type'(014) ' ' '' ' '  ' ' ' ' 'C500'.  "MHTK903257(-)
    **'ITAB_TO2' 'POSNR' 'Line'(015) ' ' 'C' ' ' ' ' ' ' 'C500'.       "MHTK903257(-)
    *-- Create the ALV grid object.
          CREATE OBJECT PT_ALV_1400
            EXPORTING
              I_PARENT  = PT_DOCK_1400.
    *-- Exclude the non-applicable functions from the ALV grid.
          PERFORM EXCLUDE_FUNCTIONS TABLES ITAB_FUNCTIONS
                                    USING  R_SCREEN.
    *-- Get the title of the ALV grid.
          PERFORM GET_ALV_GRID_TITLE USING    C_SCREEN_1400
                                     CHANGING LS_LAYOUT-GRID_TITLE.
          SORT ITAB_PRE_PROC2 BY Z_PRE_PROC.
    *-- Display the ALV grid.
          CALL METHOD PT_ALV_1400->SET_TABLE_FOR_FIRST_DISPLAY
            EXPORTING
              IS_LAYOUT       = LS_LAYOUT
              IT_TOOLBAR_EXCLUDING = ITAB_FUNCTIONS
            CHANGING
              IT_OUTTAB       = ITAB_PRE_PROC2
              IT_FIELDCATALOG = ITAB_FIELDCAT_1400.  "MHTK903418(End of change)
      ENDCASE.

    Hi
    U copy from standard program and paste ur report ...It will work..'
    Regards:
    Prabu

  • Problem with ALV Grid display

    Hi,
    I have developed  ALV Grid Report. It is working fine.
    But while i am coming from alv grid display to program
    by pressing BACK button it is showing one more screen
    which is empty. Again I press back button it is coming to
    selection screen. I don't want that empty screen.What is
    the problem. Can u help me in this regard.?
    Thanks
    Narasimha

    hi
    under the usercommand of back button use Exit Statement
    like
    At user-comand
    IF sy-ucom = 'Back'
    EXIT
    ENdif.
    Cheers
    Snehi

  • Facing a Problem while downloading the data from ALV Grid to Excel Sheet

    Hi Friends,
    Iam facing a problem while downloading the data from ALV Grid to excel sheet. This is working fine in Development server , when comes to Quality and Production servers I have this trouble.
       I have nearly 11 fields in ALV Grid and out of which one is PO number of length 10 , all the ten numbers are visible in the excel sheet if we download it from development server but when we download it from Quality or Production it is showing only 9 numbers.
    Can any one help me out in this case.

    hi...
    if this problems happens dont display the same internal as u finally got.
    just create new internal table without calling any standard data elements and domains... but the new internal table s similar like ur final internal table and move all the values to new int table.
    for eg.
    ur final internal int table for disp,
         data : begin of itab occur 0,
                        matnr like mara-matnr,
                   end of itab.
    create new like this,
               data : begin of itab occur 0,
                        matnr(12) type N,
                   end of itab.

  • F4 help in ALV grid using existing search help

    Hi All,
    It would be appreciable , if some help on problem. Thanks in advance.
    How to provide user defined F4 help in ALV grid using existing search help?
    ALV grid has developed using OOPS concept.
    Thanks,
    Sudhakar.

    Hi,
    if you already developed using OO concept, it should be possible to:
    create a handler for event ONF4
    The interface will tell you actual field name and value where F4 is pressed. This will enable you to call your own routine (see FM F4-IF....).
    Please check how the standard handles F4  - if you have standard and customer-F4 mixed you shouldtake care that the standard handling is triggered.
    Regards,
    Clemens

  • Kindly help to develop alv grid display

    Hi ,
    I have a requirement in which I need to display ALV GRID display and in its tool bar 4 butons are required. In the same view down to alv display i want to develop a tabstrip and its functionalities.I have designed classic alv using SALV_WD_TABLE component. I want a good GRID Display, not like flat field names that comes in list display, looking for bulged fields(like what comes for ALV GRID in normal abap)  display with print version etc hidden and buttons at the top of ALV.  Kindly help
    Highly rewarded
    Kindly help
    Regards,
    Lakshmi
    Edited by: Lakshmi Menon on Nov 27, 2008 4:49 PM

    Well Web Dynpro is generally output in HTML so the output formatting is never going to quite look like a desktop application (which is the case with the ALV Grid).  You have very little control over the look of the column headers.  In fact you can only manipulate what is available via the Portal Theme. 
    There is a new Tradeshow Plus theme available in NetWeaver 7.01 which uses a gradiant background for the column headers.  This gives them a little more depth:
    http://www.flickr.com/photos/tjung/3068850120/
    The other option is next year when NetWeaver Business Client version 3.0 comes out, you will be able to render Web Dynpro applications using the NWBC Smart Client Rendering.  This will render Web Dynpro applications using desktop libraries instead of HTML/Browser. This gives Web Dynpro a more SAPGUI/Desktop appears of course.
    http://www.flickr.com/photos/tjung/2685619882/in/set-72157606418550143/

  • How to get f4 help in alv grid in container-urgent

    hi,
    how to get f4 help in alv grid in container using abap objects
    ganesh

    Hi Ganesh,
    Did you have a look at sample report BCALV_TEST_GRID_F4_HELP ?
    Here is part of the header documentation:
    *& Report  BCALV_GRID_F4_HELP                                          *
    Purpose:
    ~~~~~~~~
    This report illustrates the use of f4-Help in an alv grid control.
    Background:
    ~~~~~~~~~~~
    There a two possibilities to implement an f4-Help in the alv grid
    control: one can either use standard f4-help or write one by Hand.
    For the former there is nothing to do at all. This report shows how
    to implement user-defined f4-help.
    I am sure you will find within this report the solution you are looking for.
    Reward points if this Helps.
    Manish

  • Problem with ALV Grid Display screen Back Button

    Dear Friends ,
    I have an ALV Grid Display,Here am facing a problem for my 'Back' button,i haven't defined any PF Status and is using the standard one.But after the Display when i press Back Button a blank Screen is appearing n then again i have to press back button to go to my Selection Screen.
    Please Suggest if i have to take care of something else.
    I want my Selection Screen when i press Back on my Display Screen.
    DATA:  IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
             I_BYPASSING_BUFFER          =
             I_BUFFER_ACTIVE             =
             I_INTERFACE_CHECK           = ' '
                 I_CALLBACK_PROGRAM          = 'ZRMMPD01A'
             I_CALLBACK_PF_STATUS_SET    = ' '
             I_CALLBACK_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                     =  I_LAYOUT
               IT_FIELDCAT                 =  IT_FIELDCAT
             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
        IMPORTING
             E_EXIT_CAUSED_BY_CALLER     =
             ES_EXIT_CAUSED_BY_USER      =
             TABLES
                  T_OUTTAB                    = IT_FINAL
            EXCEPTIONS
                 PROGRAM_ERROR               = 1
                 OTHERS                      = 2
    Thanks and Regards,
    Ashwini

    Hi Vijay ,
    No i dont have any write statement in my proggram.
    Here it is
    REPORT ZRMMPD01A  NO STANDARD PAGE HEADING.
    TABLES : EQUI,SER03,MKPF,OBJK.
    TYPE-POOLS : SLIS.
    DATA  IT_EQUI LIKE EQUI OCCURS 0 WITH HEADER LINE.
    DATA  IT_OBJK LIKE OBJK OCCURS 0 WITH HEADER LINE..
    DATA  IT_SER03 LIKE SER03 OCCURS 0 WITH HEADER LINE.
    DATA  IT_MKPF LIKE MKPF OCCURS 0 WITH HEADER LINE .
    DATA : BEGIN OF IT_DISPLAY OCCURS 0,
                MATNR LIKE EQUI-MATNR,
                SERNR LIKE EQUI-SERNR,
                BWART LIKE SER03-BWART,
                WERK LIKE SER03-WERK,
                CHARGE LIKE SER03-CHARGE,
                LAGERORT LIKE SER03-LAGERORT,
                MBLNR LIKE SER03-MBLNR,
                MJAHR LIKE SER03-MJAHR,
                ZEILE LIKE SER03-ZEILE,
                BUDAT LIKE MKPF-BUDAT,
                BKTXT LIKE MKPF-BKTXT,
                USNAM LIKE MKPF-USNAM,
                XBLNR LIKE MKPF-XBLNR,
            END OF IT_DISPLAY.
    DATA : WA_DISPLAY LIKE IT_DISPLAY.
    DATA  IT_FINAL LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
    DATA  IT_TEMP LIKE IT_DISPLAY OCCURS 0 WITH HEADER LINE.
    DATA:  IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA :I_LAYOUT TYPE SLIS_LAYOUT_ALV,
          I_EVENTS TYPE SLIS_T_EVENT.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_MATNR FOR EQUI-MATNR MATCHCODE OBJECT MCD,"OBLIGATORY
                    S_SERNR FOR EQUI-SERNR, "MATCHCODE OBJECT MCD OBLIGATORY
                    S_MBLNR FOR SER03-MBLNR MATCHCODE OBJECT MCD,
                    S_BWART FOR SER03-BWART MATCHCODE OBJECT MCD,
                    S_WERK FOR SER03-WERK MATCHCODE OBJECT MCD,
                    S_LAGET FOR SER03-LAGERORT MATCHCODE OBJECT MCD,
                    S_BUDAT FOR MKPF-BUDAT MATCHCODE OBJECT MCD,
                    S_XBLNR FOR MKPF-XBLNR MATCHCODE OBJECT MCD.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X',
                 R2 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B2.
    START-OF-SELECTION.
    *Fetch Data.
      PERFORM GET_DATA.
    *Fill Display Fields.
      PERFORM FILL_TABLE.
    *Segregate data according to radio button selection.
      PERFORM SELECT_CONDITION.
    *Fill The Feild catalog.
      PERFORM FIELD_CATALOG.
    *Display Output.
      PERFORM OUTPUT_DISPLAY..
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA.
      SELECT * FROM EQUI INTO TABLE IT_EQUI
        WHERE MATNR IN S_MATNR
        AND SERNR IN S_SERNR.
      SELECT * FROM OBJK INTO TABLE IT_OBJK
      FOR ALL ENTRIES IN IT_EQUI
      WHERE EQUNR = IT_EQUI-EQUNR.
      SELECT * FROM SER03 INTO TABLE IT_SER03
      FOR ALL ENTRIES IN IT_OBJK
      WHERE OBKNR = IT_OBJK-OBKNR
      AND MBLNR IN S_MBLNR
      AND BWART IN S_BWART
      AND WERK IN S_WERK
      AND LAGERORT IN S_LAGET.
      SELECT * FROM MKPF INTO TABLE IT_MKPF
      FOR ALL ENTRIES IN IT_SER03
      WHERE MBLNR = IT_SER03-MBLNR
      AND BUDAT IN S_BUDAT
      AND XBLNR IN S_XBLNR.
    ENDFORM.                    " GET_DATA
    *&      Form  FILL_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_TABLE.
      LOOP AT IT_EQUI.
        LOOP AT IT_OBJK.
          IF IT_OBJK-EQUNR <> IT_EQUI-EQUNR.
            SKIP.
          ELSE.
            READ TABLE IT_SER03 WITH KEY OBKNR = IT_OBJK-OBKNR.
            IF SY-SUBRC = 0.
              WA_DISPLAY-MATNR = IT_EQUI-MATNR.
              WA_DISPLAY-SERNR = IT_EQUI-SERNR.
              WA_DISPLAY-BWART = IT_SER03-BWART.
              WA_DISPLAY-WERK = IT_SER03-WERK.
              WA_DISPLAY-CHARGE = IT_SER03-CHARGE.
              WA_DISPLAY-LAGERORT = IT_SER03-LAGERORT.
              WA_DISPLAY-MBLNR = IT_SER03-MBLNR.
              WA_DISPLAY-MJAHR = IT_SER03-MJAHR.
              WA_DISPLAY-ZEILE = IT_SER03-ZEILE.
             READ TABLE IT_MKPF WITH KEY MBLNR = IT_SER03-MBLNR.
              IF SY-SUBRC = 0.
                WA_DISPLAY-BUDAT = IT_MKPF-BUDAT.
                WA_DISPLAY-BKTXT = IT_MKPF-BKTXT.
                WA_DISPLAY-USNAM = IT_MKPF-USNAM.
                WA_DISPLAY-XBLNR = IT_MKPF-XBLNR.
              ENDIF.
            ENDIF.
          ENDIF.
          IF NOT WA_DISPLAY IS INITIAL.
            APPEND WA_DISPLAY TO IT_DISPLAY.
            CLEAR WA_DISPLAY.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " FILL_TABLE
    *&      Form  FIELD_CATALOG
          text
    -->  p1        text
    <--  p2        text
    FORM FIELD_CATALOG.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'MATNR'.
      FIELDCAT-SELTEXT_M = 'Material Number'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'SERNR'.
      FIELDCAT-SELTEXT_M = 'Serial number'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'MBLNR'.
      FIELDCAT-SELTEXT_L = 'Number of material document'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'BWART'.
      FIELDCAT-SELTEXT_M = 'Movement type'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'WERK'.
      FIELDCAT-SELTEXT_M = 'Plant'.
      FIELDCAT-OUTPUTLEN =  5.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'CHARGE'.
      FIELDCAT-SELTEXT_M = 'Batch number'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'LAGERORT'.
      FIELDCAT-SELTEXT_M = 'Storage Location'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'MJAHR'.
      FIELDCAT-SELTEXT_M = 'Material doc. year'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'ZEILE'.
      FIELDCAT-SELTEXT_L = 'Item in material document'.
      FIELDCAT-OUTPUTLEN =  18.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'BUDAT'.
      FIELDCAT-SELTEXT_L = 'Posting date in the document'.
      FIELDCAT-OUTPUTLEN =  10.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'BKTXT'.
      FIELDCAT-SELTEXT_L = 'Document header text'.
      FIELDCAT-OUTPUTLEN =  25.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'USNAM'.
      FIELDCAT-SELTEXT_M = 'User name'.
      FIELDCAT-OUTPUTLEN =  15.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME = 'IT_DISPLAY'.
      FIELDCAT-FIELDNAME = 'XBLNR'.
      FIELDCAT-SELTEXT_L = 'Reference document number'.
      FIELDCAT-OUTPUTLEN =  25.
      APPEND FIELDCAT TO IT_FIELDCAT.
      CLEAR FIELDCAT.
    ENDFORM.                    " FIELD_CATALOG
    *&      Form  DISPLAY_OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM OUTPUT_DISPLAY.
      IF R1 = 'X'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
              I_CALLBACK_PROGRAM          = 'ZRMMPD01A'
              IS_LAYOUT                   =  I_LAYOUT
              IT_FIELDCAT                 = IT_FIELDCAT
          TABLES
              T_OUTTAB                    = IT_DISPLAY
            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.
        REFRESH IT_DISPLAY.
        CLEAR IT_DISPLAY.
      ELSEIF R2 = 'X'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
                 I_CALLBACK_PROGRAM          = 'ZRMMPD01A'
                 IS_LAYOUT                     =  I_LAYOUT
                 IT_FIELDCAT                 =  IT_FIELDCAT
             TABLES
                  T_OUTTAB                    = IT_FINAL
            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.
        REFRESH IT_DISPLAY.
        CLEAR IT_DISPLAY.
      ENDIF.
    ENDFORM.                    " DISPLAY_OUTPUT
    *&      Form  SELECT_CONDITION
          text
    -->  p1        text
    <--  p2        text
    FORM SELECT_CONDITION.
      IF R2 = 'X'.
        CLEAR WA_DISPLAY.
        SORT IT_DISPLAY BY MATNR SERNR MBLNR ZEILE.
        DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
        LOOP AT IT_DISPLAY WHERE ZEILE = '0002'.
          READ TABLE IT_DISPLAY WITH KEY MATNR = IT_DISPLAY-MATNR
          SERNR = IT_DISPLAY-SERNR ZEILE = '0001'.
          IF SY-SUBRC = 0.
            DELETE IT_DISPLAY.
          ENDIF.
        ENDLOOP.
        SORT IT_DISPLAY BY MATNR SERNR BWART MBLNR.
        DELETE ADJACENT DUPLICATES FROM IT_DISPLAY.
        LOOP AT IT_DISPLAY.
          IF WA_DISPLAY IS INITIAL.
            WA_DISPLAY =  IT_DISPLAY.
          ENDIF.
          LOOP AT IT_DISPLAY WHERE MATNR = WA_DISPLAY-MATNR
          AND SERNR = WA_DISPLAY-SERNR.
            IF IT_DISPLAY-BUDAT > WA_DISPLAY-BUDAT.
              WA_DISPLAY = IT_DISPLAY.
            ELSE.
              DELETE IT_DISPLAY.
            ENDIF.
          ENDLOOP.
          APPEND WA_DISPLAY TO IT_TEMP.
          CLEAR WA_DISPLAY.
        ENDLOOP.
        DELETE ADJACENT DUPLICATES FROM IT_TEMP.
        IF NOT IT_TEMP[] IS INITIAL.
          IT_FINAL[] = IT_TEMP[].
        ENDIF.
      ENDIF.
    ENDFORM.                    " SELECT_CONDITION
    Regards,
    Ashwini

  • ALV GRID Display Column Width problem when filtering

    Hello All,
       When i displaying ALV Grid Display ,i selected one column and set filter for that.
    the problem is column width at display is 12 charecters but in filter it is allowing only 10 charecters to enter which is wrong. i am unable to set filter.please give solution.
    Thanks
    Sandeep.G

    hello i am calling perform, ineed to set OUTPUTLEN according to field length how can i do that.
    FORM fill_fieldcat  USING  p_field TYPE slis_fieldcat_alv-fieldname
                               p_text  TYPE slis_fieldcat_alv-seltext_l
                               p_flag TYPE c.
      wa_fieldcat-fieldname    = p_field.
      wa_fieldcat-seltext_l    = p_text.
      wa_fieldcat-no_out  = p_flag.
       wa_fieldcat-outputlen = 20.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.

  • ALV GRID DISPLAY -Problem with Layout

    Hi,
    I'm using ALV GRID DISPLAY. I ran the program and in the output i created a layout Test1.Later i created a layout Test2. Now when i run the report, when i select layout Test1, the display is not as selected for the layout. but when i manualy select the layout throu change layout-->Test1, the display is working good. Can someone tell me what the problem can be?
    Thanks
    Challa

    hi,
    in the FM have you filled the structure IS_VARIANT.
    is_variant-report = sy-repid.
    is_variant-variant = <variant name>.
    Regards,
    Leo

  • Problem with check box in ALV Grid Display

    I am Displaying Material Master Data in ALV Grid Display with Check Box for each record and if i checked check box then i am processing Update operation in Database,  my question is after perform update operation check box should be clear.
    Kindly help me!!!!

    Hello Raj
    Given the fact that you do not tell us the most important piece of information (namely whether you are using OO-based ALV or not) I assume you are using fm-based ALV lists.
    In this case you probably have defined a USER_COMMAND routine as described in the documentation of the fm.
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
    * define local data
      DATA: ls_outtab  LIKE LINE OF gt_outtab,
                ld_idx       TYPE i.
      LOOP AT gt_outtab INTO ls_outtab
                     WHERE ( chkbox = 'X' ).
        ld_idx = syst-tabix.
        " Call your update function / method / perform
       ls_outtab-chkbox = space.
       MODIFY gt_outtab FROM ls_outtab INDEX ld_Idx
          TRANSPORTING chkbox.
      ENDLOOP.
    " And now trigger refresh of the ALV display:
      rs_selfield-refresh = 'X'.  " <<< !!!
    ENDFORM.
    Regards
      Uwe

  • F4 Help in ALV GRID class based

    hi
    you have any idea about how to invoke the F4 help in ALV GRID Class based program.,
    if u have any other related document or program using F4 function in ALV GRId please send to me for reference
    Thanks & Regards
    K.G

    hi for what kind of fields you need to give f4.
    are they std or custom...
    please let me know about the fields..
    try to check my logic which i gave in the below post..
    it will give f4 help to the fields(if thet are standard table fieldS)
    Message was edited by: Vijay Babu Dudla

Maybe you are looking for

  • Installing Additional Domain Controller in different Network

    Hi All, We are planning to add ADC on existing domain but before start I want to confirm that can I install ADC on different network range as follows: Windows Server 2008 Enterprise SP2 Platform HODOMAIN.com  IP is: 192.168.2.11 Branch network New AD

  • Officejet 7000 wide format

    Please can someone help me -before I get carted off to the funny farm! I recently bought a 7000 wide format and as I live in Spain, I had it sent out from Amazon to me.  No problem there - I installed it and started to print.  I was well pleased.....

  • How do I get my tones back?

    I bought two ringtones and they won't show in my tones.. How do I get them back? I paid for them so it isn't fair.

  • Application level class paths AS2 vs AS3

    Hi, I've been messing around with my preferences trying to make some external classes available to any new FLA I make. At first I couldn't get it working, but then I realized I was using the wrong location. I was setting the path for my Actionscript

  • How do I create a sparkle or flare effect?

    I have a client that would like a sparkle to come of his teeth sort of like a Mr. Clean ad. Just a brief little sparkle sort of thing with a little twisting action would be perfect. Any suggestions?