2012 Jan 28 7:50 AM
Dear,
I am creating alv by oops method. I have created Container in screen. My problem is on some laptop due to less screen size of laptop compare to desktop PC i am getting double scroll. Is there any way or object by which my container can automatically fit into user screen.
Thanx
Anuj Modi
2012 Jan 28 12:07 PM
Hi Anuj,
use the below code:
CREATE OBJECT alv_grid
EXPORTING
i_parent = CL_GUI_CONTAINER=>DEFAULT_SCREEN. "<--- use this instead of your custom container
you'll get your alv in full screen regardless of resolution
2012 Jan 28 12:07 PM
Hi Anuj,
use the below code:
CREATE OBJECT alv_grid
EXPORTING
i_parent = CL_GUI_CONTAINER=>DEFAULT_SCREEN. "<--- use this instead of your custom container
you'll get your alv in full screen regardless of resolution
2012 Jan 30 2:23 AM
Dear,
I am using below code:
CREATE OBJECT c_ccont
EXPORTING
container_name = 'CONT'.
CREATE OBJECT o_dyndoc_id
EXPORTING
style = 'ALV_GRID'.
CREATE OBJECT o_splitter
EXPORTING
parent = c_ccont
rows = 2
columns = 1.
CALL METHOD o_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = o_parent_top.
CALL METHOD o_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = o_parent_grid.
Set height for g_parent_html
CALL METHOD o_splitter->set_row_height
EXPORTING
id = 1
height = 14.
create object for alv grid
CREATE OBJECT c_alvgd
EXPORTING
i_parent = o_parent_grid.
CREATE OBJECT g_handler.
SET HANDLER g_handler->top_of_page FOR c_alvgd.
SET HANDLER g_handler->print_top_of_page FOR c_alvgd.
My some Issue are
1. Now i need to call screen or not?
2. How will split my container for top of page?
Thanx.
2012 Jan 30 12:05 PM
Hi Anuj,
Yes you need to create a screen, but dont use a container in that:
can you try changing this call :
CREATE OBJECT o_splitter
EXPORTING
parent = c_ccont
rows = 2
columns = 1.
to
CREATE OBJECT o_splitter
EXPORTING
parent = CL_GUI_CONTAINER=>SCREEN0
rows = 2
columns = 1.
Let me know how it goes.
2012 Jan 31 6:16 AM
Dear,
I applied same code given by you but i am not getting top of page area and some fields which i have made on screen.
I want first top-of-page , Then Some fields , Then ALV without double scroll.
Thanx.
2012 Feb 06 8:32 AM
2012 Feb 06 11:40 AM
Hi Anuj,
Check this code:
DATA: o_splitter type ref to cl_gui_easy_splitter_container,"Splitter
o_grid TYPE REF TO cl_gui_alv_grid,
o_parent_top TYPE REF TO cl_gui_container,
o_docking type ref to cl_gui_docking_container.
DATA: i_mara TYPE STANDARD TABLE OF mara,
i_cat TYPE STANDARD TABLE OF lvc_s_fcat.
SELECT * FROM mara INTO TABLE i_mara
UP TO 500 ROWS
.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'MARA'
CHANGING
ct_fieldcat = i_cat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CREATE OBJECT o_docking
EXPORTING
parent = CL_GUI_EASY_SPLITTER_CONTAINER=>default_screen
RATIO = 95
SIDE = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_top.
CREATE OBJECT o_splitter
EXPORTING
parent = o_docking
orientation = 0
sash_position = 10 "Position of Splitter Bar (in Percent)
with_border = 1.
Data : o_top_container type ref to cl_gui_container, "Top Container
o_bottom_container type ref to cl_gui_container,"Bottom Container
o_document type ref to cl_dd_document. "Document
* Placing the containers in the splitter
o_top_container = o_splitter->top_left_container .
o_bottom_container = o_splitter->bottom_right_container .
CREATE OBJECT o_grid
EXPORTING
i_parent = o_bottom_container.
* Creating the document
CREATE OBJECT o_document
EXPORTING
style = 'ALV_GRID'.
CALL METHOD o_grid->set_table_for_first_display
CHANGING
it_outtab = i_mara
it_fieldcatalog = i_cat.