Application Development and Automation 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: 
Read only

Alv Grid Header text

Former Member
0 Likes
640

Hi,

i am using alv grid.on my selection screen there is one parameter COMPANY CODE.

Suppose user enter company code as 8888

the report header looks like below

8888-Company Code

MM/DD/YY Report as of MM/DD/YY PAGE -'A'.

How can i do this.Please help me /Thanks in ADvance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
609

u can use the reuse_alv_commentary_write function module.

this is to be called in the top of page event.

create a subroutine with name top_of_page

pass this value 'TOP_OF_PAGE' in the parameter I_CALLBACK_TOP_OF_PAGE

something like the following code might work for you

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = sy-repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ''

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

IT_FIELDCAT = gt_fieldcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = lt_events[]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = itab[]

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

form top-of-page.

data: t_header type slis_t_listheader,

wa_header type slis_listheader,

t_line like wa_header-info,

ld_lines type i,

ld_linesc(10) type c.

  • Date

wa_header-typ = 'S'.

wa_header-key = 'Company Code: '.

wa_header-info = p_bukrs . "your company code value

append wa_header to t_header.

clear: wa_header.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = t_header.

  • i_logo = 'Z_LOGO'.

endform.

i have just pasted my rough code...adjust it for your requirement.

Message was edited by:

Priyank Jain

4 REPLIES 4
Read only

Former Member
0 Likes
610

u can use the reuse_alv_commentary_write function module.

this is to be called in the top of page event.

create a subroutine with name top_of_page

pass this value 'TOP_OF_PAGE' in the parameter I_CALLBACK_TOP_OF_PAGE

something like the following code might work for you

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = sy-repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ''

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

IT_FIELDCAT = gt_fieldcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = lt_events[]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = itab[]

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

form top-of-page.

data: t_header type slis_t_listheader,

wa_header type slis_listheader,

t_line like wa_header-info,

ld_lines type i,

ld_linesc(10) type c.

  • Date

wa_header-typ = 'S'.

wa_header-key = 'Company Code: '.

wa_header-info = p_bukrs . "your company code value

append wa_header to t_header.

clear: wa_header.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

it_list_commentary = t_header.

  • i_logo = 'Z_LOGO'.

endform.

i have just pasted my rough code...adjust it for your requirement.

Message was edited by:

Priyank Jain

Read only

Former Member
0 Likes
609

Hi Lalit,

You have to use the FM REUSE_ALV_COMMENTARY_WRITE.

in that you have to initialize the header first then put that value in the IT_LIST_COMMENTARY parameter (Exporting value).

Thanks,

Ram M

Read only

Former Member
0 Likes
609

Hi

i want the header output in following format

mm/dd/yyyy Company Code Page

left aligned center right aligned

is it possible?

if yes how can i do it???

Read only

0 Likes
609

Hi,

No you can not have output in this format.

you can have all the fields left aligned only ( that will come by default).

and use reuse_alv_commentry_write to have them in ALV output.........

regards,

Ruchika