‎2007 Jan 31 1:16 PM
hi experts,
can any one give the idea about splitter control with one ex.
thanks in advance
r.vijai
‎2007 Jan 31 1:19 PM
REPORT zex35 NO STANDARD PAGE HEADING.
INCLUDE <icon>.
CLASS myclass DEFINITION DEFERRED.
TABLES: vbak,kna1.
TYPE-POOLS: slis,sdydo.
DATA: BEGIN OF jtab OCCURS 0,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
kunnr LIKE vbak-kunnr,
END OF jtab.
DATA: alv TYPE scrfname VALUE 'ALV',
obj_c_container_alv TYPE REF TO cl_gui_custom_container,
obj_grid TYPE REF TO cl_gui_alv_grid,
obj_myclass TYPE REF TO myclass,
i_fieldcat TYPE lvc_t_fcat,
wa_fieldcat LIKE LINE OF i_fieldcat,
gs_layout TYPE lvc_s_layo,
gs_print type lvc_s_prnt
.
DATA: v_split TYPE REF TO cl_gui_splitter_container,
v_contnr_top TYPE REF TO cl_gui_custom_container,
v_contnr_bot TYPE REF TO cl_gui_custom_container,
container type ref to cl_gui_container,
go_toolbar TYPE REF TO cl_gui_toolbar,
v_text20(255) TYPE c,
v_text16(255) TYPE c,
v_html TYPE REF TO cl_dd_document.
DATA: l_rows TYPE lvc_t_row.
CLEAR i_fieldcat[].
wa_fieldcat-col_pos = 1.
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-tabname = 'JTAB'.
wa_fieldcat-coltext = 'COL1'.
APPEND wa_fieldcat TO i_fieldcat.
wa_fieldcat-col_pos = 3.
wa_fieldcat-fieldname = 'KUNNR'.
wa_fieldcat-tabname = 'JTAB'.
wa_fieldcat-coltext = 'COL3'.
APPEND wa_fieldcat TO i_fieldcat.
wa_fieldcat-col_pos = 2.
wa_fieldcat-fieldname = 'ERDAT'.
wa_fieldcat-tabname = 'JTAB'.
wa_fieldcat-coltext = 'COL2'.
APPEND wa_fieldcat TO i_fieldcat.
CALL SCREEN 100.
----
CLASS MYCLASS DEFINITION
----
........ *
----
CLASS myclass DEFINITION.
PUBLIC SECTION.
METHODS:
toolbar FOR EVENT toolbar OF cl_gui_alv_grid IMPORTING e_object,
user_command FOR EVENT user_command OF cl_gui_alv_grid IMPORTING
e_ucomm
.
ENDCLASS.
----
CLASS MYCLASS IMPLEMENTATION
----
........ *
----
CLASS myclass IMPLEMENTATION.
METHOD toolbar.
DATA: ls_toolbar TYPE stb_button.
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 'BACK' TO ls_toolbar-function.
MOVE icon_previous_object TO ls_toolbar-icon.
MOVE 'BACK' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 'CLEA' TO ls_toolbar-function.
MOVE icon_refresh TO ls_toolbar-icon.
MOVE 'CLEAR' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 'TEXT' TO ls_toolbar-function.
MOVE icon_display TO ls_toolbar-icon.
MOVE 'READ' TO ls_toolbar-text.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO e_object->mt_toolbar.
ENDMETHOD.
METHOD user_command.
CASE e_ucomm.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
ENDMETHOD.
ENDCLASS.
*&----
*
*& Module STATUS_0100 OUTPUT
*&----
*
text
*----
*
MODULE status_0100 OUTPUT.
CASE sy-ucomm.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'DISPLAY'.
SELECT vbeln erdat kunnr FROM vbak INTO TABLE jtab WHERE vbeln LT
'0000000020'.
IF sy-subrc EQ 0.
ENDIF.
PERFORM display1.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Form display1
&----
text
----
--> p1 text
<-- p2 text
----
FORM display1.
CREATE OBJECT obj_c_container_alv
EXPORTING
container_name = alv
.
IF obj_grid IS INITIAL.
CREATE OBJECT v_split
EXPORTING
parent =
obj_c_container_alv
left = 0
top = 300
width = 400
height = 200
rows = 2
columns = 1
ORIENTATION = 0
sash_position = 25
with_border = 0
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
others = 3.
Set row height for row 1
CALL METHOD v_split->set_row_height
EXPORTING
id = 1
height = 40.
The splitter container should not have a border
CALL METHOD v_split->set_border
EXPORTING
border = cl_gui_cfw=>false.
Configure the splitter bar. The splitterbar is configures
so that it can't be moved
CALL METHOD v_split->set_row_sash
EXPORTING
id = 1 "Configure splitter bar no. 1
type = 0 "Type_movable
value = 0. "False
CREATE OBJECT go_toolbar
EXPORTING
parent = v_split
EXCEPTIONS
others = 1.
Add a buttons
*
CALL METHOD go_toolbar->add_button
*
EXPORTING
*
fcode = 'OK' "Function Code
*
icon = icon_okay "ICON name
*
is_disabled = ' ' "Disabled = X
*
butn_type = cntb_btype_button "Type of button
*
text = 'OK' "Text on button
*
is_checked = ' ' "Button selected
*
EXCEPTIONS
*
OTHERS = 1.
*
CALL METHOD go_toolbar->add_button
*
EXPORTING
*
fcode = 'CANCEL' "Function Code
*
icon = icon_cancel "ICON name
*
is_disabled = ' ' "Disabled = X
*
butn_type = cntb_btype_button "Type of button
*
text = 'Cancel' "Text on button
*
is_checked = ' ' "Button selected
*
EXCEPTIONS
*
OTHERS = 1.
*
CALL METHOD go_splitter_container->add_control
*
EXPORTING row = 2
*
column = 1
*
control = go_toolbar.
Get the containers of the splitter control
v_contnr_top = v_split->top_left_container.
v_contnr_bot = v_split->bottom_right_container.
call method v_split->set_border
exporting border = cl_gui_cfw=>false.
call method v_split->set_column_mode
exporting mode = v_split->mode_absolute.
container = v_split->get_container( row = 1 column = 1 ).
CREATE OBJECT obj_grid
EXPORTING i_parent = container.
*
CREATE OBJECT obj_grid
EXPORTING
i_parent = obj_c_container_alv.
Create an instance of alv control
CREATE OBJECT obj_grid
EXPORTING i_parent = v_contnr_bot.
CREATE OBJECT obj_myclass.
SET HANDLER obj_myclass->toolbar FOR obj_grid.
SET HANDLER obj_myclass->user_command FOR obj_grid.
gs_layout-grid_title = 'ALV TITLE'.
gs_print-reservelns = 20.
CALL METHOD obj_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'JTAB'
is_print = gs_print
is_layout = gs_layout
CHANGING
it_outtab = jtab[]
it_fieldcatalog = i_fieldcat.
Object for display of selection parameters in HTML top container
CREATE OBJECT v_html
EXPORTING
style = 'ALV_GRID'.
v_text20 = 'TIKKAVEDAVA'.
CALL METHOD v_html->add_gap
EXPORTING
width = 1.
CALL METHOD v_html->add_text
EXPORTING
text = v_text20.
CALL METHOD v_html->new_line.
Display Text-016
v_text16 = 'PICHIVEDAVA'.
CALL METHOD v_html->add_gap
EXPORTING
width = 1.
CALL METHOD v_html->add_text
EXPORTING
text = v_text16.
CALL METHOD v_html->new_line.
v_text16 = 'VEDAVASACHINODA'.
CALL METHOD v_html->add_gap
EXPORTING
width = 1.
CALL METHOD v_html->add_text
EXPORTING
text = v_text16.
CALL METHOD v_html->new_line.
Display the data
CALL METHOD v_html->display_document
EXPORTING
parent = v_contnr_top.
ELSE .
CALL METHOD obj_grid->refresh_table_display.
ENDIF.
ENDFORM. " display1
‎2007 Jan 31 1:22 PM
‎2007 Jan 31 1:25 PM
Hi,
The SAP Splitter Container Control allows you to display a group of controls in individual cells. The splitter container regulates the cells and displays them. The user can change the size of the individual cells using split bars. Increasing the size of one cell decreases that of the adjacent cell.
You can make the splitter bars immovable from within your program.
You can only place a Splitter Container Control in another container such as a Custom Container or a Docking Container.
You can nest splitter container instances.
The grid of a Splitter Container Control instance is initially set to 0 x 0. The maximum division is 16 x 16. You can specify the size of the lines and columns either absolutely in pixels or relatively as a percentage. The default setting is relative.
To create an instance of the SAP Splitter Container Control, you need a data object that you declare using TYPE REF TO CL_GUI_splitter_container as well as a reference to another container instance.
To create the instance itself, use the statement CREATE OBJECT <object_reference_var>. In the statement, you must pass the relevant parameters to specify the attributes of the container. This is illustrated in the graphic. If you do not assign values to the REPID and DYNNR parameters, the system uses the current values at runtime (current dialog box level , current program name, current screen).
Use the rows and columns parameters to specify the number of ROWS and COLUMNS that your grid should have.
Use the PARENT parameter to assign your splitter control instance to another container.
You can only assign a Splitter Container instance to a screen by using another container that is directly attached to the screen.
The cells of a splitter container are containers themselves. They are created when the Splitter Control is instantiated. They are used as containers for other controls, for which they are the "parents."
To assign further control instances to the cells of your splitter container instance, you need object references to the individual cells. To get a reference to a cell, use the instance method GET_CONTAINER. In the method call, use the row and column parameters to specify the cell. The RETURNING parameter contains a reference to a container instance.
You can check the demo programs:<b>RSDEMO*</b> .You will get examples for all controls.
Regards,
Beejal
**Reward if this helps