Skip to Content
0
Former Member
Aug 03, 2008 at 02:14 PM

ALVS

10 Views

HI ALL,

1)

This is a hierarchial alv report..

in this, i could not see the field catalog of item data(vbap).

only fieldname posnr(item ) is displayed .

can anybody kindly tell me where i have gone wrong.

2) is ther a possibility of interactive reporting in blocked alv's?

THANK YOU.

YATEENDRA.

REPORT ZHIERALV .

TYPE-POOLS: SLIS.

DATA: ITAB TYPE TABLE OF VBAK.

DATA: JTAB TYPE TABLE OF VBAP.

DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV.

DATA: S_KEY TYPE SLIS_KEYINFO_ALV.

START-OF-SELECTION.

PERFORM read_data.

PERFORM KEYINFO.

PERFORM CATALOG USING 'ITAB' 'VBAK'.

PERFORM CATALOG USING 'JTAB' 'VBAP'.

PERFORM DISPLAY.

**********************************************************************

FORM READ_DATA.

SELECT * FROM VBAK INTO TABLE ITAB UP TO 10 ROWS .

IF NOT ITAB IS INITIAL.

SELECT * FROM VBAP INTO TABLE JTAB UP TO 15 ROWS FOR ALL ENTRIES IN ITAB

WHERE VBELN =

ITAB-VBELN.

ENDIF.

ENDFORM.

************************************************************************

FORM KEYINFO.

CLEAR S_KEY.

S_KEY-HEADER01 = 'VBELN'.

S_KEY-ITEM01 = 'VBELN'.

S_KEY-HEADER02 = SPACE.

S_KEY-ITEM02 = 'POSNR'.

ENDFORM.

************************************************************************

FORM CATALOG USING F_TAB TYPE C F_STR TYPE C.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-CPROG

I_INTERNAL_TABNAME = F_TAB

I_STRUCTURE_NAME = F_STR

  • I_CLIENT_NEVER_DISPLAY = 'X'

  • I_INCLNAME =

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = IT_FCAT.

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

ENDFORM.

*********************************************************

FORM DISPLAY.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-CPROG

IT_FIELDCAT = IT_FCAT

I_TABNAME_HEADER = 'ITAB'

I_TABNAME_ITEM = 'JTAB'

IS_KEYINFO = S_KEY

TABLES

T_OUTTAB_HEADER = ITAB

T_OUTTAB_ITEM = JTAB.

ENDFORM.