Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Alignment of LOGO IN ALV - TOP

Former Member
0 Kudos

Hello People,

In ALV report, i am using the FM : 'REUSE_ALV_COMMENTARY_WRITE' to print the logo in header or top of page.

But it is coming in right most side.

How to align it to left side or center ??

PFA...

1 ACCEPTED SOLUTION

0 Kudos

Hi,

Refer the code below:-

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

      i_callback_program                = sy-repid

      i_callback_html_top_of_page       = 'HTML_TOP_OF_PAGE'

      it_fieldcat                       = it_field

    TABLES

      t_outtab                          = it_final

    EXCEPTIONS

     program_error                     = 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.

*&---------------------------------------------------------------------*

*&      Form  html_top_of_page

*&---------------------------------------------------------------------*

*       TO WRITE THE HEADER AS HTML

*----------------------------------------------------------------------*

FORM html_top_of_page USING top TYPE REF TO cl_dd_document.

  DATA: l_text(255) TYPE c.

  DATA: l_url TYPE string VALUE 'http://www.google.com/'.

  DATA: l_txt TYPE sdydo_text_element VALUE 'Google'.

  DO 180 TIMES.

    l_text+sy-index(1) = '*'.

  ENDDO.

  CALL METHOD top->add_text

    EXPORTING

      text      = 'Hello world '

      sap_style = 'heading'.

  CALL METHOD top->add_gap

    EXPORTING

      width = 200.

  CALL METHOD top->add_picture

    EXPORTING

      picture_id = 'ENJOYSAP_LOGO'.

  CALL METHOD top->new_line( ).

  CALL METHOD top->add_text

    EXPORTING

      text = l_text.

  CALL METHOD top->add_link

    EXPORTING

      url  = l_url

      text = l_txt.

ENDFORM.                    "html_top_of_page

I hope it will help you ,

Best regards,

Suresh

5 REPLIES 5

alessandroieva
Active Participant
0 Kudos

Hi,

you try with below code:

* Logo

   CALL METHOD o_dyndoc_id->vertical_split

     EXPORTING

       split_area  = o_dyndoc_id

       split_width = '70%'                -> change this value for to move logo

     IMPORTING

       right_area  = logo_area.

     logo_enel = 'ZLOGO'.

   CALL METHOD logo_area->add_picture

     EXPORTING

       picture_id = logo_enel

       width      = '200'.



let me know,


AI

0 Kudos

Hi Leva,

Thnks for the quick reply..

I used the above code in my FORM :- TOP

But geetin the syntax error as :

Field "O_DYNDOC_ID" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. .

NOW ??

Regards.

0 Kudos

Hi,

Refer the code below:-

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

      i_callback_program                = sy-repid

      i_callback_html_top_of_page       = 'HTML_TOP_OF_PAGE'

      it_fieldcat                       = it_field

    TABLES

      t_outtab                          = it_final

    EXCEPTIONS

     program_error                     = 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.

*&---------------------------------------------------------------------*

*&      Form  html_top_of_page

*&---------------------------------------------------------------------*

*       TO WRITE THE HEADER AS HTML

*----------------------------------------------------------------------*

FORM html_top_of_page USING top TYPE REF TO cl_dd_document.

  DATA: l_text(255) TYPE c.

  DATA: l_url TYPE string VALUE 'http://www.google.com/'.

  DATA: l_txt TYPE sdydo_text_element VALUE 'Google'.

  DO 180 TIMES.

    l_text+sy-index(1) = '*'.

  ENDDO.

  CALL METHOD top->add_text

    EXPORTING

      text      = 'Hello world '

      sap_style = 'heading'.

  CALL METHOD top->add_gap

    EXPORTING

      width = 200.

  CALL METHOD top->add_picture

    EXPORTING

      picture_id = 'ENJOYSAP_LOGO'.

  CALL METHOD top->new_line( ).

  CALL METHOD top->add_text

    EXPORTING

      text = l_text.

  CALL METHOD top->add_link

    EXPORTING

      url  = l_url

      text = l_txt.

ENDFORM.                    "html_top_of_page

I hope it will help you ,

Best regards,

Suresh

0 Kudos

Hi Babu,

Thnks for the quick reply..

I used the above code in my FORM :- TOP

But geetin the syntax error as :

Field "TOP" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. .

NOW ??

Regards.

alessandroieva
Active Participant
0 Kudos

Hi,

or you try to look this post:

let me know,

AI