‎2008 Mar 13 6:45 AM
Hello All,
I am having a strange problem with field label? I have created a table with three fields one is MANDT and and the remaining fields as PATID and PATNA.
I am maintaining the field label for these fields, but still i am not getting the names of the fields while i am calling the structure in my alv tree.
I d'nt know what is the problem here?
can any one tell me how can i solve this issue?
Regards,
Lisa
‎2008 Mar 13 6:49 AM
Hi
Set this field in field catalog for these fields
wa_fieldcat- SCRTEXT_L= 'MATERIAL'.
regards
Shiva
‎2008 Mar 13 8:12 AM
Hello Shiva,
I know this solution but my question is why i am not getting the field label name automatically? How do get the fieldname?
I am calling the function module 'LVC_FIELDCATALOG_MERGE' in order to get the attributes automatically.
Regards,
Lisa
‎2008 Mar 13 12:02 PM
Hi
goto se37 and enter the structure anem and check the returned values
Use the field REPTEXT from the FM return this is having value
Import parameters Value
I_BUFFER_ACTIVE
I_STRUCTURE_NAME MARA
I_CLIENT_NEVER_DISPLAY X
I_BYPASSING_BUFFER
I_INTERNAL_TABNAME I_MARA
Changing parameters Value
CT_FIELDCAT 0 Entries
Result: 204 Entries
‎2008 Mar 13 7:03 AM
Hi lisa,
This is not the problem with Data Dictionary,
While declaring the fieldcatalogue for thr GRID.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
I_STRUCTURE_NAME = 'ZTABLE'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
CHANGING
ct_fieldcat = gt_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.
If gt_fieldcat-fieldname = 'PATID'.
gs_fieldcat-ref_field = 'ZTABLE'.
modify gt_fieldcat from gs_fieldcat.
clear gs_fieldcat.
endif.
Because while calling the FM it is populatinh the fieldname
so you need to modify the fieldcatalogue with fieldname then it will pick the field labels from the Dictionary.
Hope this will solve your problem.
Regards,
‎2008 Mar 13 8:17 AM
Hello Madhavi,
I have already did that but still the problem persist. When i am passing the structure Sbook to LVC_FIELDCATALOG_MERGE i don't have this problem but when i pass my structure to the above FM, i have this problem.
Regards,
Lisa
‎2008 Mar 13 12:30 PM
hi try to use the tablename-fieldname of that field for internal table from which the data is displayed and while creating the field catalog,you will get it.for exampe as below
clear ls_fcat.
ls_fcat-fieldname = 'VKORG' .
ls_fcat-outputlen = '10' .
ls_fcat-coltext = 'VKORG' .
append ls_fcat to p_lt_fcat.
if still facing problem plz let me know..
Edited by: Anil T on Mar 13, 2008 1:30 PM
‎2008 Mar 13 4:38 PM
Do these fields (PATID and PATNA) have data elements assigned to them? If not, assign data elements to them and the text labels from the data elements should show up in your ALV headers.
‎2008 Mar 14 9:16 AM
please Check the data elemnts assigned to your fields should have fieldlabels defined.
you can check this by doble clickinmg on table field it will go to data element screen from where check 3 rd tab.
you will find 4 filed lables defined there . like for matnr
Length Field label
Short 10 Material
Medium 15 Material
Long 20 Material
Heading 18 Material
these are pulled in Alv. please chk the fild lables.
if you are using some standard data elemnt which doesnt have this.
you may need to cvraete z data elemnts to satisfy the requirement.
‎2008 Mar 14 9:29 AM
Hi,
use any one of the way
1. Give text in field catelog manualy
2. give Dic ref while creating Field catelog
3. use FM to create field catelog.