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

ABAP Text Symbol Problem

Former Member
0 Likes
1,120

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
702

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

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.

2 REPLIES 2
Read only

Former Member
0 Likes
703

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

Read only

0 Likes
702

Jonathan,

Perfect solution! Many thanks for your quick reply.