Skip to Content
0
Former Member
Jan 07, 2008 at 04:12 AM

help on alv

21 Views

REPORT z50875_alv.

TYPE-POOLS : slis.

TYPES: BEGIN OF st_ekpo,

ebeln TYPE ekpo-ebeln,

ebelp TYPE ekpo-ebelp,

matnr TYPE ekpo-matnr,

netwr TYPE ekpo-netwr,

END OF st_ekpo.

DATA: it_ekpo TYPE STANDARD TABLE OF st_ekpo WITH HEADER LINE,

it_fieldcat TYPE slis_t_fieldcat_alv,

wa_fieldcat TYPE slis_fieldcat_alv,

v_ebeln TYPE ekpo-ebeln,

wa_layout TYPE slis_layout_alv,

it_events TYPE slis_t_event, "events table

wa_events TYPE slis_alv_event,

it_headings TYPE slis_t_listheader,

wa_headings LIKE LINE OF it_headings.

SELECT-OPTIONS so_ebeln FOR v_ebeln.

START-OF-SELECTION.

SELECT ebeln ebelp matnr netwr

FROM ekpo

INTO TABLE it_ekpo

WHERE ebeln IN so_ebeln.

PERFORM fill_events_table.

PERFORM populate_feildcat.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

  • I_CALLBACK_PROGRAM = ' '

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'print_heading'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME = I_STRUCTURE_NAME

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE = I_GRID_TITLE

  • I_GRID_SETTINGS = I_GRID_SETTINGS

  • IS_LAYOUT = IS_LAYOUT

IT_FIELDCAT = IT_FIELDCAT

  • IT_EXCLUDING = IT_EXCLUDING

  • IT_SPECIAL_GROUPS = IT_SPECIAL_GROUPS

  • IT_SORT = IT_SORT

  • IT_FILTER = IT_FILTER

  • IS_SEL_HIDE = IS_SEL_HIDE

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT = IS_VARIANT

IT_EVENTS = IT_EVENTS[]

  • IT_EVENT_EXIT = IT_EVENT_EXIT

  • IS_PRINT = IS_PRINT

  • IS_REPREP_ID = 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_ALV_GRAPHICS

  • IT_HYPERLINK = IT_HYPERLINK

  • IT_ADD_FIELDCAT = IT_ADD_FIELDCAT

  • IT_EXCEPT_QINFO = IT_EXCEPT_QINFO

  • IR_SALV_FULLSCREEN_ADAPTER = IR_SALV_FULLSCREEN_ADAPTER

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER = E_EXIT_CAUSED_BY_CALLER

  • ES_EXIT_CAUSED_BY_USER = ES_EXIT_CAUSED_BY_USER

TABLES

t_outtab = IT_EKPO

  • 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 populate_feildcat

&----


FORM populate_feildcat .

wa_fieldcat-fieldname = 'EBELN'.

wa_fieldcat-seltext_l = 'DOCUMENT NUMBER'.

APPEND wa_fieldcat TO it_fieldcat.

wa_fieldcat-fieldname = 'EBELP'.

wa_fieldcat-seltext_l = 'ITEM DOCUMENT NUMBER'.

APPEND wa_fieldcat TO it_fieldcat.

wa_fieldcat-fieldname = 'MATNR'.

wa_fieldcat-seltext_l = 'MATERIAL'.

APPEND wa_fieldcat TO it_fieldcat.

wa_fieldcat-fieldname = 'NETWR'.

wa_fieldcat-seltext_l = 'NET VALUE'.

APPEND wa_fieldcat TO it_fieldcat.

wa_fieldcat-hotspot = 'X'.

wa_fieldcat-fix_column = 'X'.

ENDFORM. " populate_feildcat

&----


*& Form fill_events_table

&----


FORM fill_events_table .

  • CLEAR wa_events.

wa_events-name = 'TOP_OF_PAGE'.

wa_events-form = 'print_heading'.

APPEND wa_events TO it_events.

ENDFORM. " fill_events_table

&----


*& Form print_heading

&----


  • text

----


FORM print_heading.

CLEAR wa_headings.

wa_headings-typ = 'S'.

wa_headings-info = 'DEMO ON ALV REPORTS'.

APPEND wa_headings TO it_headings.

CLEAR wa_headings.

wa_headings-typ = 'H'.

wa_headings-info = 'PURCHASE ORDER ITEM DETAILS'.

APPEND wa_headings TO it_headings.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_headings[].

  • i_logo = 'mysap_logo_yellow.gif'.

  • I_END_OF_LIST_GRID = I_END_OF_LIST_GRID

  • I_ALV_FORM = I_ALV_FORM.

ENDFORM. "print_heading

this is my code and top-of-page event is not triggering...i am not able to find where the error is...can anyone help me out.