2007 Jan 31 9:40 AM
2007 Jan 31 9:43 AM
Hi,
You need to create a custom control in the screen and then use this customer control to create custom container object then pass this container object to in the grid instantiation.
see the below code.
CREATE OBJECT lr_container
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT lr_alv
EXPORTING
i_parent = lr_container.
Regards,
Sesh
2007 Jan 31 9:43 AM
Hi,
You need to create a custom control in the screen and then use this customer control to create custom container object then pass this container object to in the grid instantiation.
see the below code.
CREATE OBJECT lr_container
EXPORTING
container_name = 'CONTAINER'.
CREATE OBJECT lr_alv
EXPORTING
i_parent = lr_container.
Regards,
Sesh
2007 Jan 31 9:43 AM
2007 Jan 31 11:05 AM
Hi,
In the screen layout,make a custom container (Icon with C ) and name it in Capital letters as <b>CONTAINER</b>.The code below in bold letters is what exactly you want.I ve given a small example on how to use ALV:
REPORT SAMPLE.
<b>DATA: alv type ref to cl_gui_alv_GRID,
cont type ref to cl_gui_custom_container,</b>
itab_spfli type table of spfli.
START-OF-SELECTION.
select * from spfli into table itab_spfli.
call screen 100.
END-OF-SELECTION.
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE STATUS_0100 OUTPUT.
seT PF-STATUS 'GUI'.
SET TITLEBAR 'xxx'.
<b>if cont is initial.
CREATE OBJECT cont
EXPORTING
CONTAINER_NAME = 'CONTAINER'.
CREATE OBJECT ALV
EXPORTING
I_PARENT = CONT.</b>
CALL METHOD ALV->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'SPFLI'
CHANGING
IT_OUTTAB = itab_spfli
Regards,
Beejal
**Reward if this helps