cancel
Showing results for 
Search instead for 
Did you mean: 

Translate message text in popup

Former Member
0 Kudos

Hello Experts,

I created a popup using create_popup_to_confirm. i am showing a message "Please fill all mandatory field". I want to show this message based on log on language. How can i translate this text kindly guide me.

Thank you

Vijay

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Vijay,

Use the Online Text Repository (OTR) to create translations of application texts and make your application language independent. See .

Cheers,

Amy

Former Member
0 Kudos

Dear All

Thank you for the replies. I read the above links and it is really helpful to change the Labels and changing the text using Assistance Class. In my case i am not using assistance class and at present in the popup i am displaying the static text of 'Fill all required fields' but i dont have idea how to change the static text i.e it is not related with any ui element and assistance class. The text is simply shown by using the class create_popup_to_confirm. for eg:

my Code is:

call method lo_window_manager->create_popup_to_confirm

   exporting

   text = 'Fill all required fields'    ---------------------------------------> I need this text to be translated

   button_kind = if_wd_window=>CO_BUTTONS_OK

   message_type = if_wd_window=>co_msg_type_error

   CLOSE_BUTTON = ABAP_TRUE

   receiving

   result = lo_window.

   lo_window->open( ).

Please guide me to translate the above highlighted text.

Thanks

Vijay

Former Member
0 Kudos

Hi Vijay,

Create the OTR texts for the languages you need as described in Amy Kings nice guide.

Then when you need to retrieve it you simply use:

call method lo_window_manager->create_popup_to_confirm

   exporting

   text = cl_wd_utilities=>get_otr_text_by_alias('$TMP/YOUR_KEY')  

   button_kind = if_wd_window=>CO_BUTTONS_OK

   message_type = if_wd_window=>co_msg_type_error

   CLOSE_BUTTON = ABAP_TRUE

   receiving

   result = lo_window.

   lo_window->open( ).

Br Jan

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Vijay.

You could also use OTR texts for this for example as described here:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c069b075-e48f-2c10-66ba-f57442c90...

Br Jan

Former Member
0 Kudos

Hi Vijay,

You can manage this in 2 ways:

1. text message (se91 tcode)

2. text message in text pool of assistance class

See bellow how are used 1 and 2:

   DATA: lo_window_manager TYPE REF TO if_wd_window_manager,
               lo_api_component  TYPE REF TO if_wd_component,
               lo_api_view       TYPE REF TO if_wd_view_controller,
               lo_window         TYPE REF TO if_wd_window.

  DATA: lt_string TYPE TABLE OF string,
        ls_string TYPE string,
        lv_title  TYPE string.

  lo_api_view = wd_this->wd_get_api( ).

  MESSAGE ID 'TA' TYPE 'S' NUMBER '061' INTO lv_title.

  ls_string wd_assist->if_wd_component_assistance~get_text( '001' ).
  APPEND ls_string TO lt_string.

  lo_api_component = wd_comp_controller->wd_get_api( ).
  lo_window_manager = lo_api_component->get_window_manager( ).

  lo_window = lo_window_manager->create_popup_to_confirm(
                                            window_title = lv_title
                                            text = lt_string
                                            button_kind = ).

  lo_window->open( ).

  lo_window->subscribe_to_button_event(
...................

Regards,

Catalin