on 03-04-2023 8:10 PM
Hello,
In BTP's ABAP environment, I have an application job that needs to send e-mails to users in their preferred language. In the good old days, I would use a SET LANGUAGE command to be able to retrieve translated texts in the correct language. In the BTP ABAP environment, this command is not allowed. What is the alternative to the code below?
DATA(lv_original_language) = sy-langu.
SET LANGUAGE lc_language-italian.
MESSAGE i100(mymsgclass) INTO lv_msg_text.
SET LANGUAGE lv_original_language.
Thanks,
Matt
I found the answer, the BAPI function module BAPI_MESSAGE_GETDETAIL is released. You can use this to retrieve messages in a different language:
CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'
EXPORTING
id = 'MYMSGCLASS'
number = '100'
language = 'I'
textformat = 'ASC'
message_v1 = 'MYMSGVAR'
IMPORTING
message = lv_msg_text.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Pay attention: this BAPI seems to have a small bug. If the language entered is not the running language sy-langu and if your v1 replacement contains an '&' charachter there's a sort of injecion in resolution leading to a bad result (for example you want to replace with 'MAUI & Sons'). This is not happening using message instruction. Anyway in cloud i didn't find an alternative.
User | Count |
---|---|
77 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.