2018 Apr 02 12:55 PM
Hi All,
I am displaying two ALV's using splitter container. For first ALV, I am getting ALV Toolbar. But for second ALV, toolbar bar is not getting displayed. Below is my code wherin I am using CL_SALV_TABLE. Anyone have sample code for two alv's using factory methods, please help me.
START-OF-SELECTION.
go_object->get_data( ).
go_object->fill_output( ).
CALL SCREEN 100.
*&---------------------------------------------------------------------*
*& METHOD STATUS_0100 OUTPUT *
*&---------------------------------------------------------------------*
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'TITLE'.
CALL METHOD go_object->display_output( ).
ENDMODULE.
METHOD display_output.
display_alv( EXPORTING
container_name = 'CONTAINER1'
CHANGING im_grid = lo_grid1
i_data = t_mara ).
display_alv( EXPORTING
container_name = 'CONTAINER1'
CHANGING im_grid = lo_grid2
i_data = t_marc ).
ENDMETHOD.
METHOD display_alv.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
r_container = im_grid
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = i_data.
CATCH cx_salv_msg INTO l_result.
go_object->exception_msg( EXPORTING l_result = l_result ).
ENDTRY.
lo_columns = lo_alv->get_columns( ).
lr_column = lo_columns->get_column( c_matnr ).
lr_column->set_output_length( 10 ).
lr_column = lo_columns->get_column( c_mtart ).
lr_column->set_output_length( 10 ).
lr_column = lo_columns->get_column( c_werks ).
lr_column->set_output_length( 10 ).
lr_column = lo_columns->get_column( c_ekgrp ).
lr_column->set_output_length( 10 ).
*-- Display the ALV
lo_alv->display( ).
ENDMETHOD.
Thanks,
HT
2018 Apr 10 12:26 PM
Hi All,
Thanks for your inputs.
After the factory method, I have called
CALL METHOD set_pf_status
CHANGING ch_salv = lo_alv.
And now I can see Main toolbar and also toolbar for both ALV's.
Issue resolved.
Thanks,
Bharath
Try clearing your references before you are displaying 2nd ALV. It is actually overwriting.
2018 Apr 02 1:18 PM
2018 Apr 02 8:31 PM
Try clearing your references before you are displaying 2nd ALV. It is actually overwriting.
2018 Apr 03 2:58 AM
2018 Apr 10 12:26 PM
Hi All,
Thanks for your inputs.
After the factory method, I have called
CALL METHOD set_pf_status
CHANGING ch_salv = lo_alv.
And now I can see Main toolbar and also toolbar for both ALV's.
Issue resolved.
Thanks,
Bharath
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |