07-23-2008 3:26 PM
Hello experts,
I am using the following function module to build my ALV catalog:
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZLRLEXC_QUANTS_X_MATERIAL'
i_internal_tabname = 'ALV_ITAB'
i_inclname = 'ZLRLEXC_QUANTS_X_MATERIAL_TOP'
CHANGING
ct_fieldcat = field.
IF sy-subrc <> 0.
WRITE: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_FIELDCATALOG_MERGE'.
ENDIF.
The problem that I'm facing is that the "field" internal table does not contain any information after processing, and the odd thing is that sy-subrc = 0.
Any help would be highly appreciate it!
Regards,
-C
07-23-2008 3:31 PM
data: v_repid type sy-repid.
v_repid = 'ZLRLEXC_QUANTS_X_MATERIAL_TOP'
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = SY-REPID
i_internal_tabname = 'ALV_ITAB'
i_inclname = V_REPID
CHANGING
ct_fieldcat = field.
IF sy-subrc 0.
WRITE: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_FIELDCATALOG_MERGE'.
ENDIF.
All the Internal tables field should be defined using LIKE
you should define in the below mentioned way...
Data: begin of itab occurs 0,
matnr like mara-matnr,
end of itab.
07-23-2008 3:28 PM
07-23-2008 3:30 PM
use like this:
DATA: lt_fieldcat TYPE slis_t_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = 'FAGL_S_RFBELJ10_COMPANY_CODES'
CHANGING
ct_fieldcat = lt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS
it should work.
Amit.
07-23-2008 3:31 PM
data: v_repid type sy-repid.
v_repid = 'ZLRLEXC_QUANTS_X_MATERIAL_TOP'
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = SY-REPID
i_internal_tabname = 'ALV_ITAB'
i_inclname = V_REPID
CHANGING
ct_fieldcat = field.
IF sy-subrc 0.
WRITE: 'SY-SUBRC: ', sy-subrc, 'REUSE_ALV_FIELDCATALOG_MERGE'.
ENDIF.
All the Internal tables field should be defined using LIKE
you should define in the below mentioned way...
Data: begin of itab occurs 0,
matnr like mara-matnr,
end of itab.
07-23-2008 4:02 PM
Thanks Vijay... you nailed the issue.. I was using "type" instead of "like" when creating the ALV_ITAB internal table.
Thanks everyone for you input!
Regards,
-C
07-23-2008 3:34 PM
hi did you defield like this..
data: alv_itab type SLIS_TABNAME .
data: ZLRLEXC_QUANTS_X_MATERIAL_TOP type TRDIR-NAME .
data: field type SLIS_T_FIELDCAT_ALV .