Application Development 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: 

Create simple ALV using Classes

Former Member
0 Kudos

hi all,

How to create a ALV report using Classes....?

any links or feedback will be appreciated.

Thanks in Advance.

5 REPLIES 5

former_member188685
Active Contributor
0 Kudos

Check this Sample code using Docking container. In case of docking container no need of custom container required on screen.

REPORT  ztest_oo_a.
 
DATA: it_flight TYPE sflight_tab1.
DATA: dock TYPE REF TO cl_gui_docking_container,
      grid TYPE REF TO cl_gui_alv_grid.
 

SELECT *
  FROM sflight
  INTO TABLE it_flight
  UP TO 20 ROWS.
 
CALL SCREEN 100.
 
*&---------------------------------------------------------------------*
*&      Module  STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
  SET PF-STATUS 'SATR'.
 
 
  CREATE OBJECT dock
    EXPORTING
      repid     = sy-repid
      dynnr     = '100'
      extension = '1500'
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5
      OTHERS                      = 6
      .
  IF sy-subrc ne  0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  CREATE OBJECT grid EXPORTING i_parent = dock.
 
  CALL METHOD grid->set_table_for_first_display
    EXPORTING
      i_structure_name              = 'SFLIGHT'
    CHANGING
      it_outtab                     = it_flight
    EXCEPTIONS
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      OTHERS                        = 4.
  IF sy-subrc ne 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
 
ENDMODULE.                 " STATUS_0100  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
 
  CASE sy-ucomm.
 
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
 
ENDMODULE.                 " USER_COMMAND_0100  INPUT

Flow Logic

PROCESS BEFORE OUTPUT.
 MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
 MODULE USER_COMMAND_0100.

Former Member
0 Kudos

Hi,

take a look at report SALV_DEMO_TABLE_REAL_SIMPLE.

Regards Rudi

uwe_schieferstein
Active Contributor
0 Kudos

Hello Saurabh

You may search for my sample reports (beginning with ZUS_SDN_... ) e.g. in

Regards

Uwe

Former Member
0 Kudos

Hi,

Goto SE80 and package 'SLIS'

and check the programs with 'BCAL*'

All the programs are example of ALV using classes.

Regards

Manjari.

former_member181995
Active Contributor