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

problem in alv report

Former Member
0 Likes
726

Hi Abapers,

Iam trying a report using alv to print heading . its not working.Will anybody help me where i done the mistake.

data : wa type standard table of itab1 initial size 0 ,

fcat type slis_t_fieldcat_alv with header line,

t_event TYPE slis_t_event,

t_heading TYPE slis_t_listheader.

select-options : vendor for lfa1-lifnr.

select lifnr name1 land1 from lfa1 into table wa where lifnr in vendor.

refresh t_event.

REFRESH FCAT.

fcat-col_pos = '1'.

fcat-fieldname = 'LIFNR'.

FCAT-REF_TABNAME = 'LFA1'.

FCAT-TABNAME = 'WA'.

APPEND FCAT.

fcat-col_pos = '2'.

fcat-fieldname = 'NAME1'.

FCAT-REF_TABNAME = 'LFA1'.

FCAT-TABNAME = 'WA'.

APPEND FCAT.

fcat-col_pos = '3'.

fcat-fieldname = 'LAND1'.

FCAT-REF_TABNAME = 'LFA1'.

FCAT-TABNAME = 'WA'.

APPEND FCAT.

*top-of-page-heading.

perform top-of-page using t_heading t_event.

*DATA DISPLAY

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 = ' '

  • 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 = FCAT[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = T_EVENT

  • 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 = WA

  • 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 top-of-page

&----


  • text

----


  • -->P_T_HEADING text

  • -->P_T_EVENT text

----


form top-of-page using t_heading type slis_t_listheader

t_event type slis_t_event.

DATA: x_heading TYPE slis_listheader,

x_event TYPE LINE OF slis_t_event.

CLEAR t_heading[].

CLEAR x_heading.

x_heading-typ = 'H'.

x_heading-info = ' Bevcon Wayors Pvt. Ltd. '.

APPEND x_heading TO t_heading.

CLEAR x_heading.

x_heading-typ = 'S'.

x_heading-info = sy-repid.

APPEND x_heading TO t_heading.

*top-of-page-event.

x_event-name = slis_ev_top_of_page.

x_event-form = 'TOP'.

APPEND x_event TO t_event.

endform. " top-of-page

FORM TOP.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = T_HEADING

  • I_LOGO =

  • I_END_OF_LIST_GRID =

  • I_ALV_FORM =

.

ENDFORM.

Regards,

Pratima.M

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
697

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 = *' top122' *----


>pass 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 = FCAT[]

IT_EXCLUDING =

IT_SPECIAL_GROUPS =

IT_SORT =

IT_FILTER =

IS_SEL_HIDE =

I_DEFAULT = 'X'

I_SAVE = ' '

IS_VARIANT =

IT_EVENTS = T_EVENT

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 = WA

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.

FORM TOP122.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = T_HEADING

I_LOGO =

I_END_OF_LIST_GRID =

I_ALV_FORM =

.

ENDFORM.

Hi Abapers,

Iam trying a report using alv to print heading . its not working.Will anybody help me where i done the mistake.

data : wa type standard table of itab1 initial size 0 ,

fcat type slis_t_fieldcat_alv with header line,

t_event TYPE slis_t_event,

t_heading TYPE slis_t_listheader.

select-options : vendor for lfa1-lifnr.

select lifnr name1 land1 from lfa1 into table wa where lifnr in vendor.

refresh t_event.

REFRESH FCAT.

fcat-col_pos = '1'.

fcat-fieldname = 'LIFNR'.

FCAT-REF_TABNAME = 'LFA1'.

FCAT-TABNAME = 'WA'.

APPEND FCAT.

fcat-col_pos = '2'.

fcat-fieldname = 'NAME1'.

FCAT-REF_TABNAME = 'LFA1'.

FCAT-TABNAME = 'WA'.

APPEND FCAT.

fcat-col_pos = '3'.

fcat-fieldname = 'LAND1'.

FCAT-REF_TABNAME = 'LFA1'.

FCAT-TABNAME = 'WA'.

APPEND FCAT.

*top-of-page-heading.

perform top-of-page using t_heading t_event.

*DATA DISPLAY

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 = ' '

  • 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 = FCAT[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = T_EVENT

  • 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 = WA

  • 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 top-of-page

&----


  • text

----


  • -->P_T_HEADING text

  • -->P_T_EVENT text

----


form top-of-page using t_heading type slis_t_listheader

t_event type slis_t_event.

DATA: x_heading TYPE slis_listheader,

x_event TYPE LINE OF slis_t_event.

CLEAR t_heading[].

CLEAR x_heading.

x_heading-typ = 'H'.

x_heading-info = ' Bevcon Wayors Pvt. Ltd. '.

APPEND x_heading TO t_heading.

CLEAR x_heading.

x_heading-typ = 'S'.

x_heading-info = sy-repid.

APPEND x_heading TO t_heading.

*top-of-page-event.

x_event-name = slis_ev_top_of_page.

x_event-form = 'TOP'.

APPEND x_event TO t_event.

endform. " top-of-page

FORM TOP.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = T_HEADING

  • I_LOGO =

  • I_END_OF_LIST_GRID =

  • I_ALV_FORM =

.

ENDFORM.

Regards,

Pratima.M

5 REPLIES 5
Read only

Former Member
0 Likes
698

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 = *' top122' *----


>pass 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 = FCAT[]

IT_EXCLUDING =

IT_SPECIAL_GROUPS =

IT_SORT =

IT_FILTER =

IS_SEL_HIDE =

I_DEFAULT = 'X'

I_SAVE = ' '

IS_VARIANT =

IT_EVENTS = T_EVENT

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 = WA

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.

FORM TOP122.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = T_HEADING

I_LOGO =

I_END_OF_LIST_GRID =

I_ALV_FORM =

.

ENDFORM.

Read only

0 Likes
697

Hi..,

Its not printing the header .

Regards,

Pratima.M

Read only

0 Likes
697

Hi..,

My problem is solved with ur reply..

Thanks & regards.

Pratima.M

Read only

Former Member
0 Likes
697

Hi,

First update the table in the same form TOP instead of doing it in other subroutine form and pass the TOP parameter in the I_CALLBACK_TOP_OF_PAGE = 'TOP' .

Regards,

Nandha

Read only

0 Likes
697

Hi..,

I got data in the output but its not able to print the heading.

Regards,

Pratima.M