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

Regarding ALV column text

Former Member
0 Likes
3,420

Hi Experts,

For ALVs, we need to prepare field catalog first.At the time of preparing field catalog,we give text to be displayed as column text.There are several ways of doing that.

My question is if i want to display it from data element field label,i can use

1) by using fieldcat-ref_field  = <data element of  field in data dictionary> and fieldcat-ref_table = <name of table>

2)by using fieldcat-rollname = <data element of field in data dictionary>.   (if field name is not from any table)

In above two solutions, which one should i use?Also, is there any other way of doing it?

Hi Experts,

For ALVs, we need to prepare field catalog first.At the time of preparing field catalog,we give text to be displayed as column text.There are several ways of doing that.

My question is if i want to display it from data element field label,i can use

1) by using fieldcat-ref_field  = <data element of  field in data dictionary> and fieldcat-ref_table = <name of table>

2)by using fieldcat-rollname = <data element of field in data dictionary>.   (if field name is not from any table)

In above two solutions, which one should i use?Also, is there any other way of doing it?

5 REPLIES 5
Read only

gouravkumar64
Active Contributor
0 Likes
1,665

Hi,

1) Generally when use OOPS ALV method with set_table_for_first_display ,then use your first option.

The structure from dictionary type LVC_S_FCAT.

you have to declare like

it_fcat            TYPE lvc_t_fcat,            "Field catalogue
      it_layout          TYPE lvc_s_layo.           "Layout

http://wiki.scn.sap.com/wiki/display/ABAP/Making+ALV+to+react+to+Change+data+automatically

like this.

2) when use REUSE_ALV_FIELDCATALOG_MERGE,Then use roll name option & press F1 for more info .

Thanks & hope it little clear.

Gourav.

Read only

Former Member
0 Likes
1,665

Hi

I you want to use the labels from dictionary, you should use:

fieldcat-ref_field  = <name of field based on data element>

fieldcat-ref_table = <name of table>

The ROLLNAME is to link F1 help so you shouldn't use it

But you need to consider REF_FIELD/REF_TABLE show the ALV field structurated as the dictionary field you have set, so if you want to get only the label, you should fill:

seltext_l (long field label)

seltext_m (medium field label)

seltext_s (short field label)

Max


Read only

Former Member
0 Likes
1,665

Hi Abdul,

Both Methods will be able to display text as Per your needs

Second one will provide u access to F1 help on that particular Fields too.

Regards
Arpit Gupta

Read only

Former Member
0 Likes
1,665

Hi Abdul,

You just have to give reference table and reference field name. It will automatically display the field label.

http://help.sap.com/saphelp_erp60_sp/helpdata/en/8e/5dc9c1e10111d2b47e006094192fe3/content.htm

Read only

Former Member
0 Likes
1,665

HI Abdul,

USE FIRST ONE..  That will do.