11-04-2009 5:32 AM
Hi,
I want to display 3 different alv in a single container corresponding to the 3 check boxes on selection screen.
i.e.
If user selects 1 check box only one alv should be displayed, if 2 checkboxes selected by user 2 alv should be displayed and same for 3.
I cannot use 3 different containers bcoz if second checkbox is not selected then that place remains blank. So I am using single container and using splitter container dividing it into the no of rows corresponding to the no. of checkboxs selected by user.
Now I also want to display top-of-page for each alv. Please guide me how to achieve this.
Thanks & regards,
Harshada
11-04-2009 11:19 AM
create with some IF_ELSE conditions as i have done below. in my case the same things are required. if error table is there only then it will be displayed, else only output will be displayed.
* First Main Container
CREATE OBJECT obj_main1
EXPORTING
container_name = 'CC_CONTAINER'
style = cl_gui_custom_container=>ws_maximizebox.
* create top-document
CREATE OBJECT obj_dyndoc_id
EXPORTING
style = 'ALV_GRID'.
IF pr_view EQ c_x OR pr_stat EQ c_x.
* First Splitter Container
CREATE OBJECT obj_splitter1
EXPORTING
parent = obj_main1
rows = 2
columns = 1.
* Place obj_parent_html in First row First column
* for Top_of_page
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = obj_parent_html.
* Place obj_container1 in Second row First column
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = obj_container1.
* Set the height of Top of page
CALL METHOD obj_splitter1->set_row_height
EXPORTING
id = 1
height = 24.
ELSEIF pr_email EQ c_x.
* First Splitter Container
CREATE OBJECT obj_splitter1
EXPORTING
parent = obj_main1
rows = 3
columns = 1.
* Place obj_parent_html in First row First column
* for Top_of_page
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = obj_parent_html.
* Place obj_container1 in First row First column
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = obj_container1.
* Place obj_container2 in Second row First column
CALL METHOD obj_splitter1->get_container
EXPORTING
row = 3
column = 1
RECEIVING
container = obj_container2.
* Set the height of Top of page
CALL METHOD obj_splitter1->set_row_height
EXPORTING
id = 1
height = 24.
ENDIF.
Please note there is no need to create a hEADER in the container, but create it for the 1st table only which is always displayed
ags.
Edited by: ags on Nov 4, 2009 4:49 PM
Edited by: ags on Nov 4, 2009 4:50 PM