02-14-2007 4:58 AM
Hi Could anybody please advice me, as I'm trying to display two grids in a same screen , but grids are displaying side by side, I need to display them one by one...please advice me....Thanks in advance....
*-- global data definitions for ALV
*-- ALV Grid Instance Reference
DATA : w_grid TYPE REF TO CL_GUI_ALV_GRID,
w_grid1 TYPE REF TO CL_GUI_ALV_GRID,
w_grid2 TYPE REF TO CL_GUI_ALV_GRID,
*-- Container Instance Reference
w_dock_container TYPE REF TO cl_gui_docking_container,
w_dock_container1 TYPE REF TO cl_gui_docking_container,
w_dock_container2 TYPE REF TO cl_gui_docking_container,
*-- Field catalog table
w_lvc_t_fcat TYPE lvc_t_fcat,
w_lvc_t_fcat1 TYPE lvc_t_fcat,
w_lvc_t_fcat2 TYPE lvc_t_fcat,
*-- Layout structure
w_lvc_layo TYPE lvc_s_layo,
w_lvc_layo1 TYPE lvc_s_layo,
w_lvc_layo2 TYPE lvc_s_layo,
*-- disvariant
w_disvariant TYPE disvariant,
*&---------------------------------------------------------------------*
*& Module STATUS_9700 OUTPUT
*&---------------------------------------------------------------------*
* status for 9700
*----------------------------------------------------------------------*
MODULE STATUS_9700 OUTPUT.
*-- pf status
SET PF-STATUS 'YIBRK_VAL_REPORT'.
*-- title bar
SET TITLEBAR 'YIBRK_VAL_REPORT'.
*-- display valuations report.
PERFORM display_valuations.
*-- display exceptions
PERFORM display_exceptions.
ENDMODULE. " STATUS_9700 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9700 INPUT
*&---------------------------------------------------------------------*
* user command for 9700
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9700 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'. " BACK BUTTON
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXIT' OR 'CANCEL'. " EXIT AND CANCEL BUTTON
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9700 INPUT
*&---------------------------------------------------------------------*
*& Form display_valuations
*&---------------------------------------------------------------------*
* display valuation report
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_valuations .
IF w_grid1 IS INITIAL.
*-- creating custom container instance
CREATE OBJECT W_DOCK_CONTAINER1
EXPORTING
RATIO = '95'
* I_SHELLSTYLE = 0
* I_LIFETIME =
* I_PARENT =
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*-- creating ALV grid instance
CREATE OBJECT W_GRID1
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
I_PARENT = W_DOCK_CONTAINER1
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*-- preparing field catalog
PERFORM prepare_fieldcat_valuations CHANGING w_lvc_t_fcat1.
*-- preparing layout structure
PERFORM prepare_layout_valuations CHANGING w_lvc_layo1.
*-- disvariant
W_DISVARIANT-REPORT = SY-REPID.
*-- display alv grid
CALL METHOD W_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
IS_VARIANT = W_DISVARIANT
I_SAVE = c_a
* I_DEFAULT = 'X'
IS_LAYOUT = W_LVC_LAYO1
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_val_report[]
IT_FIELDCATALOG = W_LVC_T_FCAT1
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
*-- refresh table
CALL METHOD W_GRID1->refresh_table_DISPLAY
* EXPORTING
EXCEPTIONS
finished = 1
others = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " display_valuations
*&---------------------------------------------------------------------*
*& Form display_exceptions
*&---------------------------------------------------------------------*
* display exception report
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_exceptions .
IF w_grid2 IS INITIAL.
*-- creating custom container instance
CREATE OBJECT W_DOCK_CONTAINER2
EXPORTING
RATIO = '95'
* I_SHELLSTYLE = 0
* I_LIFETIME =
* I_PARENT =
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*-- creating ALV grid instance
CREATE OBJECT W_GRID2
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
I_PARENT = W_DOCK_CONTAINER2
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*-- preparing field catalog
PERFORM prepare_fieldcat_exceptions CHANGING w_lvc_t_fcat2.
*-- preparing layout structure
PERFORM prepare_layout_exceptions CHANGING w_lvc_layo2.
*-- disvariant
W_DISVARIANT-REPORT = SY-REPID.
*-- display alv grid
CALL METHOD W_GRID2->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
IS_VARIANT = W_DISVARIANT
I_SAVE = c_a
* I_DEFAULT = 'X'
IS_LAYOUT = W_LVC_LAYO2
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_val_report_exce[]
IT_FIELDCATALOG = W_LVC_T_FCAT2
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
*-- refresh table
CALL METHOD W_GRID2->refresh_table_DISPLAY
* EXPORTING
EXCEPTIONS
finished = 1
others = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " display_exceptions
*&---------------------------------------------------------------------*
*& Form prepare_fieldcat_valuations
*&---------------------------------------------------------------------*
* field catalog for display valuations
*----------------------------------------------------------------------*
* <--P_W_LVC_T_FCAT1 text
*----------------------------------------------------------------------*
FORM prepare_fieldcat_valuations CHANGING P_W_LVC_T_FCAT1
TYPE lvc_t_fcat.
DATA: ls_fcat TYPE lvc_s_fcat.
*-- Plan Type
ls_fcat-fieldname = 'PLTYP'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Plan Type'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Plan Option
ls_fcat-fieldname = 'PLAN_OPT'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Plan Option'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Currency
ls_fcat-fieldname = 'CURRENCY'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Currency'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- BALANCE
ls_fcat-fieldname = 'BALANCE'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '18'.
ls_fcat-coltext = 'Balances'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Earnings Percentage
ls_fcat-fieldname = 'PERCENTAGE'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '12'.
ls_fcat-coltext = 'Percentage'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Earnings amount
ls_fcat-fieldname = 'EAMOUNT'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '18'.
ls_fcat-coltext = 'Earnings Amount'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Balance after Earnings
ls_fcat-fieldname = 'EBALANCE'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '22'.
ls_fcat-coltext = 'Balance after Earnings'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
ENDFORM. " prepare_fieldcat_valuations
*&---------------------------------------------------------------------*
*& Form prepare_layout_valuations
*&---------------------------------------------------------------------*
* prepare layout for valuation report
*----------------------------------------------------------------------*
* <--P_W_LVC_LAYO1 text
*----------------------------------------------------------------------*
FORM prepare_layout_valuations CHANGING P_W_LVC_LAYO1 TYPE lvc_s_layo.
P_W_LVC_LAYO1-zebra = c_x.
P_W_LVC_LAYO1-grid_title = c_title.
P_W_LVC_LAYO1-SEL_MODE = c_a.
P_W_LVC_LAYO1-NO_TOOLBAR = c_x.
ENDFORM. " prepare_layout_valuations
*&---------------------------------------------------------------------*
*& Form prepare_fieldcat_exceptions
*&---------------------------------------------------------------------*
* field catalog for exception report
*----------------------------------------------------------------------*
* <--P_W_LVC_T_FCAT2 text
*----------------------------------------------------------------------*
FORM prepare_fieldcat_exceptions CHANGING P_W_LVC_T_FCAT2
TYPE lvc_t_fcat.
DATA: ls_fcat TYPE lvc_s_fcat.
*-- GIN
ls_fcat-fieldname = 'GIN'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'GIN'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
*-- Plan Type
ls_fcat-fieldname = 'PLTYP'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Plan Type'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
*-- Plan Option
ls_fcat-fieldname = 'PLAN_OPT'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Plan Option'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
*-- BALANCE
ls_fcat-fieldname = 'BALANCE'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '18'.
ls_fcat-coltext = 'Balances'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
*-- Reason
ls_fcat-fieldname = 'REASON'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '25'.
ls_fcat-coltext = 'Reason'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
ENDFORM. " prepare_fieldcat_exceptions
*&---------------------------------------------------------------------*
*& Form prepare_layout_exceptions
*&---------------------------------------------------------------------*
* prepare layout for exception report
*----------------------------------------------------------------------*
* <--P_W_LVC_LAYO2 text
*----------------------------------------------------------------------*
FORM prepare_layout_exceptions CHANGING P_W_LVC_LAYO2 TYPE lvc_s_layo.
P_W_LVC_LAYO2-zebra = c_x.
P_W_LVC_LAYO2-grid_title = c_title.
P_W_LVC_LAYO2-SEL_MODE = c_a.
P_W_LVC_LAYO2-NO_TOOLBAR = c_x.
ENDFORM. " prepare_layout_exceptions
02-14-2007 7:03 AM
Hi ,
Thanks lot for the reply and have changed the code adviced , but im getting the forllowing error...could you please advice....
Error analysis
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assigned to the class 'CX_SY_REF_IS_INITIAL', was
neither
caught nor passed along using a RAISING clause, in the procedure
"DISPLAY_VALUATIONS" "(FORM)"
.
Since the caller of the procedure could not have expected this exception
to occur, the running program was terminated.
The reason for the exception is:
Attempt to access a component using 'NULL' object reference (points
to nothing).
An object reference must point to an object (an instance of a class)
before you can use it to access components (variable: "W_GRID1").
Either the reference has not yet been set, or it has been reset to
'NULL' by a CLEAR statement.
DATA : w_grid TYPE REF TO CL_GUI_ALV_GRID,
w_grid1 TYPE REF TO CL_GUI_ALV_GRID,
w_grid2 TYPE REF TO CL_GUI_ALV_GRID,
*-- Container Instance Reference
* w_dock_container TYPE REF TO cl_gui_docking_container,
* w_dock_container1 TYPE REF TO cl_gui_docking_container,
* w_dock_container2 TYPE REF TO cl_gui_docking_container,
w_splitter TYPE REF TO cl_gui_splitter_container,
w_dock_container TYPE REF TO cl_gui_docking_container,
w_dock_container1 TYPE REF TO cl_gui_container,
w_dock_container2 TYPE REF TO cl_gui_container,
*&---------------------------------------------------------------------*
*& Module STATUS_9700 OUTPUT
*&---------------------------------------------------------------------*
* status for 9700
*----------------------------------------------------------------------*
MODULE STATUS_9700 OUTPUT.
*-- pf status
SET PF-STATUS 'YIBRK_VAL_REPORT'.
*-- title bar
SET TITLEBAR 'YIBRK_VAL_REPORT'.
*-- display valuations report.
PERFORM display_valuations.
*-- display exceptions
PERFORM display_exceptions.
ENDMODULE. " STATUS_9700 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9700 INPUT
*&---------------------------------------------------------------------*
* user command for 9700
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9700 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'. " BACK BUTTON
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXIT' OR 'CANCEL'. " EXIT AND CANCEL BUTTON
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9700 INPUT
*&---------------------------------------------------------------------*
*& Form display_valuations
*&---------------------------------------------------------------------*
* display valuation report
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_valuations .
IF w_grid1 IS INITIAL.
*-- creating custom container instance
CREATE OBJECT W_DOCK_CONTAINER
EXPORTING
RATIO = '95'
* I_SHELLSTYLE = 0
* I_LIFETIME =
* I_PARENT =
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT w_splitter
EXPORTING parent = W_DOCK_CONTAINER
rows = 2
columns = 1.
CALL METHOD w_splitter->get_container
EXPORTING row = 1
column = 1
RECEIVING container = w_dock_container1.
CALL METHOD w_splitter->get_container
EXPORTING row = 2
column = 1
RECEIVING container = w_dock_container2.
*
**-- creating ALV grid instance
* CREATE OBJECT W_GRID1
* EXPORTING
** I_SHELLSTYLE = 0
** I_LIFETIME =
* I_PARENT = W_DOCK_CONTAINER1
** I_APPL_EVENTS = space
** I_PARENTDBG =
** I_APPLOGPARENT =
** I_GRAPHICSPARENT =
** I_NAME =
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* others = 5.
* IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
*-- preparing field catalog
PERFORM prepare_fieldcat_valuations CHANGING w_lvc_t_fcat1.
*-- preparing layout structure
PERFORM prepare_layout_valuations CHANGING w_lvc_layo1.
*-- disvariant
W_DISVARIANT-REPORT = SY-REPID.
*-- display alv grid
CALL METHOD W_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
IS_VARIANT = W_DISVARIANT
I_SAVE = c_a
* I_DEFAULT = 'X'
IS_LAYOUT = W_LVC_LAYO1
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_val_report[]
IT_FIELDCATALOG = W_LVC_T_FCAT1
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
*-- refresh table
CALL METHOD W_GRID1->refresh_table_DISPLAY
* EXPORTING
EXCEPTIONS
finished = 1
others = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " display_valuations
*&---------------------------------------------------------------------*
*& Form display_exceptions
*&---------------------------------------------------------------------*
* display exception report
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_exceptions .
IF w_grid2 IS INITIAL.
**-- creating custom container instance
* CREATE OBJECT W_DOCK_CONTAINER2
* EXPORTING
* RATIO = '95'
** I_SHELLSTYLE = 0
** I_LIFETIME =
** I_PARENT =
** I_APPL_EVENTS = space
** I_PARENTDBG =
** I_APPLOGPARENT =
** I_GRAPHICSPARENT =
** I_NAME =
* EXCEPTIONS
* CNTL_ERROR = 1
* CNTL_SYSTEM_ERROR = 2
* CREATE_ERROR = 3
* LIFETIME_ERROR = 4
* LIFETIME_DYNPRO_DYNPRO_LINK = 5
* others = 6.
* IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
*
**-- creating ALV grid instance
* CREATE OBJECT W_GRID2
* EXPORTING
** I_SHELLSTYLE = 0
** I_LIFETIME =
* I_PARENT = W_DOCK_CONTAINER2
** I_APPL_EVENTS = space
** I_PARENTDBG =
** I_APPLOGPARENT =
** I_GRAPHICSPARENT =
** I_NAME =
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* others = 5.
* IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
*
*-- preparing field catalog
PERFORM prepare_fieldcat_exceptions CHANGING w_lvc_t_fcat2.
*-- preparing layout structure
PERFORM prepare_layout_exceptions CHANGING w_lvc_layo2.
*-- disvariant
W_DISVARIANT-REPORT = SY-REPID.
*-- display alv grid
CALL METHOD W_GRID2->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
IS_VARIANT = W_DISVARIANT
I_SAVE = c_a
* I_DEFAULT = 'X'
IS_LAYOUT = W_LVC_LAYO2
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_val_report_exce[]
IT_FIELDCATALOG = W_LVC_T_FCAT2
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
*-- refresh table
CALL METHOD W_GRID2->refresh_table_DISPLAY
* EXPORTING
EXCEPTIONS
finished = 1
others = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " display_exceptions
02-14-2007 5:02 AM
Use the splitter container instead of the docking container. Docking container will always display side by side. Refer to the transaction DWDM for examples.
Manoj
02-14-2007 5:28 AM
Hi,
If u use custom container u can place two in the screen and code accordingly.
If you are using docking container dont use two, ise one conatiner and split the same into two
REPORT rsdemo_splitter_control .
DATA url(132).
DATA splitter TYPE REF TO cl_gui_splitter_container.
DATA container TYPE REF TO cl_gui_custom_container.
DATA container_1 TYPE REF TO cl_gui_container.
DATA container_2 TYPE REF TO cl_gui_container.
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
IF init is initial.
CREATE OBJECT container
EXPORTING container_name = 'CUSTOM'.
CREATE OBJECT splitter
EXPORTING parent = container
rows = 2
columns = 1.
<b> CALL METHOD splitter->get_container
EXPORTING row = 1
column = 1
RECEIVING container = container_1.
CALL METHOD splitter->get_container
EXPORTING row = 2
column = 1
RECEIVING container = container_2.</b>
By this way u can achieve. Its easy way.
02-14-2007 6:24 AM
*-- global data definitions for ALV
*-- ALV Grid Instance Reference
DATA : w_grid TYPE REF TO CL_GUI_ALV_GRID,
w_grid1 TYPE REF TO CL_GUI_ALV_GRID,
w_grid2 TYPE REF TO CL_GUI_ALV_GRID,
*-- Container Instance Reference
w_splitter TYPE REF TO cl_gui_splitter_container,
w_dock_container TYPE REF TO cl_gui_docking_container,
w_dock_container1 TYPE REF TO cl_gui_container,
w_dock_container2 TYPE REF TO cl_gui_container,
*-- Field catalog table
w_lvc_t_fcat TYPE lvc_t_fcat,
w_lvc_t_fcat1 TYPE lvc_t_fcat,
w_lvc_t_fcat2 TYPE lvc_t_fcat,
*-- Layout structure
w_lvc_layo TYPE lvc_s_layo,
w_lvc_layo1 TYPE lvc_s_layo,
w_lvc_layo2 TYPE lvc_s_layo,
*-- disvariant
w_disvariant TYPE disvariant,
*&---------------------------------------------------------------------*
*& Module STATUS_9700 OUTPUT
*&---------------------------------------------------------------------*
* status for 9700
*----------------------------------------------------------------------*
MODULE STATUS_9700 OUTPUT.
*-- pf status
SET PF-STATUS 'YIBRK_VAL_REPORT'.
*-- title bar
SET TITLEBAR 'YIBRK_VAL_REPORT'.
*-- display valuations report.
PERFORM display_valuations.
*-- display exceptions
PERFORM display_exceptions.
ENDMODULE. " STATUS_9700 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9700 INPUT
*&---------------------------------------------------------------------*
* user command for 9700
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9700 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'. " BACK BUTTON
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXIT' OR 'CANCEL'. " EXIT AND CANCEL BUTTON
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9700 INPUT
*&---------------------------------------------------------------------*
*& Form display_valuations
*&---------------------------------------------------------------------*
* display valuation report
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_valuations .
IF w_grid1 IS INITIAL.
*-- creating custom container instance
CREATE OBJECT W_DOCK_CONTAINER
EXPORTING
RATIO = '95'
* I_SHELLSTYLE = 0
* I_LIFETIME =
* I_PARENT =
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT w_splitter
EXPORTING parent = W_DOCK_CONTAINER
rows = 2
columns = 1.
CALL METHOD splitter->get_container
EXPORTING row = 1
column = 1
RECEIVING container = w_dock_container_1.
CALL METHOD splitter->get_container
EXPORTING row = 2
column = 1
RECEIVING container = w_dock_container_2.
*-- preparing field catalog
PERFORM prepare_fieldcat_valuations CHANGING w_lvc_t_fcat1.
*-- preparing layout structure
PERFORM prepare_layout_valuations CHANGING w_lvc_layo1.
*-- disvariant
W_DISVARIANT-REPORT = SY-REPID.
*-- display alv grid
CALL METHOD W_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
IS_VARIANT = W_DISVARIANT
I_SAVE = c_a
* I_DEFAULT = 'X'
IS_LAYOUT = W_LVC_LAYO1
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_val_report[]
IT_FIELDCATALOG = W_LVC_T_FCAT1
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
*-- refresh table
CALL METHOD W_GRID1->refresh_table_DISPLAY
* EXPORTING
EXCEPTIONS
finished = 1
others = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " display_valuations
&----
*& Form display_exceptions
&----
display exception report
----
--> p1 text
<-- p2 text
----
FORM display_exceptions .
IF w_grid2 IS INITIAL.
<b>*-- creating custom container instance
CREATE OBJECT W_DOCK_CONTAINER2
EXPORTING
RATIO = '95'
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT =
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*-- creating ALV grid instance
CREATE OBJECT W_GRID2
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = W_DOCK_CONTAINER2
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
</b>
No need for this code.
*-- preparing field catalog
PERFORM prepare_fieldcat_exceptions CHANGING w_lvc_t_fcat2.
*-- preparing layout structure
PERFORM prepare_layout_exceptions CHANGING w_lvc_layo2.
*-- disvariant
W_DISVARIANT-REPORT = SY-REPID.
*-- display alv grid
CALL METHOD W_GRID2->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
IS_VARIANT = W_DISVARIANT
I_SAVE = c_a
* I_DEFAULT = 'X'
IS_LAYOUT = W_LVC_LAYO2
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_val_report_exce[]
IT_FIELDCATALOG = W_LVC_T_FCAT2
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
*-- refresh table
CALL METHOD W_GRID2->refresh_table_DISPLAY
* EXPORTING
EXCEPTIONS
finished = 1
others = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " display_exceptions
*&---------------------------------------------------------------------*
*& Form prepare_fieldcat_valuations
*&---------------------------------------------------------------------*
* field catalog for display valuations
*----------------------------------------------------------------------*
* <--P_W_LVC_T_FCAT1 text
*----------------------------------------------------------------------*
FORM prepare_fieldcat_valuations CHANGING P_W_LVC_T_FCAT1
TYPE lvc_t_fcat.
DATA: ls_fcat TYPE lvc_s_fcat.
*-- Plan Type
ls_fcat-fieldname = 'PLTYP'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Plan Type'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Plan Option
ls_fcat-fieldname = 'PLAN_OPT'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Plan Option'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Currency
ls_fcat-fieldname = 'CURRENCY'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Currency'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- BALANCE
ls_fcat-fieldname = 'BALANCE'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '18'.
ls_fcat-coltext = 'Balances'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Earnings Percentage
ls_fcat-fieldname = 'PERCENTAGE'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '12'.
ls_fcat-coltext = 'Percentage'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Earnings amount
ls_fcat-fieldname = 'EAMOUNT'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '18'.
ls_fcat-coltext = 'Earnings Amount'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
*-- Balance after Earnings
ls_fcat-fieldname = 'EBALANCE'.
ls_fcat-ref_table = 'T_VAL_REPORT'.
ls_fcat-outputlen = '22'.
ls_fcat-coltext = 'Balance after Earnings'.
APPEND ls_fcat to p_w_lvc_t_fcat1.
CLEAR ls_fcat.
ENDFORM. " prepare_fieldcat_valuations
*&---------------------------------------------------------------------*
*& Form prepare_layout_valuations
*&---------------------------------------------------------------------*
* prepare layout for valuation report
*----------------------------------------------------------------------*
* <--P_W_LVC_LAYO1 text
*----------------------------------------------------------------------*
FORM prepare_layout_valuations CHANGING P_W_LVC_LAYO1 TYPE lvc_s_layo.
P_W_LVC_LAYO1-zebra = c_x.
P_W_LVC_LAYO1-grid_title = c_title.
P_W_LVC_LAYO1-SEL_MODE = c_a.
P_W_LVC_LAYO1-NO_TOOLBAR = c_x.
ENDFORM. " prepare_layout_valuations
*&---------------------------------------------------------------------*
*& Form prepare_fieldcat_exceptions
*&---------------------------------------------------------------------*
* field catalog for exception report
*----------------------------------------------------------------------*
* <--P_W_LVC_T_FCAT2 text
*----------------------------------------------------------------------*
FORM prepare_fieldcat_exceptions CHANGING P_W_LVC_T_FCAT2
TYPE lvc_t_fcat.
DATA: ls_fcat TYPE lvc_s_fcat.
*-- GIN
ls_fcat-fieldname = 'GIN'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'GIN'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
*-- Plan Type
ls_fcat-fieldname = 'PLTYP'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Plan Type'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
*-- Plan Option
ls_fcat-fieldname = 'PLAN_OPT'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '10'.
ls_fcat-coltext = 'Plan Option'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
*-- BALANCE
ls_fcat-fieldname = 'BALANCE'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '18'.
ls_fcat-coltext = 'Balances'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
*-- Reason
ls_fcat-fieldname = 'REASON'.
ls_fcat-ref_table = 'T_VAL_REPORT_EXCE'.
ls_fcat-outputlen = '25'.
ls_fcat-coltext = 'Reason'.
APPEND ls_fcat to p_w_lvc_t_fcat2.
CLEAR ls_fcat.
ENDFORM. " prepare_fieldcat_exceptions
*&---------------------------------------------------------------------*
*& Form prepare_layout_exceptions
*&---------------------------------------------------------------------*
* prepare layout for exception report
*----------------------------------------------------------------------*
* <--P_W_LVC_LAYO2 text
*----------------------------------------------------------------------*
FORM prepare_layout_exceptions CHANGING P_W_LVC_LAYO2 TYPE lvc_s_layo.
P_W_LVC_LAYO2-zebra = c_x.
P_W_LVC_LAYO2-grid_title = c_title.
P_W_LVC_LAYO2-SEL_MODE = c_a.
P_W_LVC_LAYO2-NO_TOOLBAR = c_x.
ENDFORM. " prepare_layout_exceptions
This is not teh exact code try with tis.
02-14-2007 6:02 AM
Could you please let me know what could be the changes in my code?
02-14-2007 7:03 AM
Hi ,
Thanks lot for the reply and have changed the code adviced , but im getting the forllowing error...could you please advice....
Error analysis
An exception occurred. This exception is dealt with in more detail below
. The exception, which is assigned to the class 'CX_SY_REF_IS_INITIAL', was
neither
caught nor passed along using a RAISING clause, in the procedure
"DISPLAY_VALUATIONS" "(FORM)"
.
Since the caller of the procedure could not have expected this exception
to occur, the running program was terminated.
The reason for the exception is:
Attempt to access a component using 'NULL' object reference (points
to nothing).
An object reference must point to an object (an instance of a class)
before you can use it to access components (variable: "W_GRID1").
Either the reference has not yet been set, or it has been reset to
'NULL' by a CLEAR statement.
DATA : w_grid TYPE REF TO CL_GUI_ALV_GRID,
w_grid1 TYPE REF TO CL_GUI_ALV_GRID,
w_grid2 TYPE REF TO CL_GUI_ALV_GRID,
*-- Container Instance Reference
* w_dock_container TYPE REF TO cl_gui_docking_container,
* w_dock_container1 TYPE REF TO cl_gui_docking_container,
* w_dock_container2 TYPE REF TO cl_gui_docking_container,
w_splitter TYPE REF TO cl_gui_splitter_container,
w_dock_container TYPE REF TO cl_gui_docking_container,
w_dock_container1 TYPE REF TO cl_gui_container,
w_dock_container2 TYPE REF TO cl_gui_container,
*&---------------------------------------------------------------------*
*& Module STATUS_9700 OUTPUT
*&---------------------------------------------------------------------*
* status for 9700
*----------------------------------------------------------------------*
MODULE STATUS_9700 OUTPUT.
*-- pf status
SET PF-STATUS 'YIBRK_VAL_REPORT'.
*-- title bar
SET TITLEBAR 'YIBRK_VAL_REPORT'.
*-- display valuations report.
PERFORM display_valuations.
*-- display exceptions
PERFORM display_exceptions.
ENDMODULE. " STATUS_9700 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9700 INPUT
*&---------------------------------------------------------------------*
* user command for 9700
*----------------------------------------------------------------------*
MODULE USER_COMMAND_9700 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'. " BACK BUTTON
SET SCREEN 0.
LEAVE SCREEN.
WHEN 'EXIT' OR 'CANCEL'. " EXIT AND CANCEL BUTTON
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9700 INPUT
*&---------------------------------------------------------------------*
*& Form display_valuations
*&---------------------------------------------------------------------*
* display valuation report
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_valuations .
IF w_grid1 IS INITIAL.
*-- creating custom container instance
CREATE OBJECT W_DOCK_CONTAINER
EXPORTING
RATIO = '95'
* I_SHELLSTYLE = 0
* I_LIFETIME =
* I_PARENT =
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT w_splitter
EXPORTING parent = W_DOCK_CONTAINER
rows = 2
columns = 1.
CALL METHOD w_splitter->get_container
EXPORTING row = 1
column = 1
RECEIVING container = w_dock_container1.
CALL METHOD w_splitter->get_container
EXPORTING row = 2
column = 1
RECEIVING container = w_dock_container2.
*
**-- creating ALV grid instance
* CREATE OBJECT W_GRID1
* EXPORTING
** I_SHELLSTYLE = 0
** I_LIFETIME =
* I_PARENT = W_DOCK_CONTAINER1
** I_APPL_EVENTS = space
** I_PARENTDBG =
** I_APPLOGPARENT =
** I_GRAPHICSPARENT =
** I_NAME =
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* others = 5.
* IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
*-- preparing field catalog
PERFORM prepare_fieldcat_valuations CHANGING w_lvc_t_fcat1.
*-- preparing layout structure
PERFORM prepare_layout_valuations CHANGING w_lvc_layo1.
*-- disvariant
W_DISVARIANT-REPORT = SY-REPID.
*-- display alv grid
CALL METHOD W_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
IS_VARIANT = W_DISVARIANT
I_SAVE = c_a
* I_DEFAULT = 'X'
IS_LAYOUT = W_LVC_LAYO1
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_val_report[]
IT_FIELDCATALOG = W_LVC_T_FCAT1
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
*-- refresh table
CALL METHOD W_GRID1->refresh_table_DISPLAY
* EXPORTING
EXCEPTIONS
finished = 1
others = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " display_valuations
*&---------------------------------------------------------------------*
*& Form display_exceptions
*&---------------------------------------------------------------------*
* display exception report
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_exceptions .
IF w_grid2 IS INITIAL.
**-- creating custom container instance
* CREATE OBJECT W_DOCK_CONTAINER2
* EXPORTING
* RATIO = '95'
** I_SHELLSTYLE = 0
** I_LIFETIME =
** I_PARENT =
** I_APPL_EVENTS = space
** I_PARENTDBG =
** I_APPLOGPARENT =
** I_GRAPHICSPARENT =
** I_NAME =
* EXCEPTIONS
* CNTL_ERROR = 1
* CNTL_SYSTEM_ERROR = 2
* CREATE_ERROR = 3
* LIFETIME_ERROR = 4
* LIFETIME_DYNPRO_DYNPRO_LINK = 5
* others = 6.
* IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
*
**-- creating ALV grid instance
* CREATE OBJECT W_GRID2
* EXPORTING
** I_SHELLSTYLE = 0
** I_LIFETIME =
* I_PARENT = W_DOCK_CONTAINER2
** I_APPL_EVENTS = space
** I_PARENTDBG =
** I_APPLOGPARENT =
** I_GRAPHICSPARENT =
** I_NAME =
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* others = 5.
* IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
*
*-- preparing field catalog
PERFORM prepare_fieldcat_exceptions CHANGING w_lvc_t_fcat2.
*-- preparing layout structure
PERFORM prepare_layout_exceptions CHANGING w_lvc_layo2.
*-- disvariant
W_DISVARIANT-REPORT = SY-REPID.
*-- display alv grid
CALL METHOD W_GRID2->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
IS_VARIANT = W_DISVARIANT
I_SAVE = c_a
* I_DEFAULT = 'X'
IS_LAYOUT = W_LVC_LAYO2
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = t_val_report_exce[]
IT_FIELDCATALOG = W_LVC_T_FCAT2
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
*-- refresh table
CALL METHOD W_GRID2->refresh_table_DISPLAY
* EXPORTING
EXCEPTIONS
finished = 1
others = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
ENDFORM. " display_exceptions
02-14-2007 7:07 AM
Sorry uncomment this code
**-- creating ALV grid instance
* CREATE OBJECT W_GRID1
* EXPORTING
** I_SHELLSTYLE = 0
** I_LIFETIME =
* I_PARENT = W_DOCK_CONTAINER1
** I_APPL_EVENTS = space
** I_PARENTDBG =
** I_APPLOGPARENT =
** I_GRAPHICSPARENT =
** I_NAME =
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* others = 5.
* IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
* CREATE OBJECT W_GRID2
* EXPORTING
** I_SHELLSTYLE = 0
** I_LIFETIME =
* I_PARENT = W_DOCK_CONTAINER2
** I_APPL_EVENTS = space
** I_PARENTDBG =
** I_APPLOGPARENT =
** I_GRAPHICSPARENT =
** I_NAME =
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* others = 5.
* IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
So that grid will get created in both the containers.
02-14-2007 7:16 AM
hi Judith Jesse,
my problem solved...Thanks a lot and appreciate your patience and great help....
points rewarded.....Thanks once again....