Skip to Content
0
Oct 24, 2008 at 02:05 PM

ALV GRID IS NOT WORKING

246 Views

HI every one,

I want to dispaly alv grid. but i came to know that without designing fieldcat by using the below FM we can display the output in grid formate..buut i didn't grid formate by using the below code..

can any one tell me the wayy.

REPORT Z3MGLALV21.

TYPE-POOLS: slis.

DATA: BEGIN OF itab OCCURS 0,

matnr(18),

werks(4),

ekgrp(3),

END OF itab.

DATA: i_fieldcat TYPE TABLE OF slis_fieldcat_alv,

w_fieldcat TYPE slis_fieldcat_alv.

SELECT matnr

werks

ekgrp

FROM marc

INTO TABLE itab.

  • WHERE WERKS = '1000'.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-CPROG

I_INTERNAL_TABNAME = 'ITAB'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = sy-cprog

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = i_fieldcat

  • EXCEPTIONS

  • INCONSISTENT_INTERFACE = 1

  • PROGRAM_ERROR = 2

  • OTHERS = 3

.

IF sy-subrc <> 0.

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

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

ENDIF.