Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Table is not getting displayed by using set_table_for_first_display

0 Likes
2,095

Hi All,

I am creating one simple alv output using oops concept.But not getting the table as output.Please find the below code and help me in finding the solution.

SPAN { font-family: "Courier New"; font-size: 10pt; color: #000000; background: #FFFFFF; } .L0S31 { font-style: italic; color: #808080; } .L0S32 { color: #3399FF; } .L0S33 { color: #4DA619; } .L0S52 { color: #0000FF; } .L0S55 { color: #800080; } .L0S70 { color: #808080; }

REPORT ztest_local_class.


TYPES:BEGIN OF ty_emp,
pernr TYPE persno,
endda TYPE endda,
begda TYPE begda,
nachn TYPE pad_nachn,
vorna TYPE pad_vorna,
END OF ty_emp.

TYPES:BEGIN OF ty_child,
pernr TYPE persno,
subty TYPE subty,
objps TYPE objps,
favor TYPE pad_vorna,
fanam TYPE pad_nachn,
fgbld TYPE gblnd,
END OF ty_child.

DATA:it_emp TYPE STANDARD TABLE OF ty_emp,
wa_emp TYPE ty_emp,
it_child TYPE STANDARD TABLE OF ty_child,
wa_child TYPE ty_child,
gt_grid TYPE REF TO cl_gui_alv_grid,
gt_container TYPE REF TO cl_gui_custom_container,
gt_fcat TYPE lvc_t_fcat,
gw_fcat TYPE lvc_s_fcat.

PARAMETERS: p_pernr TYPE persno.

*----------------------------------------------------------------------*
* CLASS emp_data DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS emp_data DEFINITION.

PUBLIC SECTION.
* DATA:lw_text(30) VALUE 'ABAP LOCAL CLASS'.
METHODS: alv_display.
ENDCLASS. "emp_data DEFINITION

*----------------------------------------------------------------------*
* CLASS emp_data IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS emp_data IMPLEMENTATION.
METHOD alv_display.

SELECT pernr begda endda nachn vorna FROM pa0002
INTO TABLE it_emp WHERE pernr = p_pernr.
IF sy-subrc = 0.
SELECT pernr subty objps favor fanam fgbld FROM pa0021
INTO TABLE it_child FOR ALL ENTRIES IN it_emp
WHERE pernr = it_emp-pernr
AND subty = '2'.

ENDIF.

IF gt_grid IS INITIAL.
CREATE OBJECT gt_container
EXPORTING
* parent =
container_name ='CONTAINER'
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 gt_grid
EXPORTING
i_parent = gt_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.

PERFORM build_fieldcat.

CALL METHOD gt_grid->set_table_for_first_display
EXPORTING
* i_buffer_active =
* i_bypassing_buffer =
* i_consistency_check =
i_structure_name = 'TY_CHILD'
CHANGING
it_outtab = it_child[]
it_fieldcatalog = gt_fcat
* 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.

ELSEIF gt_grid IS NOT INITIAL.

CALL METHOD gt_grid->refresh_table_display
* EXPORTING
* is_stable =
* i_soft_refresh =
EXCEPTIONS
finished = 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.

ENDIF.

ENDMETHOD. "display
ENDCLASS. "emp_data IMPLEMENTATION

START-OF-SELECTION.

DATA: emp_ref TYPE REF TO emp_data.
CREATE OBJECT: emp_ref.
CALL METHOD: emp_ref->alv_display.
*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM build_fieldcat .

CLEAR gw_fcat.
gw_fcat-row_pos = 1.
gw_fcat-col_pos = 1.
gw_fcat-fieldname = 'PERNR'.
gw_fcat-tabname = 'IT_CHILD'.
gw_fcat-coltext = 'PERNR'.
* gw_fcat-outputlen = 10.
APPEND gw_fcat TO gt_fcat.

CLEAR gw_fcat.
gw_fcat-row_pos = 1.
gw_fcat-col_pos = 2.
gw_fcat-fieldname = 'SUBTY'.
gw_fcat-tabname = 'IT_CHILD'.
gw_fcat-coltext = 'SUBTY'.
* gw_fcat-outputlen = 10.
APPEND gw_fcat TO gt_fcat.

CLEAR gw_fcat.
gw_fcat-row_pos = 1.
gw_fcat-col_pos = 3.
gw_fcat-fieldname = 'OBJPS'.
gw_fcat-tabname = 'IT_CHILD'.
gw_fcat-coltext = 'OBJPS'.
* gw_fcat-outputlen = 10.
APPEND gw_fcat TO gt_fcat.

CLEAR gw_fcat.
gw_fcat-row_pos = 1.
gw_fcat-col_pos = 4.
gw_fcat-fieldname = 'FAVOR'.
gw_fcat-tabname = 'IT_CHILD'.
gw_fcat-coltext = 'FAVOR'.
* gw_fcat-outputlen = 10.
APPEND gw_fcat TO gt_fcat.

CLEAR gw_fcat.
gw_fcat-row_pos = 1.
gw_fcat-col_pos = 5.
gw_fcat-fieldname = 'FANAM'.
gw_fcat-tabname = 'IT_CHILD'.
gw_fcat-coltext = 'FANAM'.
* gw_fcat-outputlen = 10.
APPEND gw_fcat TO gt_fcat.

CLEAR gw_fcat.
gw_fcat-row_pos = 1.
gw_fcat-col_pos = 6.
gw_fcat-fieldname = 'FGBLD'.
gw_fcat-tabname = 'IT_CHILD'.
gw_fcat-coltext = 'FGBLD'.
* gw_fcat-outputlen = 10.
APPEND gw_fcat TO gt_fcat.


ENDFORM. " BUILD_FIELDCAT

1 ACCEPTED SOLUTION
Read only

Former Member
1,878

Hi Rajashree,

  1. You need a screen (100 for example) with a container named "Container". In PBO of the screen you need call the method alv_display of your local class.
  2. If you use local class you should have a method to create fieldcatalog instead of using subroutine.
  3. You should work on the naming of your variables

Here is a working sample of your code:

TYPES:BEGIN OF ty_emp,
        pernr TYPE persno,
        endda TYPE endda,
        begda TYPE begda,
        nachn TYPE pad_nachn,
        vorna TYPE pad_vorna,
      END OF ty_emp.
TYPES:BEGIN OF ty_child,
        pernr TYPE persno,
        subty TYPE subty,
        objps TYPE objps,
        favor TYPE pad_vorna,
        fanam TYPE pad_nachn,
        fgbld TYPE gblnd,
      END OF ty_child.

DATA:it_emp       TYPE STANDARD TABLE OF ty_emp,
     wa_emp       TYPE ty_emp,
     it_child     TYPE STANDARD TABLE OF ty_child,
     wa_child     TYPE ty_child,
     gt_grid      TYPE REF TO cl_gui_alv_grid,
     gt_container TYPE REF TO cl_gui_custom_container,
     gt_fcat      TYPE lvc_t_fcat,
     gw_fcat      TYPE lvc_s_fcat.

PARAMETERS: p_pernr TYPE persno.

*----------------------------------------------------------------------*
* CLASS emp_data DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS emp_data DEFINITION.
  PUBLIC SECTION.
* DATA:lw_text(30) VALUE 'ABAP LOCAL CLASS'.
    METHODS: alv_display.
ENDCLASS. "emp_data DEFINITION

*----------------------------------------------------------------------*
* CLASS emp_data IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS emp_data IMPLEMENTATION.
  METHOD alv_display.
    SELECT pernr begda endda nachn vorna FROM pa0002
    INTO TABLE it_emp WHERE pernr = p_pernr.
    IF sy-subrc = 0.
      SELECT pernr subty objps favor fanam fgbld FROM pa0021
      INTO TABLE it_child FOR ALL ENTRIES IN it_emp
      WHERE pernr = it_emp-pernr
      AND subty = '2'.
    ENDIF.

    IF gt_grid IS INITIAL.
      CREATE OBJECT gt_container
        EXPORTING
*         parent                      =
          container_name              = 'CONTAINER'
        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 gt_grid
        EXPORTING
          i_parent          = gt_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.

      PERFORM build_fieldcat.
      CALL METHOD gt_grid->set_table_for_first_display
        EXPORTING
*         i_buffer_active               =
*         i_bypassing_buffer            =
*         i_consistency_check           =
          i_structure_name              = 'TY_CHILD'
        CHANGING
          it_outtab                     = it_child[]
          it_fieldcatalog               = gt_fcat
*         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.
    ELSEIF gt_grid IS NOT INITIAL.
      CALL METHOD gt_grid->refresh_table_display
* EXPORTING
* is_stable =
* i_soft_refresh =
        EXCEPTIONS
          finished = 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.
    ENDIF.
  ENDMETHOD. "display
ENDCLASS. "emp_data IMPLEMENTATION

START-OF-SELECTION.
  DATA: emp_ref TYPE REF TO emp_data.
  CREATE OBJECT: emp_ref.

END-OF-SELECTION.
  CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM build_fieldcat .
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 1.
  gw_fcat-fieldname = 'PERNR'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'PERNR'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 2.
  gw_fcat-fieldname = 'SUBTY'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'SUBTY'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 3.
  gw_fcat-fieldname = 'OBJPS'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'OBJPS'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 4.
  gw_fcat-fieldname = 'FAVOR'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'FAVOR'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 5.
  gw_fcat-fieldname = 'FANAM'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'FANAM'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 6.
  gw_fcat-fieldname = 'FGBLD'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'FGBLD'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
ENDFORM. " BUILD_FIELDCAT

*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS '0100'.
  SET TITLEBAR '0100'.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
  CASE sy-ucomm.
    WHEN 'BACK' OR 'CANC' OR 'EXIT'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  ALV_DISPLAY  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE alv_display OUTPUT.
  CALL METHOD: emp_ref->alv_display.
ENDMODULE.

Here is flow logic of screen 100:

PROCESS BEFORE OUTPUT.
  MODULE alv_display.
  MODULE status_0100.
*
PROCESS AFTER INPUT.
  MODULE user_command_0100.

You need also the following status:

Greetings
Stephan

5 REPLIES 5
Read only

Former Member
1,879

Hi Rajashree,

  1. You need a screen (100 for example) with a container named "Container". In PBO of the screen you need call the method alv_display of your local class.
  2. If you use local class you should have a method to create fieldcatalog instead of using subroutine.
  3. You should work on the naming of your variables

Here is a working sample of your code:

TYPES:BEGIN OF ty_emp,
        pernr TYPE persno,
        endda TYPE endda,
        begda TYPE begda,
        nachn TYPE pad_nachn,
        vorna TYPE pad_vorna,
      END OF ty_emp.
TYPES:BEGIN OF ty_child,
        pernr TYPE persno,
        subty TYPE subty,
        objps TYPE objps,
        favor TYPE pad_vorna,
        fanam TYPE pad_nachn,
        fgbld TYPE gblnd,
      END OF ty_child.

DATA:it_emp       TYPE STANDARD TABLE OF ty_emp,
     wa_emp       TYPE ty_emp,
     it_child     TYPE STANDARD TABLE OF ty_child,
     wa_child     TYPE ty_child,
     gt_grid      TYPE REF TO cl_gui_alv_grid,
     gt_container TYPE REF TO cl_gui_custom_container,
     gt_fcat      TYPE lvc_t_fcat,
     gw_fcat      TYPE lvc_s_fcat.

PARAMETERS: p_pernr TYPE persno.

*----------------------------------------------------------------------*
* CLASS emp_data DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS emp_data DEFINITION.
  PUBLIC SECTION.
* DATA:lw_text(30) VALUE 'ABAP LOCAL CLASS'.
    METHODS: alv_display.
ENDCLASS. "emp_data DEFINITION

*----------------------------------------------------------------------*
* CLASS emp_data IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS emp_data IMPLEMENTATION.
  METHOD alv_display.
    SELECT pernr begda endda nachn vorna FROM pa0002
    INTO TABLE it_emp WHERE pernr = p_pernr.
    IF sy-subrc = 0.
      SELECT pernr subty objps favor fanam fgbld FROM pa0021
      INTO TABLE it_child FOR ALL ENTRIES IN it_emp
      WHERE pernr = it_emp-pernr
      AND subty = '2'.
    ENDIF.

    IF gt_grid IS INITIAL.
      CREATE OBJECT gt_container
        EXPORTING
*         parent                      =
          container_name              = 'CONTAINER'
        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 gt_grid
        EXPORTING
          i_parent          = gt_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.

      PERFORM build_fieldcat.
      CALL METHOD gt_grid->set_table_for_first_display
        EXPORTING
*         i_buffer_active               =
*         i_bypassing_buffer            =
*         i_consistency_check           =
          i_structure_name              = 'TY_CHILD'
        CHANGING
          it_outtab                     = it_child[]
          it_fieldcatalog               = gt_fcat
*         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.
    ELSEIF gt_grid IS NOT INITIAL.
      CALL METHOD gt_grid->refresh_table_display
* EXPORTING
* is_stable =
* i_soft_refresh =
        EXCEPTIONS
          finished = 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.
    ENDIF.
  ENDMETHOD. "display
ENDCLASS. "emp_data IMPLEMENTATION

START-OF-SELECTION.
  DATA: emp_ref TYPE REF TO emp_data.
  CREATE OBJECT: emp_ref.

END-OF-SELECTION.
  CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCAT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM build_fieldcat .
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 1.
  gw_fcat-fieldname = 'PERNR'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'PERNR'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 2.
  gw_fcat-fieldname = 'SUBTY'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'SUBTY'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 3.
  gw_fcat-fieldname = 'OBJPS'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'OBJPS'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 4.
  gw_fcat-fieldname = 'FAVOR'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'FAVOR'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 5.
  gw_fcat-fieldname = 'FANAM'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'FANAM'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
  CLEAR gw_fcat.
  gw_fcat-row_pos = 1.
  gw_fcat-col_pos = 6.
  gw_fcat-fieldname = 'FGBLD'.
  gw_fcat-tabname = 'IT_CHILD'.
  gw_fcat-coltext = 'FGBLD'.
* gw_fcat-outputlen = 10.
  APPEND gw_fcat TO gt_fcat.
ENDFORM. " BUILD_FIELDCAT

*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS '0100'.
  SET TITLEBAR '0100'.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
  CASE sy-ucomm.
    WHEN 'BACK' OR 'CANC' OR 'EXIT'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.
*&---------------------------------------------------------------------*
*&      Module  ALV_DISPLAY  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE alv_display OUTPUT.
  CALL METHOD: emp_ref->alv_display.
ENDMODULE.

Here is flow logic of screen 100:

PROCESS BEFORE OUTPUT.
  MODULE alv_display.
  MODULE status_0100.
*
PROCESS AFTER INPUT.
  MODULE user_command_0100.

You need also the following status:

Greetings
Stephan

Read only

srikanthnalluri
Active Participant
1,878

Perhaps you can use CL_SALV_TABLE to display a report.

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,878

Check BCALV_GRID_DEMO for reference or search BC*ALV* in SE38 for the examples and valdiate it with what you have coded.

Nabheet

Read only

0 Likes
1,878

Thanks Nabheet ..Surely will check ..

Read only

0 Likes
1,878

Problem solved..Everything was right ..I had not place the custom control in the layout screen.Now its working .. Thanks all of you ..