03-22-2012 8:15 AM
I am using cl_gui_docking_container to create a ALV, not using splitter, there's only one ALV
wanted to display the logo using cl_dd_document-display_document but the exporting parameter should be of type
cl_gui_custom_container but I am using docking container. Searched on sdn but could not find solution for this. There is a solution if we use splitter.
is there any other class instead of cl_dd_document for docking container.
Please help.
03-23-2012 8:43 AM
you're using the container o_docking twice - once as parent for the grid and as parent for the html-document. The might overlay each other. Try to use a separate container for the html-document.
03-23-2012 5:31 AM
hi ,
first of all to add a logo u have other methods too.
you can directly display the logo as well as text as there are methods already available in class CL_DD_DOCUMENT(For eg, ADD_TEXT, ADD_PICTURE, ADD_ICON etc).
Data: lo_document TYPE REF TO cl_dd_document.
CREATE OBJECT lo_document
EXPORTING
style = 'ALV_GRID'.
CALL METHOD lo_document->add_text " To add text
EXPORTING
text = text-006
sap_fontsize = '18'
sap_emphasis = cl_dd_area=>strong.
CALL METHOD lo_document->add_picture " For picture
EXPORTING
picture_id = 'TRVPICTURE01'
width = '100'.
And in the method display_document the exporting parameter is of type CL_GUI_CONTAINER.
try the above it will resolve your issue.
03-23-2012 6:16 AM
Hi Rajiv,
Thanks for the reply, The issue is that cl_dd_document-display_document has the exporting parameter of type cl_gui_custom_container but i am not using this container type. I am using cl_gui_docking_container.
Regards,
Manu
03-23-2012 6:40 AM
cl_dd_document- display_document has the exporting parameter of type CL_GUI_CONTAINER not the cl_gui_custom_container
03-23-2012 6:48 AM
Hi Rajiv,
Please find attached the file, this is not working, can you please help me understand the issue.
Regards,
Manu
REPORT ztest_screen.
DATA : itab TYPE STANDARD TABLE OF pa0009,"Output Internal table
i_fieldcat TYPE STANDARD TABLE OF lvc_s_fcat,"Field catalog
o_document TYPE REF TO cl_dd_document,wa TYPE mara,
w_variant TYPE disvariant,
o_docking TYPE REF TO cl_gui_docking_container,"Docking Container
o_grid TYPE REF TO cl_gui_alv_grid."Grid
SELECT * FROM pa0009 INTO TABLE itab UP TO 100 ROWS.
CALL SCREEN 9000.
*&---------------------------------------------------------------------*
*& Module STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE status_9000 OUTPUT.
SET PF-STATUS 'PFST'.
* SET TITLEBAR 'xxx'.IF o_docking IS INITIAL.
* Creating Docking Container
CREATE OBJECT o_docking
EXPORTING
ratio = '95'.IF sy-subrc EQ 0.
* Creating Grid
CREATE OBJECT o_grid
EXPORTING
i_parent = o_docking.** added
IF sy-subrc EQ 0.CREATE OBJECT o_document
EXPORTING
style = 'ALV_GRID'.CALL METHOD o_document->add_text
EXPORTING
text = 'No. of Materials:'.
* Adding GAP
CALL METHOD o_document->add_gap
EXPORTING
width = 10.
* Adding Text
CALL METHOD o_document->add_text
EXPORTING
text = 'headerr'.
* Adding Line
CALL METHOD o_document->new_line.CALL METHOD o_document->display_document
EXPORTING
parent = o_docking.
* Calling the method of ALV to process top of page
CALL METHOD o_grid->list_processing_events
EXPORTING
i_event_name = 'TOP_OF_PAGE'
i_dyndoc_id = o_document.
ENDIF.** added
ENDIF.* Filling the fieldcatalog table
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'PA0009'
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.w_variant-report = sy-repid.
DATA: gs_fcatlayo TYPE lvc_s_layo.
DATA: lt_f4 TYPE lvc_t_f4.
gs_fcatlayo-grid_title = 'Header'.
* gs_fcatlayo-no_toolbar = 'X'.* Displaying the output
CALL METHOD o_grid->set_table_for_first_display
EXPORTING
is_layout = gs_fcatlayo
is_variant = w_variant
i_save = 'A'
CHANGING
it_outtab = itab
it_fieldcatalog = i_fieldcat
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.
ENDIF.
ENDMODULE. " STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_9000 INPUT.DATA lv_ucomm TYPE sy-ucomm.
lv_ucomm = sy-ucomm.
CASE lv_ucomm.
WHEN 'CANCEl' OR 'EXIT'.
PERFORM free_objects.
LEAVE PROGRAM.
WHEN 'BACK'.
PERFORM free_objects.
SET SCREEN '0'.
LEAVE SCREEN.
ENDCASE.
ENDMODULE. "USER_COMMAND_9000 INPUT
*&---------------------------------------------------------------------*
*& Form free_objects
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM free_objects .CALL METHOD o_grid->free
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 o_docking->free
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.
ENDFORM. " free_objects
Message was edited by: Suhas Saha
03-23-2012 7:48 AM
Hi,
before calling method o_document->display_document( ) call method o_document->merge_document( ).
regards,
03-23-2012 7:57 AM
Hi Dirk,
Thanks for the reply. I tried it but didn't work.
Regards,
Manu
03-23-2012 8:35 AM
check the program DD_ADD_PICTURE in se38.
it will definitely resolve ur issue.
03-23-2012 8:43 AM
you're using the container o_docking twice - once as parent for the grid and as parent for the html-document. The might overlay each other. Try to use a separate container for the html-document.
03-23-2012 9:00 AM
Thanks dirk. it worked with
CREATE OBJECT o_docking
EXPORTING
ratio = '90'
side = o_docking->dock_at_bottom.
CREATE OBJECT o_docking2
EXPORTING
repid = lwa_variant-report
dynnr = sy-dynnr
ratio = '10'
side = o_docking->dock_at_top.
03-23-2012 10:12 AM