Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with field label

Former Member
0 Likes
2,064

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

9 REPLIES 9
Read only

Former Member
0 Likes
1,774

Hi

Set this field in field catalog for these fields

wa_fieldcat- SCRTEXT_L= 'MATERIAL'.

regards

Shiva

Read only

0 Likes
1,774

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

Read only

0 Likes
1,774

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

Read only

Former Member
0 Likes
1,774

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,

Read only

0 Likes
1,773

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

Read only

Former Member
0 Likes
1,773

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

Read only

Former Member
0 Likes
1,773

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.

Read only

Former Member
0 Likes
1,773

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.

Read only

Former Member
0 Likes
1,773

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.