09-21-2010 12:11 PM
Hi,
I want to display two grid displays in a normal report using classes.
I got to know how to display 2 grids on module pool, but not on normal report.
Please help.
Regards
Manu
09-21-2010 12:14 PM
Hello Manu
Where is the difference? Are the 2 ALVs displayed on separate screens? Then you need (at least) two screen in your report.
If they are supposed to be displayed on the same screen then use class CL_GUI_ALV_SPLITTER_CONTAINER as parent container for your ALV grid instances.
Regards
Uwe
09-21-2010 12:14 PM
Hello Manu
Where is the difference? Are the 2 ALVs displayed on separate screens? Then you need (at least) two screen in your report.
If they are supposed to be displayed on the same screen then use class CL_GUI_ALV_SPLITTER_CONTAINER as parent container for your ALV grid instances.
Regards
Uwe
09-21-2010 12:27 PM
The two alvs are on the same screen, one is to diaplay successful records and other for error records.
Both have different fieldcatalog. I am not using module pool, so how to use these classes.
Can you please help me with the smaple code.
Regards
Manu
09-21-2010 12:39 PM
Hi,
create two custom containers and two grids using classes cl_gui_custom_container and cl_gui_alv_grid.. and then write the logic according to your requirement..
Hope this will helps you..
Regards,
Kiran
09-21-2010 12:55 PM
Hi,
Displaying multiple ALV Grid on a single screen is a very simple concept. To render or to draw a ALV grid on a screen you need a CONTAINER. Usually we create a CONTAINER with class CL_GUI_CUSTOM_CONTAINER and pass this CONTAINER object while creating ALV grid in parameter I_PARENT. Now to display multiple ALV grid you need multiple CONTAINER, here the class CL_GUI_EAST_SPLITTER_CONTAINER comes in the picture.
This class divides a particular CONTAINER into two and give you two CONTAINER in return. How it divides depend on the parameter you pass while creating object. You can divide it horizontally by passing argument CL_GUI_EAST_SPLITTER_CONTAINER=>ORIENTATION_HORIZONTAL or vertically by passing argument CL_GUI_EAST_SPLITTER_CONTAINER=>orientation_VERTICAL. Since it will give you two CONTAINER you can further divide resulting CONATINER into two. So each time you create a object of CL_GUI_EAST_SPLITTER_CONTAINER you get one more CONTAINER.
For more info [click|http://sample-code-abap.blogspot.com/2008/06/displaying-two-alv-grid-on-screen.html] here.
May it helps you.
Regards,
DS.
09-21-2010 1:02 PM
This will split fullscreen into two splitter objects:
CREATE OBJECT gr_splitter
EXPORTING
* link_dynnr =
* link_repid =
* shellstyle =
* left =
* top =
* width =
* height = 70
* metric = cntl_metric_dynpro
* align = 15
parent = cl_gui_container=>screen0
rows = 2
columns = 1
* no_autodef_progid_dynnr =
* name =
* EXCEPTIONS
* cntl_error = 1
* cntl_system_error = 2
* others = 3
.
IF sy-subrc <> 0.
" MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
" WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD gr_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = gr_container_1.
CALL METHOD gr_splitter->set_row_mode
EXPORTING
mode = 1 "splitter_container_mode_relative
* IMPORTING
* result =
* EXCEPTIONS
* cntl_error = 1
* cntl_system_error = 2
* others = 3
.
IF sy-subrc <> 0.
" MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
" WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD gr_splitter->set_row_height
EXPORTING
id = 1
height = 25
* IMPORTING
* result =
* EXCEPTIONS
* cntl_error = 1
* cntl_system_error = 2
* others = 3
.
IF sy-subrc <> 0.
" MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
" WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD gr_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = gr_container_2.
CREATE OBJECT gr_alv_ref
EXPORTING
i_parent = gr_container_2."cl_gui_container=>screen0.
CALL METHOD gr_alv_ref->set_table_for_first_display
EXPORTING
* i_buffer_active =
i_bypassing_buffer = 'X'
* i_consistency_check =
i_structure_name = 'ZST_....''
is_variant = gs_variant_pla
i_save = 'A'
i_default = ''
is_layout = gs_layo
* is_print =
* it_special_groups =
it_toolbar_excluding = gt_toolbar
* it_hyperlink =
* it_alv_graphics =
* it_except_qinfo =
* ir_salv_adapter =
CHANGING
it_outtab = <dt_out>
it_fieldcatalog = gt_fcat_full
* it_sort = gt_sort
it_filter = gt_filt
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.
09-22-2010 6:28 AM
hi,
you can use REUSE_ALV_BLOCK_LIST_DISPLAY and REUSE_ALV_BLOCK_LIST_APPEND, if you dont want to use ALV using class, and if above two are not feasible then you can always refer BCALV* programs.