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

SET LANGUAGE for abap dynpro elements

Former Member
0 Likes
1,900

Hello guys,

I got a problem when trying to switch language in some custom report. Request is that one report will be displayed completely in English language when user language is different than German.

Therefor I'm using SET LANGUAGE coding. The report contains several dynpro with dynpro elements like texts, buttons and text elements. Unfortunately the SET LANGUAGE coding does not work for every time.

E.g. I got a custom dynpro number 100 with a button and a text on it but it will not be translated in English, it stays in German. Translation with SE63 in screen painter fields is done correctly. I've put the SET LANGUAGE coding in LOAD-OF-PROGRAM, INITIALIZATION, START-OF-SELECTION and PBO of the dynpro.

Any hint?

Thanks.

Regards

Michael

10 REPLIES 10
Read only

Former Member
0 Likes
1,599

Hi Michael,

The SET LANGUAGE statement does not load the selection texts of the language specified. If this is necessary, you should use the READ TEXTPOOL statement. The selection texts read in can then be displayed on the selection screen using the function modules SELECTION_TEXTS_MODIFY and SELECTION_TEXTS_DTEL.

R

Read only

0 Likes
1,599

Thanks a lot Rudra,but I'm not quite sure about the connection between these.

On the one side I got the textelements which I can read with the READ TEXTPOOL statement into a table. On the other side I have the function SELECTION_TEXTS_MODIFY which allows me to change the dynpro texts.

But I need both, I need 1) to get and change the textelements and 2) to get and change the dnypro texts. So where do I get both, means 1) where to update the textelements and 2) where to select the English dynpro texts?

Regards
Michael

Read only

0 Likes
1,599

Hi again,

What I meant was that SET LNAGUAGE will do the job for you for the "Text Element". But selection screen elements text should be modified using READ TEXTPOOL and then those FM .

Note READ TEXTPOOL reads all the elements including selection text which can be identified by ID = S in itab .

READ TEXTPOOL prog INTO itab LANGUAGE lang.


Read the abap documentation help . I think you will understand. Get back if any more queries.


R

Read only

0 Likes
1,599

Hm does not work right for me.

In itab of READ TEXTPOOL I do not find any dynpro elements, just the textelements with ID 'I' and the header with ID 'R'. I use a custom dynpro 100 with CALL SCREEN 100 and no default selection screen 1000. Maybe is this the reason for it?

Read only

0 Likes
1,599

Yes will not work for Module pool.

Read only

0 Likes
1,599

Try SET LOCALE LANGUAGE Option. If it works.

Do not use it directly rather use these FM in sequence.

SCP_MIXED_LANGUAGES_1_INIT

SCP_MIXED_LANGUAGES_1_SWITCH

SCP_MIXED_LANGUAGES_1_FINISH ( Should be called at the end of program ).


R

Read only

0 Likes
1,599

No I'm not using module pool. It is functionally a report but calls several dynpros.

Unfortunately the FM do not work. They made the same like SET LOCALE LANGUAGE and switch the the language like I want it, but as you said it does not have any effect on dynpro elements. I can see when debugging that the language is correctly switched to English but the dynpro elements stay German.

Regards

Michael

Read only

0 Likes
1,599

Yeah , but you want to update the dynpro elements not the report elements.

One option could be to create the dynpro elements in English and force the labels by hardcoded text in English. May be custom data elements without translation. I know it is not good and will not be flexible, but will serve your purpose and that is what you want to achieve.

I just tested it and it works.

R

Read only

0 Likes
1,599

Hmm yeah, but it is not that flexible then. It should not be in English for every country, so I got the problem the other way round then.

Isnt there any function etc. where I get the the dynpro elements of a custom dynpro? All the ones I tried look like they work only for standard dynpro 1000 because they do not get any values

Read only

0 Likes
1,599

I am not sure there is any, cause I could not find any.

You can design two screen and based on the country call them accordingly. One having hardcoded text one with translation. You can have a custom solution to call the screen based on your need. In this way it will be flexible also.