Skip to Content
avatar image
Former Member

Logo in OOPS based ALV

Hi Friends,

I am struck at the displaying a logo in OOPS based ALV report.I have declared the program as given below,any guidance please on how to display it.

CLASS LCL_EVENT_RECEIVER DEFINITION.

PUBLIC SECTION.

METHODS:

HANDLE_TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID IMPORTING E_DYNDOC_ID.

PRIVATE SECTION.

ENDCLASS. "lcl_event_receiver DEFINITION

****************************************************************

  • LOCAL CLASSES: Implementation

****************************************************************

CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.

METHOD HANDLE_TOP_OF_PAGE.

PERFORM EVENT_TOP_OF_PAGE USING E_DYNDOC_ID.

ENDMETHOD. "HANDLE_TOP_OF_PAGE

ENDCLASS. "lcl_event_receiver IMPLEMENTATION

FORM EVENT_TOP_OF_PAGE USING DG_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT.

ENDFORM. " EVENT_TOP_OF_PAGE

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jun 23, 2010 at 12:59 PM

    You have to use the instance method ADD_PICTURE of the object DG_DYNDOC_ID (ref. for class CL_DD_DOCUMENT).

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 23, 2010 at 01:21 PM

    Hello Friend,

    Implement the following code in TOP-OF-PAGE:

    FORM TOP-OF-PAGE.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    IT_LIST_COMMENTARY = HEADING[]
    I_LOGO = 'ENJOYSAP_LOGO' .
    .
    ENDFORM. "TOP-OF-PAGE

    also you can try the source code given by Vijay Babu Dudla via link:

    Alv-Grid Commentary Build in OO

    Best Regards,

    Jerry

    Edited by: Jerry Wang on Jun 23, 2010 3:23 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2010 at 02:05 PM

    Hi Vinayak,

    report zrich_0001 no standard page heading.
     
    data: ispfli type table of spfli.
    data: gr_table type ref to cl_salv_table.
    data: gr_functions type ref to cl_salv_functions.
     
     start-of-selection.
     
      select * into table ispfli from spfli.
      
      try.
          cl_salv_table=>factory(
            importing
              r_salv_table = gr_table
            changing
              t_table      = ispfli ).
        catch cx_salv_msg.
      endtry.
      
      gr_functions = gr_table->get_functions( ).
      gr_functions->set_all( abap_true ).
     
    *... TOP_OF_LIST
      data: lr_header type ref to cl_salv_form_header_info.
      create object lr_header
        exporting
          text    = 'This is my Header'.
      gr_table->set_top_of_list( lr_header ).
     
    *... END_OF_LIST
      create object lr_header
        exporting
          text    = 'This is my Footer'.
      gr_table->set_end_of_list( lr_header ).
      
      perform create_header_and_footer.
      
      gr_table->display( ). 
     
    *&---------------------------------------------------------------------*
    *&      Form  create_header_and_footer
    *&---------------------------------------------------------------------*
    *       text
    *----------------------------------------------------------------------*
    *  -->  p1        text
    *  <--  p2        text
    *----------------------------------------------------------------------*
    form create_header_and_footer .
      data: lr_top_element type ref to cl_salv_form_layout_grid,
            lr_end_element type ref to cl_salv_form_layout_flow,
            lr_grid type ref to cl_salv_form_layout_grid,
            lr_header type ref to cl_salv_form_header_info,
            lr_action type ref to cl_salv_form_action_info,
            lr_textview1 type ref to cl_salv_form_text,
            lr_picture type ref to cl_salv_form_picture.
     
      create object lr_top_element
        exporting
          columns = 2.
     
      lr_header = lr_top_element->create_header_information(
        row = 1
        column = 1
        text     = 'Flugdaten'                                  "#EC NOTEXT
        tooltip  = 'Flugdaten' ).                               "#EC NOTEXT
     
      lr_grid = lr_top_element->create_grid( row = 3
                                             column = 1 ).
      
      lr_textview1 = lr_grid->create_text(
          row     = 1
          column  = 1
          text    = 'C11'
          tooltip = 'Tooltip' ). 
     
      create object lr_picture
        exporting
          picture_id   = 'ENJOYSAP_LOGO'.
     
      call method lr_grid->set_element
        exporting
          row       = 4
          column    = 1
          r_element = lr_picture. 
     
      gr_table->set_top_of_list( lr_top_element ).
     
      data: lr_eol type ref to cl_salv_form_header_info.
      create object lr_eol
        exporting
          text    = 'This is  Footer'.
     
      gr_table->set_end_of_list( lr_eol ).
     
    endform.                    " create_header_and_footer

    See this example.

    For more information please visit these links also:

    1. add-logo-in-alv-grid-display

    2. how-to-display-logo-in-alv-header

    3. http://it.toolbox.com/wiki/index.php/How_do_I_insert_a_logo_in_ALV_using_Function_Modules%3F

    May all this helps you.

    Regards.

    Deepak Sharma

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 12, 2010 at 09:40 AM

    yes

    Add comment
    10|10000 characters needed characters exceeded