Skip to Content
1
May 18, 2016 at 01:08 PM

ALV OO: Setting Fieldname for ALV-Column in Fieldcatalog

1755 Views

Dear SAP Community,

I'm creating the fieldcatalog for ALV-List with OO. I don't like creating a structure in SE11 for the field catalog, but define each column in my own program.

When I define the column description of the list, I would like to tell the system, take the texts(long, medium, short) from this Data Element in DD. Sothat I don't have to write the text manually for each field.

For example, to define the text for the field "ERDAT", I have to write down the reptext, seltext and translate them.

It's too much effort and I'm not sure whether my translation is correct.


ls_fieldcat-fieldname = 'ERDAT'.

ls_fieldcat-reptext = 'Created on'(t06).

ls_fieldcat-seltext = 'Created on'(t06).

ls_fieldcat-col_pos = 3.

ls_fieldcat-outputlen = 10.

APPEND ls_fieldcat TO lt_fieldcat.

CLEAR ls_fieldcat.


Is there a possibility that I can tell the system: Take the texts from the data element "ERDAT" in DDICT?

I won't have to write the text down in my program and the translation is already exists in data dictionary.

Thank you in advance for any suggestion.

Best regards,

Thanh