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

Label for Predefined Types

Former Member
0 Likes
1,225

Peace be Upon you All,

How can I make a Label (Field Label) for a Predefined Type ?

I was appending a Structure to a Table, to add a 'Text' Field with a 'String' type

so I added the field ZZTEXT with the predefined type 'STRING' and added a Description

but in the ALV Output, it had now label on top of it

I know that Field labels are stored for the Data Elements

but I don't want to use a data element 'Component Type'

SO, how can I add a field label to the Output without Creating a New Data Element ???

Thanks in advance

5 REPLIES 5
Read only

rahul_mahajan
Active Participant
0 Likes
852

Hi ,

Please refer link http://wiki.sdn.sap.com/wiki/display/ABAP/ALVTUTOTIALFORBEGINERSWITH+EXAMPLES .

Hope this will resolve your issue.

Regards,

Rahul Mahajan

Read only

0 Likes
852

Hi,

When you build field catalog for your ALV,you can sepcify what label you want.

Example.

FORM buid_fieldcatalog.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'IT_ALV1'

i_inclname = sy-repid

CHANGING

ct_fieldcat = int_fcat[].

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

LOOP AT int_fcat.

CASE int_fcat-fieldname.

WHEN 'XBLNR'.

int_fcat-reptext_ddic = 'Custom Label'.

int_fcat-seltext_s = ''Custom Label'.

int_fcat-seltext_m = 'Custom Label'.

int_fcat-seltext_l = ''Custom Label'.

ENCASE.

ENDLOOP.

Read only

Former Member
0 Likes
852

Well, Thank you very much.

But I forgot to tell you that I'm in an Enhancement ..

so, I can just Append the Structure (SE11)

and Enter Code as an Enhancement .

Read only

0 Likes
852

Hi,

Could you provide the Enhancement the one which you are using for appending new field for which you want to change the Label text.

Thanks,

Shailaja Ainala,

Read only

0 Likes
852

LMEREPI02

Method:

Build_Base_List