Skip to Content
author's profile photo Former Member
Former Member

how we can put heading as a center one in top-of-page event in ALV grid?

How we can put heading as center and right justified

please help me in this regard

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Apr 14, 2008 at 02:12 AM

    Hi,

    To meet your criteria you need to use following piece of code.

    FORM TOP_OF_PAGE_SPLIT USING R_TOP TYPE REF TO CL_DD_DOCUMENT.

    DATA: S_TAB TYPE SDYDO_TEXT_TABLE,

    C_AREA TYPE REF TO CL_DD_AREA,

    TEXT TYPE SDYDO_TEXT_ELEMENT.

    TYPES: BEGIN OF TAB_TEXT,

    TEXT TYPE SDYDO_TEXT_ELEMENT,

    END OF TAB_TEXT.

    DATA: I_TEXT TYPE TABLE OF TAB_TEXT.

    DATA: W_TEXT TYPE TAB_TEXT.

    CALL METHOD R_TOP->INITIALIZE_DOCUMENT.

    CALL METHOD R_TOP->VERTICAL_SPLIT

    EXPORTING

    SPLIT_AREA = R_TOP

    SPLIT_WIDTH = '70%'

    IMPORTING

    RIGHT_AREA = C_AREA.

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    *CONCATENATE SY-DATUM4(2) ' / ' SY-DATUM6(2) ' / ' SY-DATUM(4) INTO DATE1.

    *CONCATENATE 'DATE' DATE1 INTO W_TEXT-TEXT SEPARATED BY ':'.

    W_TEXT-TEXT = 'GEMS TECHNO SOLUTIONS PVT LIMITED'.

    APPEND W_TEXT TO I_TEXT.

    W_TEXT-TEXT = 'PLOT NO.100,SECTOR 1'.

    APPEND W_TEXT TO I_TEXT.

    W_TEXT-TEXT = 'MVP DOUBLE ROAD'.

    APPEND W_TEXT TO I_TEXT.

    W_TEXT-TEXT = 'MVP COLONY,VIZAG'.

    APPEND W_TEXT TO I_TEXT.

    S_TAB[] = I_TEXT[].

    CALL METHOD C_AREA->ADD_TEXT

    EXPORTING

    TEXT_TABLE = S_TAB

    FIX_LINES = 'X'

    SAP_FONTSIZE = CL_DD_DOCUMENT=>MEDIUM

    SAP_EMPHASIS = CL_DD_DOCUMENT=>STRONG.

    *CALL METHOD R_TOP->ADD_GAP

    • EXPORTING

    • WIDTH = 60.

    TEXT = 'REPORT:'.

    CALL METHOD R_TOP->ADD_TEXT

    EXPORTING

    TEXT = TEXT

    SAP_EMPHASIS = 'STRONG'.

    CALL METHOD R_TOP->ADD_GAP

    EXPORTING

    WIDTH = 2.

    TEXT = SY-REPID.

    CALL METHOD R_TOP->ADD_TEXT

    EXPORTING

    TEXT = TEXT

    SAP_STYLE = 'KEY'.

    CALL METHOD R_TOP->NEW_LINE.

    TEXT = 'DATE:'.

    CALL METHOD R_TOP->ADD_TEXT

    EXPORTING

    TEXT = TEXT

    SAP_EMPHASIS = 'STRONG'.

    CALL METHOD R_TOP->ADD_GAP

    EXPORTING

    WIDTH = 8.

    TEXT = SY-DATUM.

    CALL METHOD R_TOP->ADD_TEXT

    EXPORTING

    TEXT = TEXT

    SAP_STYLE = 'KEY'.

    CALL METHOD R_TOP->NEW_LINE.

    ENDFORM.

    Activate the following parameter in REUSE_ALV_GRID_DISPLAY function module.

    I_CALLBACK_HTML_TOP_OF_PAGE = 'TOP_OF_PAGE_SPLIT'

    Reward,if useful.

    Thanks,

    Chandu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 14, 2008 at 02:24 AM

    Hi,

    If you have a Form for top of page event in your ALV, you can achieve this by including code in the form as follows.

    You have to use list line size available in system field sy-linsz.

    Steps are:

    Get the size of the out field using strlen(<field>)

    Calulate position where output should begin using string lenghth and sy-linsz.

    Position it as required by write at /n(m) <fields>

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.