02-28-2011 9:04 AM
Hi All,
I am using the FM
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = lv_repid
i_internal_tabname = 'GT_FINAL'
i_structure_name = 'Z_BIL_R_R0111_STR'
i_inclname = lv_repid
i_bypassing_buffer = lvc_yes
changing
ct_fieldcat = lt_fieldcat.
to papulate the fieldcat.
When i am manully papulating the Field catalog i am able to dispaly al the fields but when use *REUSE_ALV_FIELDCATALOG_MERGE
*THE FM 'REUSE_ALV_GRID_DISPLAY' goes to dump and im not able to figure out the problem.
I am using as below
Call the ALV function module for list display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = lv_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
it_fieldcat = lt_fieldcat
is_layout = ls_layout
TABLES
t_outtab = p_it_final.
In error analysis i get only this message
*You attempted to access an unassigned field symbol*
*(data segment "-1").* This error may occur if
- You address a typed field symbol before it has been set w
ASSIGN
- You address a field symbol that pointed to the line of an
internal table that was deleted
- You address a field symbol that was previously reset usin
UNASSIGN or that pointed to a local field that no
longer exists
- You address a global function interface, although the
respective function module is not active - that is, is
not in the list of active calls. The list of active calls
can be taken from this short dump.
may i know the solution for the above.
Thanks,
03-02-2011 1:38 PM
Hi,
ALV Display Help using field catalog merge
Regarding on these query, Go through sample programs on grid .
I pasted that link, You can easily understood follow below link.
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
It will helps to you.
Regards,
Sekhar
02-28-2011 9:16 AM
Hi,
Its only because of Fieldcatalog problem.
Only one thing you need to take care is that when you refer any dictionary field do not use TYPE Instead use LIKE statement, then It works.
You can have a example..
TYPE-POOLS: SLIS.
*
DATA: PROGNAME LIKE SY-REPID,
GT_FCAT0 TYPE SLIS_T_FIELDCAT_ALV,
GT_FCAT1 TYPE SLIS_T_FIELDCAT_ALV.
*
DATA: IT_MARA0 TYPE TABLE OF MARA.
*
DATA: BEGIN OF IT_MARA1 OCCURS 0,
MATNR LIKE MARA-MATNR,
MATKL LIKE MARA-MATKL,
END OF IT_MARA1.
*
PROGNAME = SY-REPID.
* internal table definition with type of a structure
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = PROGNAME
I_INTERNAL_TABNAME = 'IT_MARA0'
I_STRUCTURE_NAME = 'MARA'
I_CLIENT_NEVER_DISPLAY = 'X'
CHANGING
CT_FIELDCAT = GT_FCAT0[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
* own internal table definition
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = PROGNAME
I_INTERNAL_TABNAME = 'IT_MARA1'
I_INCLNAME = PROGNAME
I_CLIENT_NEVER_DISPLAY = 'X'
CHANGING
CT_FIELDCAT = GT_FCAT1[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
*
Thanks
Arbind
03-02-2011 1:38 PM
Hi,
ALV Display Help using field catalog merge
Regarding on these query, Go through sample programs on grid .
I pasted that link, You can easily understood follow below link.
http://www.sap-img.com/abap/sample-programs-on-alv-grid.htm
It will helps to you.
Regards,
Sekhar
03-02-2011 1:52 PM
Hello,
If 'Z_BIL_R_R0111_STR' is a DDIC structure & GT_FINAL is an internal table of 'Z_BIL_R_R0111_STR' structure, then just comment out the line I_INTERNAL_TABNAME & your fieldcat should get generated:
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = lv_repid
* i_internal_tabname = 'GT_FINAL' "--> Comment out this line
i_structure_name = 'Z_BIL_R_R0111_STR'
i_inclname = lv_repid
i_bypassing_buffer = lvc_yes
changing
ct_fieldcat = lt_fieldcat.
BR,
Suhas