on 04-19-2006 3:04 PM - last edited on 02-04-2024 4:03 AM by postmig_api_4
Hi all,
I have a internal tables with 56 fields i want to display it in a ALV .I want to have the fieldcatalog for it.I dont to generate it manually.I tried to use function module 'LVC_FIELDCATALOG_MERGE' in that i passed my internal table and tried to get the field catalog.But i am not getting it.But if i pass 'SFLIGHT'.I am getting the fieldcat.Is it necessary to have a structure to be created in SE11 to get get the fieldcat using the function module.Does any know ???
regards
Ahasan
Hi,
try this way....
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-REPID
I_INTERNAL_TABNAME = 'ITAB'
I_INCLNAME = SY-REPID
CHANGING
CT_FIELDCAT = IT_FIELDCAT
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.
Regards
vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
By creating a structure it becomes easy for you modify the catalog in case you have to modify your report at a later point of time.
The changes to the strcuture will automatically reflect in the field catalog as well as the internal table as you can use the same structure for creating the internal table as well.
Are you going to ALV Controls / REUSE functions?
1. If you are using REUSE functions, you can try creating the field catalog using the REUSE_ALV_FIELDCATALOG_MERGE with the internal table, but it is having some problems.
2. If you are using controls, you cannot use the field catalog used by the REUSE function as the TYPE of the field catalog is different.
Given all that, even if you are successful, its recommended to go for a structure in SE11 and use that, else create it manually - but then again doesn't make sense as the no. of fields is on the higher side.
Regards,
Ravi
Note : Please mark the helpful answers
There is no other way. Yo cona only defin it with LIKE or bouit whole fieldcat manually.
BR, Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this using subroutine
PERFORM fieldcatalog_merge TABLES st_fieldcat_lvc itab.
in that perform
FORM fieldcatalog_merge TABLES p_fieldcatalog p_it_name.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'P_IT_NAME'
CHANGING
ct_fieldcat = p_fieldcatalog[].
*
ENDFORM. " fieldcatalog_merge
I am not sure of this , i had seen in one program
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi !!
The function work excellent only with fields that have reference in Dictionary (SE11). Try to find references - and define fields:
lv_field Like mara-matnr for example - or build your fieldcat manualy.
BR, Jacek
P>S Please reward helpful answers
Message was edited by: Jacek S³owikowski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
the data declarations for the fields of the internal table you are declaring should be of the type LIKE.
regards,
vidya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
pls show ur declaration of internal table and the code for FM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi !!
Thera are some problems with that function. If you can try to define fields in your internal table wit use of LIKE.
BR, Jacek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.