Skip to Content
0
Former Member
Jul 29, 2014 at 11:14 PM

Exception no field catalog available

1341 Views

Hi all:

I can not find my error, I have this exception : no field catalog available when I run this.

part 1:

*-----------------------------------------------------------------------

*---*

*Declaracion de includes

*-----------------------------------------------------------------------

*---*

INCLUDE ZREPORT01A. "Declaracion de variables

INCLUDE ZREPORT01B. " Declaracion ALV

INCLUDE ZREPORT01C. " Procedimientos

*-----------------------------------------------------------------------

*---*

*Proceso principal

*-----------------------------------------------------------------------

*---*

START-OF-SELECTION.

PERFORM get_data.

PERFORM fieldcat.

PERFORM build_alv_header.

end-of-SELECTION.

PERFORM salida.



include a:


* TABLES / NODES

*----------------------------------------------------------------------*

TABLES: y99_cine07.

*----------------------------------------------------------------------*

* Tipos

*----------------------------------------------------------------------*

TYPES: BEGIN OF ty_data.

INCLUDE STRUCTURE y99_cine07.

TYPES: END OF ty_data.

*----------------------------------------------------------------------*

* Tablas / Estructuras

*----------------------------------------------------------------------*

DATA: gt_data TYPE TABLE OF ty_data WITH HEADER LINE,

gs_data TYPE ty_data.


include b:


TYPE-POOLS: slis.

*----------------------------------------------------------------------*

* Data Decalaration

*----------------------------------------------------------------------*

data int_fcat type SLIS_T_FIELDCAT_ALV.

DATA: it_listheader TYPE slis_t_listheader,

wa_listheader TYPE slis_listheader.

DATA: wa_layout TYPE slis_layout_alv.


include c:


*&---------------------------------------------------------------------*

*& Form BUILD_ALV_HEADER

*&---------------------------------------------------------------------*

FORM build_alv_header .

* Type H is used to display headers i.e. big font

wa_listheader-typ = 'H'.

wa_listheader-info ='Reporte LP3'.

APPEND wa_listheader TO it_listheader.

CLEAR wa_listheader.

* Type S is used to display key and value pairs

wa_listheader-typ = 'S'.

wa_listheader-key = 'Date :' .

CONCATENATE sy-datum+6(2)

sy-datum+4(2)

sy-datum(4)

INTO wa_listheader-info

SEPARATED BY '/'.

APPEND wa_listheader TO it_listheader.

CLEAR wa_listheader.

* Type A is used to display italic font

wa_listheader-typ = 'A'.

wa_listheader-info ='Autor: Mejia Andrade, Roberto'.

APPEND wa_listheader TO it_listheader.

CLEAR wa_listheader.

ENDFORM. " BUILD_ALV_HEADER

*&---------------------------------------------------------------------*

*& Form top_of_page

*&---------------------------------------------------------------------*

FORM top_of_.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_listheader.

ENDFORM. "top_of_page

*&---------------------------------------------------------------------*

*& Form SALIDA

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* --> p1 text

* <-- p2 text

*----------------------------------------------------------------------*

FORM SALIDA .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_save = 'A'

i_callback_program = sy-repid

i_callback_top_of_page = 'TOP_OF_'

it_fieldcat = int_fcat

TABLES

t_outtab = gt_data.

ENDFORM. " SALIDA

*&---------------------------------------------------------------------*

*& Form GET_DATA

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* --> p1 text

* <-- p2 text

*----------------------------------------------------------------------*

FORM GET_DATA .

*----------------------------------------------------------------------*

* Obteniendo datos

*----------------------------------------------------------------------*

REFRESH gt_data.

SELECT *

INTO CORRESPONDING FIELDS OF TABLE gt_data

FROM y99_cine07.

ENDFORM. " GET_DATA

*&---------------------------------------------------------------------*

*& Form FIELDCAT

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* --> p1 text

* <-- p2 text

*----------------------------------------------------------------------*

FORM FIELDCAT .

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = sy-repid

I_INTERNAL_TABNAME = 'GT_DATA' "capital letters!

I_INCLNAME = sy-repid

CHANGING

CT_FIELDCAT = int_fcat

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

IF SY-SUBRC = 0.

CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

EXPORTING

textline1 = 'ALV TUVO EXITO'.

else.

CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'

EXPORTING

textline1 = 'ERROR LA CREACION DEL ALV'.

ENDIF.

ENDFORM. " FIELDCAT