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: 

reuse_alv_commentary_write

Former Member
0 Kudos

Hi,

While using REUSE_ALV_COMMENTARY_WRITE is it possible to position the details at the header.The information which we give in header-key.Can we make it to be displayed at any position we want or will it be left alligned only.

For example,

GW_LISTHEADER-TYP = 'S'.

GW_LISTHEADER-KEY = 'UserName '.

GW_LISTHEADER-INFO = SY-UNAME.

APPEND GW_LISTHEADER TO GI_LISTHEADER.

CLEAR GW_LISTHEADER.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = GI_LISTHEADER.

Will Username be left alligned or can we postion and format it

4 REPLIES 4

Former Member
0 Kudos

Hi,

Yes By default they are left Justified.

Former Member
0 Kudos

Hi,

By default is left aligned only. You can give any postition kind of thing here. Forcefully if you want move it towards right, then probably using the space before kind of thing may be helpful.

I don't think alighment is possible.

Regards,

Santhosh.

Former Member
0 Kudos

Hi,

If you wish to format the text in the ALV header, like aligning and changing the font and size, you need to use HTML_TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_html_top_of_page  = 'HTML_TOP_OF_PAGE'

Write a Subroutine with the name 'HTML_TOP_OF_PAGE' -

FORM html_top_of_page USING document TYPE REF TO cl_dd_document. 

CALL METHOD document->add_gap
    EXPORTING
      width = '100'.

  CALL METHOD document->add_text
    EXPORTING
      text      = 'Your text here'
      sap_style = 'HEADING'.

  CALL METHOD document->new_line.

ENDFORM.

Check the attributes and methods of the class CL_DD_DOCUMENT for more text formatting.

Hope this helps.

Regards,

Himanshu

Former Member
0 Kudos

Hi,

Check this link

[link|https://forums.sdn.sap.com/click.jspa?searchID=25685847&messageID=7166145]

Hope it helps