Set Language for MESSAGE statement









up vote
0
down vote

favorite












I access my coding in batch mode with a set system user via RFC, whose logon language is set to 'DE'. In case of an error, I use a message statement, so the application on the other system can handle this error.



MESSAGE i001(ztest) INTO DATA(e_error).


The message is translated in several languages. Depending on the language of the user on the other system, I need the message translated. But regardless of changing sy-langu or using SET (LOCALE) LANGUAGE statement, the message is still returned in german, the system users original setting (As stated in keyword documentation 'If the text environment is set using the statement SET LOCALE, this is ignored by the language in which the message is displayed. '


Before this change we used text elements, with which it worked.

Is it possible to change the language the MESSAGE statement uses while runtime?










share|improve this question





















  • i had a similar case some time ago, are you able to set the batch-users language via SU01, logon-language or adress-language? this influences your MESSAGE's language but I also did not find this satisfying.
    – zYrEx
    Nov 8 at 14:52










  • My problem is that I am bound to the user on the other system. I don't think I'm able (or rather allowed) to change the language of the user itself for every single call of my module.
    – Tassimmo
    Nov 8 at 14:55











  • yeah, I was neither allowed to change it. eventually you have to translate the messages and transport them to the other system ..
    – zYrEx
    Nov 8 at 14:57






  • 1




    You say you want to enable the calling machine react to this message? Shouldn't you then rather send an error code (e.g. message class and number) instead of translated free text?
    – Florian
    Nov 8 at 15:57










  • The message I'm getting is the error message shown to the user on the other system.
    – Tassimmo
    Nov 9 at 6:36














up vote
0
down vote

favorite












I access my coding in batch mode with a set system user via RFC, whose logon language is set to 'DE'. In case of an error, I use a message statement, so the application on the other system can handle this error.



MESSAGE i001(ztest) INTO DATA(e_error).


The message is translated in several languages. Depending on the language of the user on the other system, I need the message translated. But regardless of changing sy-langu or using SET (LOCALE) LANGUAGE statement, the message is still returned in german, the system users original setting (As stated in keyword documentation 'If the text environment is set using the statement SET LOCALE, this is ignored by the language in which the message is displayed. '


Before this change we used text elements, with which it worked.

Is it possible to change the language the MESSAGE statement uses while runtime?










share|improve this question





















  • i had a similar case some time ago, are you able to set the batch-users language via SU01, logon-language or adress-language? this influences your MESSAGE's language but I also did not find this satisfying.
    – zYrEx
    Nov 8 at 14:52










  • My problem is that I am bound to the user on the other system. I don't think I'm able (or rather allowed) to change the language of the user itself for every single call of my module.
    – Tassimmo
    Nov 8 at 14:55











  • yeah, I was neither allowed to change it. eventually you have to translate the messages and transport them to the other system ..
    – zYrEx
    Nov 8 at 14:57






  • 1




    You say you want to enable the calling machine react to this message? Shouldn't you then rather send an error code (e.g. message class and number) instead of translated free text?
    – Florian
    Nov 8 at 15:57










  • The message I'm getting is the error message shown to the user on the other system.
    – Tassimmo
    Nov 9 at 6:36












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I access my coding in batch mode with a set system user via RFC, whose logon language is set to 'DE'. In case of an error, I use a message statement, so the application on the other system can handle this error.



MESSAGE i001(ztest) INTO DATA(e_error).


The message is translated in several languages. Depending on the language of the user on the other system, I need the message translated. But regardless of changing sy-langu or using SET (LOCALE) LANGUAGE statement, the message is still returned in german, the system users original setting (As stated in keyword documentation 'If the text environment is set using the statement SET LOCALE, this is ignored by the language in which the message is displayed. '


Before this change we used text elements, with which it worked.

Is it possible to change the language the MESSAGE statement uses while runtime?










share|improve this question













I access my coding in batch mode with a set system user via RFC, whose logon language is set to 'DE'. In case of an error, I use a message statement, so the application on the other system can handle this error.



MESSAGE i001(ztest) INTO DATA(e_error).


The message is translated in several languages. Depending on the language of the user on the other system, I need the message translated. But regardless of changing sy-langu or using SET (LOCALE) LANGUAGE statement, the message is still returned in german, the system users original setting (As stated in keyword documentation 'If the text environment is set using the statement SET LOCALE, this is ignored by the language in which the message is displayed. '


Before this change we used text elements, with which it worked.

Is it possible to change the language the MESSAGE statement uses while runtime?







sap abap






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 8 at 14:47









Tassimmo

133




133











  • i had a similar case some time ago, are you able to set the batch-users language via SU01, logon-language or adress-language? this influences your MESSAGE's language but I also did not find this satisfying.
    – zYrEx
    Nov 8 at 14:52










  • My problem is that I am bound to the user on the other system. I don't think I'm able (or rather allowed) to change the language of the user itself for every single call of my module.
    – Tassimmo
    Nov 8 at 14:55











  • yeah, I was neither allowed to change it. eventually you have to translate the messages and transport them to the other system ..
    – zYrEx
    Nov 8 at 14:57






  • 1




    You say you want to enable the calling machine react to this message? Shouldn't you then rather send an error code (e.g. message class and number) instead of translated free text?
    – Florian
    Nov 8 at 15:57










  • The message I'm getting is the error message shown to the user on the other system.
    – Tassimmo
    Nov 9 at 6:36
















  • i had a similar case some time ago, are you able to set the batch-users language via SU01, logon-language or adress-language? this influences your MESSAGE's language but I also did not find this satisfying.
    – zYrEx
    Nov 8 at 14:52










  • My problem is that I am bound to the user on the other system. I don't think I'm able (or rather allowed) to change the language of the user itself for every single call of my module.
    – Tassimmo
    Nov 8 at 14:55











  • yeah, I was neither allowed to change it. eventually you have to translate the messages and transport them to the other system ..
    – zYrEx
    Nov 8 at 14:57






  • 1




    You say you want to enable the calling machine react to this message? Shouldn't you then rather send an error code (e.g. message class and number) instead of translated free text?
    – Florian
    Nov 8 at 15:57










  • The message I'm getting is the error message shown to the user on the other system.
    – Tassimmo
    Nov 9 at 6:36















i had a similar case some time ago, are you able to set the batch-users language via SU01, logon-language or adress-language? this influences your MESSAGE's language but I also did not find this satisfying.
– zYrEx
Nov 8 at 14:52




i had a similar case some time ago, are you able to set the batch-users language via SU01, logon-language or adress-language? this influences your MESSAGE's language but I also did not find this satisfying.
– zYrEx
Nov 8 at 14:52












My problem is that I am bound to the user on the other system. I don't think I'm able (or rather allowed) to change the language of the user itself for every single call of my module.
– Tassimmo
Nov 8 at 14:55





My problem is that I am bound to the user on the other system. I don't think I'm able (or rather allowed) to change the language of the user itself for every single call of my module.
– Tassimmo
Nov 8 at 14:55













yeah, I was neither allowed to change it. eventually you have to translate the messages and transport them to the other system ..
– zYrEx
Nov 8 at 14:57




yeah, I was neither allowed to change it. eventually you have to translate the messages and transport them to the other system ..
– zYrEx
Nov 8 at 14:57




1




1




You say you want to enable the calling machine react to this message? Shouldn't you then rather send an error code (e.g. message class and number) instead of translated free text?
– Florian
Nov 8 at 15:57




You say you want to enable the calling machine react to this message? Shouldn't you then rather send an error code (e.g. message class and number) instead of translated free text?
– Florian
Nov 8 at 15:57












The message I'm getting is the error message shown to the user on the other system.
– Tassimmo
Nov 9 at 6:36




The message I'm getting is the error message shown to the user on the other system.
– Tassimmo
Nov 9 at 6:36












2 Answers
2






active

oldest

votes

















up vote
3
down vote



accepted










A second possible workaround is to :



  • make your RFC-enabled function module (RFM 1) return the message ID + message number + 4 optional variables

  • after calling the RFM 1, the calling program calls the RFC-enabled function module BAPI_MESSAGE_GETDETAIL to get the text in the desired language (parameter LANGUAGE or LANGUAGE_ISO).





share|improve this answer





























    up vote
    1
    down vote













    A workaround could be, instead of using MESSAGE, just selecting the text of the message with the language you need (English in my example):



    SELECT SINGLE text
    INTO @DATA(e_error)
    FROM t100
    WHERE sprsl EQ 'E'
    AND arbgb EQ 'ZTEST'
    AND msgnr EQ '001'.


    Obviously, if the message has placeholder(s), you have some more work to do.






    share|improve this answer
















    • 2




      There is the function module FORMAT_MESSAGE which is able to both return a text in any language and replace the placeholders ; this is the one which was used in very old releases (< 3.0) when the statement MESSAGE was not able to replace placeholders.
      – Sandra Rossi
      Nov 8 at 19:04










    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53210128%2fset-language-for-message-statement%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote



    accepted










    A second possible workaround is to :



    • make your RFC-enabled function module (RFM 1) return the message ID + message number + 4 optional variables

    • after calling the RFM 1, the calling program calls the RFC-enabled function module BAPI_MESSAGE_GETDETAIL to get the text in the desired language (parameter LANGUAGE or LANGUAGE_ISO).





    share|improve this answer


























      up vote
      3
      down vote



      accepted










      A second possible workaround is to :



      • make your RFC-enabled function module (RFM 1) return the message ID + message number + 4 optional variables

      • after calling the RFM 1, the calling program calls the RFC-enabled function module BAPI_MESSAGE_GETDETAIL to get the text in the desired language (parameter LANGUAGE or LANGUAGE_ISO).





      share|improve this answer
























        up vote
        3
        down vote



        accepted







        up vote
        3
        down vote



        accepted






        A second possible workaround is to :



        • make your RFC-enabled function module (RFM 1) return the message ID + message number + 4 optional variables

        • after calling the RFM 1, the calling program calls the RFC-enabled function module BAPI_MESSAGE_GETDETAIL to get the text in the desired language (parameter LANGUAGE or LANGUAGE_ISO).





        share|improve this answer














        A second possible workaround is to :



        • make your RFC-enabled function module (RFM 1) return the message ID + message number + 4 optional variables

        • after calling the RFM 1, the calling program calls the RFC-enabled function module BAPI_MESSAGE_GETDETAIL to get the text in the desired language (parameter LANGUAGE or LANGUAGE_ISO).






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 9 at 21:16

























        answered Nov 8 at 19:32









        Sandra Rossi

        2,0731315




        2,0731315






















            up vote
            1
            down vote













            A workaround could be, instead of using MESSAGE, just selecting the text of the message with the language you need (English in my example):



            SELECT SINGLE text
            INTO @DATA(e_error)
            FROM t100
            WHERE sprsl EQ 'E'
            AND arbgb EQ 'ZTEST'
            AND msgnr EQ '001'.


            Obviously, if the message has placeholder(s), you have some more work to do.






            share|improve this answer
















            • 2




              There is the function module FORMAT_MESSAGE which is able to both return a text in any language and replace the placeholders ; this is the one which was used in very old releases (< 3.0) when the statement MESSAGE was not able to replace placeholders.
              – Sandra Rossi
              Nov 8 at 19:04














            up vote
            1
            down vote













            A workaround could be, instead of using MESSAGE, just selecting the text of the message with the language you need (English in my example):



            SELECT SINGLE text
            INTO @DATA(e_error)
            FROM t100
            WHERE sprsl EQ 'E'
            AND arbgb EQ 'ZTEST'
            AND msgnr EQ '001'.


            Obviously, if the message has placeholder(s), you have some more work to do.






            share|improve this answer
















            • 2




              There is the function module FORMAT_MESSAGE which is able to both return a text in any language and replace the placeholders ; this is the one which was used in very old releases (< 3.0) when the statement MESSAGE was not able to replace placeholders.
              – Sandra Rossi
              Nov 8 at 19:04












            up vote
            1
            down vote










            up vote
            1
            down vote









            A workaround could be, instead of using MESSAGE, just selecting the text of the message with the language you need (English in my example):



            SELECT SINGLE text
            INTO @DATA(e_error)
            FROM t100
            WHERE sprsl EQ 'E'
            AND arbgb EQ 'ZTEST'
            AND msgnr EQ '001'.


            Obviously, if the message has placeholder(s), you have some more work to do.






            share|improve this answer












            A workaround could be, instead of using MESSAGE, just selecting the text of the message with the language you need (English in my example):



            SELECT SINGLE text
            INTO @DATA(e_error)
            FROM t100
            WHERE sprsl EQ 'E'
            AND arbgb EQ 'ZTEST'
            AND msgnr EQ '001'.


            Obviously, if the message has placeholder(s), you have some more work to do.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 8 at 15:09









            JozsefSzikszai

            1,513311




            1,513311







            • 2




              There is the function module FORMAT_MESSAGE which is able to both return a text in any language and replace the placeholders ; this is the one which was used in very old releases (< 3.0) when the statement MESSAGE was not able to replace placeholders.
              – Sandra Rossi
              Nov 8 at 19:04












            • 2




              There is the function module FORMAT_MESSAGE which is able to both return a text in any language and replace the placeholders ; this is the one which was used in very old releases (< 3.0) when the statement MESSAGE was not able to replace placeholders.
              – Sandra Rossi
              Nov 8 at 19:04







            2




            2




            There is the function module FORMAT_MESSAGE which is able to both return a text in any language and replace the placeholders ; this is the one which was used in very old releases (< 3.0) when the statement MESSAGE was not able to replace placeholders.
            – Sandra Rossi
            Nov 8 at 19:04




            There is the function module FORMAT_MESSAGE which is able to both return a text in any language and replace the placeholders ; this is the one which was used in very old releases (< 3.0) when the statement MESSAGE was not able to replace placeholders.
            – Sandra Rossi
            Nov 8 at 19:04

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53210128%2fset-language-for-message-statement%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kleinkühnau

            Makov (Slowakei)

            Deutsches Schauspielhaus