Skip to Content

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

Runtime error in ALV demo

HI,

Runtime error in the below report as internal table IT_FIELDCAT is empty after the execution of FM

REUSE_ALV_FIELDCATALOG_MERGE.

Please tell me how do i rectify this error.

REPORT ZMY_ALV_COLORING_CELLS.

TYPE-POOLS SLIS.

DATA: BEGIN OF itab OCCURS 0,

BUKRS LIKE T001-BUKRS,

BUTXT LIKE T001-BUTXT,

END OF itab.

PARAMETERS: P_BUKRS TYPE TBUKRS.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BUKRS.

PERFORM F4_FOR_BUKRS.

&----


*& Form F4_FOR_BUKRS

----


FORM F4_FOR_BUKRS.

DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV ,

ES_SELFIELD TYPE SLIS_SELFIELD. " Get data

SELECT BUKRS

BUTXT

FROM T001

INTO TABLE itab

up to 10 rows .

  • Get field

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'ITAB'

CHANGING

CT_FIELDCAT = IT_FIELDCAT[].

LOOP AT IT_FIELDCAT.

IT_FIELDCAT-KEY = SPACE.

IF IT_FIELDCAT-FIELDNAME = 'BUTXT'.

IT_FIELDCAT-EMPHASIZE = 'C710'.

ENDIF.

IF IT_FIELDCAT-FIELDNAME = 'BUKRS'.

IT_FIELDCAT-EMPHASIZE = 'C610'.

ENDIF.

MODIFY IT_FIELDCAT.

ENDLOOP.

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

EXPORTING

I_TITLE = 'THIS IS FOR F4 IN COLOR'

I_TABNAME = 'ITAB'

IT_FIELDCAT = IT_FIELDCAT[]

IMPORTING

ES_SELFIELD = ES_SELFIELD

TABLES

T_OUTTAB = ITAB .

Thanks,

Ahmed.

Former Member
Not what you were looking for? View more on this topic or Ask a question