Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

in whcih cases we ahve to use reuse_alv_fieldcatalog_merge

Former Member
0 Kudos

hi gurus

can any one suggest me

in which cases we have to use reuse_alv_fieldcatalog_merge

i created a final internal table with types

than i passed the parameters to that function

i am getting an error

how to solve that problem.

instead of fill the catalog manually.

thank you

regards

kals.

2 REPLIES 2

Former Member
0 Kudos

Hi,

You didn't give the error which u got.

Juat have a look on the following example code,

TYPE-POOLS: SLIS.

TABLES: LFA1.

SELECT-OPTIONS: LIFNR FOR LFA1-LIFNR.

DATA: BEGIN OF ITAB OCCURS 0,

LIFNR LIKE LFA1-LIFNR,

NAME1 LIKE LFA1-NAME1,

ORT01 LIKE LFA1-ORT01,

LAND1 LIKE LFA1-LAND1,

REGIO LIKE LFA1-REGIO,

END OF ITAB.

SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 5 ROWS.

DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,

HEADER TYPE SLIS_T_LISTHEADER WITH HEADER LINE,

FLDCAT TYPE SLIS_T_FIELDCAT_ALV.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'ITAB'

  • I_STRUCTURE_NAME = ITAB

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = SY-REPID

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = FLDCAT

  • 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_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = SY-REPID

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

IT_FIELDCAT = FLDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = ITAB

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

DATA: S(10).

S = 'TO'.

FORM TOP-OF-PAGE.

HEADER-TYP = 'S'.

HEADER-KEY = 'LIFNR'.

CONCATENATE LIFNR-LOW LIFNR-HIGH INTO HEADER-INFO SEPARATED BY SPACE.

APPEND HEADER.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = HEADER[] .

ENDFORM.

Reward,if useful.

Thanks,

Chandu

Former Member
0 Kudos

Generally if we have to create field catalog for many columns (Suppose 20 or more output columns) we use the reuse_alv_fieldcatalog_merge FM as it became difficult to create field catalog for as many fields using manual process.

We also use reuse_alv_fieldcatalog_merge in case of hirarchal ALV or in a situation we want all the field catalog elements to be used.

To solve your error while creating field catalog using reusealv_fieldcatalog_merge, we need to know what error you are getting._