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

Dynamic table headings - Multilingual usage

Former Member
0 Likes
1,440

Hi,

I'm trying to write a programme with table controls and would like to enter a dynamic column text, so I can change the text according to sy-langu.

Is this possible?

Thanks in advance.

Have a nice one.

Mike Drury

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
988

Hello Mike,

Put Input/Output field e.g. T_LAB1 in the column header. Leave the Text blank.

Now define, In your golbal data.

data: T_LAB1(10).

And in PBO,

T_LAB1 = text-t01.

Maintina your text in text elemtn t01. Do the translation also.

regards,

Naimesh

7 REPLIES 7
Read only

former_member195698
Active Contributor
0 Likes
988

Do you want a different heading based on the Language.

Refer to the column with data dictionary (data element).

The desc. will come based on the Text maintained in the translation based on the logon language.

Read only

0 Likes
988

Hi Abhishek,

Thanks too for your answer - the fields of my internal table are defined "like" mara-matnr, so they usually inherit their properties.

Have a nice one,

Mike Drury

Read only

Former Member
0 Likes
988

Hi,

In the table control if you have used the dictionary field (like MARA-MATNR) then according to the logon language the column text will be displayed.

If yours is a new field then create a structure and add the field to the structure. Then create a data element and add the text.

Goto "SE63 -> Translation -> Short texts -> Abap dictionary -> Data elements" and do the translations for languages required.

Please let me know if this is what you are looking for.

Thanks,

Naren

Read only

0 Likes
988

Hi Naren,

I have a fairly simple internal table which I loop over to output my subscreen. During creation of the table control (using the graphical editor) I have to generate text fields for the column headings. Is it generally possible to create a dynamic text field in a dynpro - the answer might be blatantly trivial, I've only started programming in ABAP a short while ago and I've not had any coaching!

Thanks for your answer.

Have a nice one.

Mike Drury

Read only

0 Likes
988

Hi Mike

If you are creating the column headings from within your program rather than using the standard text associated with your fields then you might want to take a look at Text Elements (Goto | Text Elements | Text Symbols). You can enter them in the current login langauge and then use the translation tool to create alternatives in different languages (Goto | Translation from the Text Element screen).

Then within your program you can refer to the text elements as follows:

'column1'(C01).

The text string is a default that will be displayed if SAP cannot find a text element in the login language. The text within the parenthesis is the ID of the text element. So long as you have set up a translation for a given language for the Text Element ID, the text element will provide the correct text.

Hope that makes sense - if you search for Text Elements in the online SAP Library then it will tell you what to do.

Kind regards

Andy

Read only

naimesh_patel
Active Contributor
0 Likes
989

Hello Mike,

Put Input/Output field e.g. T_LAB1 in the column header. Leave the Text blank.

Now define, In your golbal data.

data: T_LAB1(10).

And in PBO,

T_LAB1 = text-t01.

Maintina your text in text elemtn t01. Do the translation also.

regards,

Naimesh

Read only

0 Likes
988

Thanks a lot,

I'd have given you both 10 points - in effect you and Andy have the same solution and it works. However the System doesn't allow it. Sorry.

Have a nice day.

Mike