12-31-2010 12:34 PM
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.
12-31-2010 1:30 PM
HI,
You can use the FM READ_TEXT with :
language = kna1-spras
name = kna1-kunnr
object = KNA1
12-31-2010 1:41 PM
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
12-31-2010 9:39 PM
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
01-01-2011 9:30 AM
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
01-01-2011 5:24 AM
Hi All,
Thanks for your valuable suggestions. I will check and will get back.
Happy New year to all.
Thanks.
01-01-2011 10:45 AM
Hi Clemens,
I checked your suggestion. It works fine. The Field Entry in Textpools holds the translation value.
Thanks.
Kausthub
04-19-2016 10:13 AM
Hello Kausthub,
You can get the language from table and then use statement " set language '<language you found>' " in your abap code
Regards