Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

fieldcatalog not found in alv

Hi friends

can any one tell me why the field catalog is not found in the below program

can any bdy correct it

code :

TYPE-POOLS: slis.

TABLES :

scarr.

DATA :

it_scarr TYPE STANDARD TABLE OF scarr,

GT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV.

DATA :

wa_scarr TYPE scarr,

WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

SELECT-OPTIONS :

s_carrid FOR scarr-carrid.

START-OF-SELECTION.

PERFORM get_data_scarr.

END-OF-SELECTION.

perform fill_fieldcat.

PERFORM list_display.

&----


*& Form GET_DATA_SCARR

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_data_scarr .

SELECT *

INTO TABLE it_scarr

FROM scarr

WHERE carrid IN s_carrid.

IF sy-subrc NE 0.

MESSAGE i000(zsat) WITH 'No Data Found For Selection'.

LEAVE LIST-PROCESSING.

ENDIF.

ENDFORM. " GET_DATA_SCARR

&----


*& Form FILL_FIELDCAT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form FILL_FIELDCAT .

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = 'SY-REPID'

I_INTERNAL_TABNAME = 'IT_SCARR'

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.

endform. " FILL_FIELDCAT

&----


*& Form LIST_DISPLAY

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM list_display .

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

IT_FIELDCAT = GT_FIELDCAT

TABLES

t_outtab = IT_SCARR[]

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.

ENDFORM. " LIST_DISPLAY

Former Member
Former Member replied

HI,

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID ">> Donot pass the SY-REPID in single Quotes or hard code the program name in single Quotes
I_INTERNAL_TABNAME = 'IT_SCARR'
CHANGING
ct_fieldcat = GT_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS

= 3

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question