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

Reg..ALV using classes

Former Member
0 Likes
301

i have displayed a ALV report with a push button 'HST'.

When i select a particular line(vbeln) and click on pushbutton 'HST' it has to display me a interactive report based on the condition vbeln and posnr.

can anyone help me with the detail code using classes..

answers will be rewarded....

regards,

kumar

1 REPLY 1
Read only

Former Member
0 Likes
273

Hi,

Class ALV Specification

Classes used:

CL_GUI_ALV_GRID

Example of ALV using Classes

DATA: lcl_alv TYPE REF TO cl_gui_alv_grid,

t_flights TYPE STANDARD TABLE OF FLIGHTS.

SELECT * FROM flights INTO TABLE t_flights.

CREATE OBJECT lcl_alv

EXPORTING I_PARENT = cl_gui_container=>screen0.

CALL METHOD lcl_alv->set_table_for_first_display

EXPORTING

I_STRUCTURE_NAME = 'FLIGHTS'

CHANGING

IT_OUTTAB = t_flights.

CALL SCREEN 100.

Example Details

This is a simple example of the class ALV, we do not need to create, in this case, a field catalog because we are using the whole table of FLIGHTS and we will show all the fields that this table contains, we do this at the I_STRUCTURE_NAME = 'FLIGHTS' statement.

The CL_GUI_ALV_GRID constructor needs the I_PARENT parameter to define where it will be show, in the example we set the entire screen to place the ALV.

reward if helpful