Skip to Content
0
Former Member
Dec 20, 2006 at 05:23 PM

OO ALV

29 Views

Hi all,

I'm creating an OO ALV grid. I'm using

FUNCTION 'LVC_FIELDCATALOG_MERGE'

I would like to use my own structure, but it only allows me to use

one from the dictionary, otherwise my grid is pt_fieldcat is empty like my grid.

here is a small sample of my code:

********************************************

*DATA DECLARATIONS

DATA: BEGIN OF I_RESULTS OCCURS 0,

PERNR LIKE P0002-PERNR,

VORNA LIKE P0002-VORNA,

NACHN LIKE P0002-NACHN,

END OF I_RESULTS.

DATA: GR_ALVGRID TYPE REF TO CL_GUI_ALV_GRID.

DATA: GC_CUSTOM_CONTROL_NAME TYPE SCRFNAME VALUE 'CC_ALV'.

DATA: GR_CCONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.

DATA: GT_FIELDCAT TYPE LVC_T_FCAT.

DATA: GS_LAYOUT TYPE LVC_S_LAYO.

********************************************

********************************************

*FORM

FORM PREPARE_FIELD_CATALOG CHANGING PT_FIELDCAT TYPE LVC_T_FCAT.

DATA LS_FCAT TYPE LVC_S_FCAT.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

I_STRUCTURE_NAME = 'I_RESULTS'

CHANGING

CT_FIELDCAT = PT_FIELDCAT[]

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

***************************************************

...

It only functions when I make I_STRUCTURE_NAME = pa00002

and DATA: BEGIN OF I_RESULTS OCCURS 0,

INCLUDE STRUCTURE PA0000,

END OF I_RESULTS.

otherwise I see only an empty grid on my screen. When it comes out

of that function, my PT_FIELDCAT[] is empty.

Thanks.

Warren