Skip to Content
0
Former Member
Jul 03, 2006 at 09:52 AM

Field catalog not found - ALV problem

281 Views

Hi All,

I am getting the termination message "Field catalog not found " when i am executing the following program..

&----


*& Report ZSCG_ALV_HIER

*&

&----


*&

*&

&----


REPORT zscg_alv_hier.

  • selection screen

TABLES : vbap, vbak.

SELECTION-SCREEN BEGIN OF BLOCK b1.

SELECT-OPTIONS : s_sorg FOR vbak-vkorg,

s_dchan FOR vbak-vtweg,

s_div FOR vbak-spart,

s_sdtyp FOR vbak-auart,

s_cust FOR vbak-kunnr,

s_date FOR vbak-erdat,

s_matnr FOR vbap-matnr.

SELECTION-SCREEN END OF BLOCK b1.

INCLUDE zscg_alv_hiertop.

INCLUDE zscg_alv_hierf01.

INITIALIZATION.

g_repid = sy-repid.

  • PERFORM e03_eventtab_build USING gt_events[].

START-OF-SELECTION.

  • get header data

SELECT vbeln kunnr FROM vbak

INTO TABLE t_temp

WHERE erdat IN s_date

AND auart IN s_sdtyp

AND vkorg IN s_sorg

AND vtweg IN s_dchan

AND spart IN s_div.

IF NOT t_temp[] IS INITIAL.

SELECT vbeln posnr matnr arktx zmeng netpr FROM vbap

INTO TABLE t_item

FOR ALL ENTRIES IN t_temp

WHERE vbeln =

t_temp-vbeln

AND matnr IN s_matnr.

ENDIF.

END-OF-SELECTION.

CLEAR : wa_temp, wa_item, wa_header.

LOOP AT t_item INTO wa_item.

AT NEW vbeln.

READ TABLE t_temp INTO wa_temp WITH KEY vbeln = wa_item-vbeln.

IF sy-subrc EQ 0.

wa_header-vbeln = wa_temp-vbeln.

APPEND wa_header TO t_header.

wa_item-kunnr = wa_temp-kunnr.

MODIFY t_item FROM wa_item TRANSPORTING kunnr WHERE vbeln =

wa_item-vbeln.

ENDIF.

ENDAT.

ENDLOOP.

  • construct the ALV display

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = g_repid

i_internal_tabname = 'T_HEADER'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = g_repid

i_bypassing_buffer = 'X'

i_buffer_active = ' '

CHANGING

ct_fieldcat = gt_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.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = g_repid

i_internal_tabname = 'T_ITEM'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

i_inclname = g_repid

i_bypassing_buffer = 'X'

i_buffer_active = ' '

CHANGING

ct_fieldcat = gt_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.

g_tabname_header = 'T_HEADER'.

g_tabname_item = 'T_ITEM'.

  • CLEAR gs_keyinfo.

gs_keyinfo-header01 = 'VBELN'.

gs_keyinfo-item01 = 'VBELN'.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

I_CALLBACK_PROGRAM = g_repid

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • IS_LAYOUT =

IT_FIELDCAT = gt_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_DEFAULT = 'X'

I_SAVE = 'A'

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

i_tabname_header = g_tabname_header

i_tabname_item = g_tabname_item

  • I_STRUCTURE_NAME_HEADER =

  • I_STRUCTURE_NAME_ITEM =

is_keyinfo = gs_keyinfo

  • IS_PRINT =

  • IS_REPREP_ID =

I_BYPASSING_BUFFER = 'X'

I_BUFFER_ACTIVE = ' '

  • IR_SALV_HIERSEQ_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

tables

t_outtab_header = t_header

t_outtab_item = t_item

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.

-


&----


*& Include ZSCG_ALV_HIERTOP

&----


TYPE-POOLS : slis.

TYPES: BEGIN OF ty_header,

vbeln LIKE vbak-vbeln,

END OF ty_header,

BEGIN OF ty_item,

vbeln LIKE vbak-vbeln,

posnr LIKE vbap-posnr,"itm num

matnr LIKE vbap-matnr,"mat num

arktx LIKE vbap-arktx,"item text

zmeng LIKE vbap-zmeng,"qty

netpr LIKE vbap-netpr,

kunnr LIKE vbak-kunnr,

END OF ty_item,

BEGIN OF ty_item1,

posnr LIKE vbap-posnr,"itm num

matnr LIKE vbap-matnr,"mat num

arktx LIKE vbap-arktx,"item text

zmeng LIKE vbap-zmeng,"qty

netpr LIKE vbap-netpr,

kunnr LIKE vbak-kunnr,

END OF ty_item1,

BEGIN OF ty_temp,

vbeln LIKE vbak-vbeln,

kunnr LIKE vbak-kunnr,

END OF ty_temp.

DATA : t_header TYPE STANDARD TABLE OF ty_header,

wa_header LIKE LINE OF t_header,

t_item TYPE STANDARD TABLE OF ty_item,

wa_item LIKE LINE OF t_item,

t_item1 TYPE STANDARD TABLE OF ty_item,

wa_item1 LIKE LINE OF t_item,

t_temp TYPE STANDARD TABLE OF ty_temp,

wa_temp LIKE LINE OF t_temp,

g_tabname_header TYPE slis_tabname,

g_tabname_item TYPE slis_tabname,

g_repid LIKE sy-repid.

DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,

gs_layout TYPE slis_layout_alv,

gs_keyinfo TYPE slis_keyinfo_alv,

gt_sp_group TYPE slis_t_sp_group_alv,

gt_events TYPE slis_t_event,

gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.

.

Please help me out with regard to this.

Thanks in advance,

Sharat