Application Development 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: 

Text Elements based on customer language

Former Member
0 Kudos

Hi,

Is there any way i can retrieve text elements based on customer language in kna1 table , if the translations for all the languages are maintained ?

If yes, could you please provide a sample code instructing how to fetch ?

Thanks.

7 REPLIES 7

Former Member
0 Kudos

HI,

You can use the FM READ_TEXT with :

language = kna1-spras

name = kna1-kunnr

object = KNA1

awin_prabhu
Active Contributor
0 Kudos

Check Function Module READ_TEXTELEMENT_FROM_REPORT for reading the text elements from report.

Pass below inputs to the import parameter of above FM:

PROGRAM = 'ZTEST' <---- Program name

KEY = '100' <---- Text element key (text-100)

LANGU = 'EN' <----- Customer language in KNA1 table

Get output from export parameter ENTRY

Clemenss
Active Contributor
0 Kudos

Hi Kausthub and others,

correct me if I'm wrong:

KNA1 is customer Master - not language-dependent and no language-dependent text table defined for KNA1.

The term Text Elements refers in ABAP to short texts in ABAP program source that can be translated and will be fetched in user logon language if maintained, otherwise in program source language. Such texts can be fetched using statement

READ TEXTPOOL prog INTO itab LANGUAGE lang.

Other short texts may be stored in language-dependent text tables. Can be fetched directly from their tables.

Long texts are stored in pool tables and fetched using function READ_TEXT.

Now it is your turn to explain in detail and give example of what you want to achieve.

Regards,

Clemens

Former Member
0 Kudos

Hi Clemens,

I have a text element. I have maintained translations for it. I don't want the text elements based on logon language.

Depending on the value fetching from kna1-spras i need that respective language translation to be displayed from the text element.

I don't want to maintain a piece of code for that ( like giving conditions like if..else).

Hope the requirement is clear now. Suggestions are welcome.

Thanks.

Kausthub

Former Member
0 Kudos

Hi All,

Thanks for your valuable suggestions. I will check and will get back.

Happy New year to all.

Thanks.

Former Member
0 Kudos

Hi Clemens,

I checked your suggestion. It works fine. The Field Entry in Textpools holds the translation value.

Thanks.

Kausthub

Former Member
0 Kudos

Hello Kausthub,

You can get the language from table and then use statement  " set language '<language you found>'  " in your abap code

Regards