2010 Jan 26 2:54 AM
Hi experts,
I'm using function module 'FI_TEXT_ZTERM' to retrieve description texts of terms of payment. However, this function module is using text symbols to generate these texts. So if I log on in English, I could not get Chinese texts if I want.
Does anybody know some good solutions? Thanks.
2010 Jan 26 3:20 AM
Try the "FI_PRINT_ZTERM" and pass it the language - you'll see at the top of that function that it does a "set language i_langu" and that seems to allow it to return the correct element from the textpool. Example code below also includes a "how to" on getting the textpool values (should you want them).
Jonathan
report zsdn_jc_zterm_text.
parameters:
p_repid type syrepid default 'SAPLFHL2',
p_langu type sylangu default sy-langu.
start-of-selection.
perform read_textpool.
perform get_terms_of_payment.
*&---------------------------------------------------------------------*
*& Form read_textpool
*&---------------------------------------------------------------------*
form read_textpool.
data:
ls_textpool type textpool,
lt_textpool type table of textpool.
clear: lt_textpool, lt_textpool[].
read textpool p_repid
into lt_textpool language p_langu.
loop at lt_textpool into ls_textpool.
write: /
ls_textpool-id,
ls_textpool-key,
ls_textpool-entry(70),
ls_textpool-length.
endloop.
endform. "read_textpool
*&---------------------------------------------------------------------*
*& Form get_terms_of_payment
*&---------------------------------------------------------------------*
form get_terms_of_payment.
data:
ls_t052 type t052,
lt_t052 type table of t052,
ls_ttext type ttext,
lt_ttext type table of ttext.
select * into table lt_t052
from t052.
loop at lt_t052 into ls_t052.
call function 'FI_PRINT_ZTERM'
exporting
i_langu = p_langu
i_t052 = ls_t052
tables
t_ztext = lt_ttext
exceptions
others = 0.
loop at lt_ttext into ls_ttext.
write: / ls_ttext-text1.
endloop.
endloop.
endform. "get_terms_of_payment
Try the "FI_PRINT_ZTERM" and pass it the language - you'll see at the top of that function that it does a "set language i_langu" and that seems to allow it to return the correct element from the textpool. Example code below also includes a "how to" on getting the textpool values (should you want them).
Jonathan
report zsdn_jc_zterm_text.
parameters:
p_repid type syrepid default 'SAPLFHL2',
p_langu type sylangu default sy-langu.
start-of-selection.
perform read_textpool.
perform get_terms_of_payment.
*&---------------------------------------------------------------------*
*& Form read_textpool
*&---------------------------------------------------------------------*
form read_textpool.
data:
ls_textpool type textpool,
lt_textpool type table of textpool.
clear: lt_textpool, lt_textpool[].
read textpool p_repid
into lt_textpool language p_langu.
loop at lt_textpool into ls_textpool.
write: /
ls_textpool-id,
ls_textpool-key,
ls_textpool-entry(70),
ls_textpool-length.
endloop.
endform. "read_textpool
*&---------------------------------------------------------------------*
*& Form get_terms_of_payment
*&---------------------------------------------------------------------*
form get_terms_of_payment.
data:
ls_t052 type t052,
lt_t052 type table of t052,
ls_ttext type ttext,
lt_ttext type table of ttext.
select * into table lt_t052
from t052.
loop at lt_t052 into ls_t052.
call function 'FI_PRINT_ZTERM'
exporting
i_langu = p_langu
i_t052 = ls_t052
tables
t_ztext = lt_ttext
exceptions
others = 0.
loop at lt_ttext into ls_ttext.
write: / ls_ttext-text1.
endloop.
endloop.
endform. "get_terms_of_payment
2010 Jan 26 3:20 AM
Try the "FI_PRINT_ZTERM" and pass it the language - you'll see at the top of that function that it does a "set language i_langu" and that seems to allow it to return the correct element from the textpool. Example code below also includes a "how to" on getting the textpool values (should you want them).
Jonathan
report zsdn_jc_zterm_text.
parameters:
p_repid type syrepid default 'SAPLFHL2',
p_langu type sylangu default sy-langu.
start-of-selection.
perform read_textpool.
perform get_terms_of_payment.
*&---------------------------------------------------------------------*
*& Form read_textpool
*&---------------------------------------------------------------------*
form read_textpool.
data:
ls_textpool type textpool,
lt_textpool type table of textpool.
clear: lt_textpool, lt_textpool[].
read textpool p_repid
into lt_textpool language p_langu.
loop at lt_textpool into ls_textpool.
write: /
ls_textpool-id,
ls_textpool-key,
ls_textpool-entry(70),
ls_textpool-length.
endloop.
endform. "read_textpool
*&---------------------------------------------------------------------*
*& Form get_terms_of_payment
*&---------------------------------------------------------------------*
form get_terms_of_payment.
data:
ls_t052 type t052,
lt_t052 type table of t052,
ls_ttext type ttext,
lt_ttext type table of ttext.
select * into table lt_t052
from t052.
loop at lt_t052 into ls_t052.
call function 'FI_PRINT_ZTERM'
exporting
i_langu = p_langu
i_t052 = ls_t052
tables
t_ztext = lt_ttext
exceptions
others = 0.
loop at lt_ttext into ls_ttext.
write: / ls_ttext-text1.
endloop.
endloop.
endform. "get_terms_of_payment
2010 Jan 26 3:24 AM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |