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

Header in ALV

Former Member
0 Likes
723

Hi Friends,

I want to create a header in alv as:

-


Potential Shelf Life Expectations CR11342

Technical Name: YSHELFLIFE

Client: 010

Date : 08/20/2007 User: OS0784

-


How can i create? kindly help me out.

I have written following code but its nt working.....

FORM events_get .

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = tb_events.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • for creating footer

READ TABLE tb_events INTO wa_events

WITH KEY name = slis_ev_end_of_page.

IF sy-subrc = 0.

wa_events-name = slis_ev_end_of_list.

wa_events-form = 'END_OF_PAGE'.

MODIFY tb_events FROM wa_events INDEX sy-tabix.

ENDIF.

  • for creating header

READ TABLE tb_events INTO wa_events

WITH KEY name = slis_ev_end_of_page.

IF sy-subrc = 0.

wa_events-name = slis_ev_end_of_list.

wa_events-form = 'TOP_OF_PAGE'.

MODIFY tb_events FROM wa_events INDEX sy-tabix.

ENDIF.

ENDFORM. " events_get

FORM TOP_OF_PAGE.

DATA: l_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader,

l_line LIKE wa_header-info.

CONCATENATE String Space

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CONCATENATE Text-210 string1

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CONCATENATE Text-212 sy-mandt

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CONCATENATE Text-012 date1

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CONCATENATE Text-010 user1

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = l_header

i_end_of_list_grid = 'X'.

ENDFORM.

Thanks in advance,

Radhika.

Hi Friends,

I want to create a header in alv as:

-


Potential Shelf Life Expectations CR11342

Technical Name: YSHELFLIFE

Client: 010

Date : 08/20/2007 User: OS0784

-


How can i create? kindly help me out.

I have written following code but its nt working.....

FORM events_get .

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = tb_events.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • for creating footer

READ TABLE tb_events INTO wa_events

WITH KEY name = slis_ev_end_of_page.

IF sy-subrc = 0.

wa_events-name = slis_ev_end_of_list.

wa_events-form = 'END_OF_PAGE'.

MODIFY tb_events FROM wa_events INDEX sy-tabix.

ENDIF.

  • for creating header

READ TABLE tb_events INTO wa_events

WITH KEY name = slis_ev_end_of_page.

IF sy-subrc = 0.

wa_events-name = slis_ev_end_of_list.

wa_events-form = 'TOP_OF_PAGE'.

MODIFY tb_events FROM wa_events INDEX sy-tabix.

ENDIF.

ENDFORM. " events_get

FORM TOP_OF_PAGE.

DATA: l_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader,

l_line LIKE wa_header-info.

CONCATENATE String Space

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CONCATENATE Text-210 string1

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CONCATENATE Text-212 sy-mandt

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CONCATENATE Text-012 date1

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CONCATENATE Text-010 user1

INTO l_line SEPARATED BY space.

wa_header-typ = 'S'.

wa_header-info = l_line.

APPEND wa_header TO l_header.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = l_header

i_end_of_list_grid = 'X'.

ENDFORM.

Thanks in advance,

Radhika.

4 REPLIES 4
Read only

Former Member
0 Likes
694

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

I_CALLBACK_PF_STATUS_SET = 'FM_ALV_SET_STATUS'

I_CALLBACK_USER_COMMAND = G_CALLBACK_UCOMM

I_HTML_HEIGHT_TOP = '180'

IS_LAYOUT = GS_LAYOUT

IT_FIELDCAT = GT_FIELDCAT_ALV

IS_VARIANT = G_ALV_VARIANT

<b> IT_EVENTS = GT_EVENTS</b>

IT_EVENT_EXIT = GT_EVENT_EXIT

IT_EXCLUDING = GT_EXCLUDING

TABLES

T_OUTTAB = GT_MESSAGE_TAB.

u have to call that events like this.

Regards

Peram

Read only

0 Likes
694

Yeah i have declared it...

FORM display .

  • function to display the output in alv

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = g_repid

it_fieldcat = tb_uom_cat

it_events = tb_events[]

TABLES

t_outtab = tb_fintab

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.

LEAVE TO SCREEN 0.

ENDFORM. " display

but still its not functioning.

Read only

Former Member
0 Likes
694

Hi Premraj

Inside the FORM TOP_OF_PAGE,

assign wa_header-info with each line you want to put as header

wa_header-typ = 'S'.

wa_header-info = YOUR REPORT NAME.

append wa_header to l_header.

clear wa_header.

wa_header-typ = 'S'.

write sy-datum to wa_header-info mm/dd/yyyy.

concatenate 'User ID:' sy-uname 'Date : ' wa_header-info

'Time: ' sy-uzeit0(2) ':' sy-uzeit2(2) ':' sy-uzeit+4(2)

into wa_header-info separated by space.

append wa_header to l_header.

clear wa_header.

FOR UPDATING UR CLIENT

DATA ZSYSTEM TYPE C.

CONCATENATE syst-sysid+0(3) syst-mandt INTO z_system.

wa_header-typ = 'S'.

wa_header-info = z_system.

append wa_header to l_header.

clear wa_header

Cheers

~Arun

Rewards Points if useful

Message was edited by:

Arun Shekhar

Read only

Former Member
0 Likes
694

hi

use the event top_of_list

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = it_events

exceptions

list_type_wrong = 1

others = 2.

if sy-subrc <> 0.

endif.

read table it_events into wa_events with key

name = 'TOP_OF_LIST'.

  • NAME = 'TOP_OF_PAGE'.

if sy-subrc = 0.

wa_events-form = 'TOP-OF-LIST'.

modify it_events from wa_events index sy-tabix.

endif.

in the form u write

form top-of-list.

format color col_positive.

Potential Shelf Life Expectations CR11342

Technical Name: YSHELFLIFE

Client: 010

Date : 08/20/2007 User: OS0784

endform. "TOP-OF-LIST

hope it serves ur purpose