<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to move message text from message class using variable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935766#M691845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;  I:zmy_msg_class:010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This ist the standard message which is shown if the specified message is not existing or does not have a translation to your logon language.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check if the name of the message class and the number are really correct. Perhaps writing the message class in capital letters might help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Oct 2007 04:55:23 GMT</pubDate>
    <dc:creator>romanweise</dc:creator>
    <dc:date>2007-10-22T04:55:23Z</dc:date>
    <item>
      <title>How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935759#M691838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have message number in internal table. I want to display message txt on report. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can somebody tell me how I can move the message text to a variable, using message number stored in variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variables details is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_msg_id type sy-msgno.&lt;/P&gt;&lt;P&gt;DATA: lv_msg_text(60) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_msg_id = '010'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to store msg text in lv_msg_text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Oct 2007 15:55:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935759#M691838</guid>
      <dc:creator>manoj_goyal2</dc:creator>
      <dc:date>2007-10-21T15:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935760#M691839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The message statement has an INTO option allowing you to store the message in a field insteat of showing it on the screen directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE E010(MESSAGE_CLASS) WITH VAR1 VAR2 VAR3 VAR4&lt;/P&gt;&lt;P&gt;  INTO lv_msg_txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to assign message class, number and type dynamically use the following version:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE ID my_mid TYPE my_mtype NUMBER my_num WITH my_var1 my_var2 my_var3 my_var4 INTO lv_msg_txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Oct 2007 16:17:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935760#M691839</guid>
      <dc:creator>romanweise</dc:creator>
      <dc:date>2007-10-21T16:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935761#M691840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can also use the Function Module BAPI_MESSAGE_GET_DETAIL to get the message passing the Message Id, No, variables etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Oct 2007 16:22:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935761#M691840</guid>
      <dc:creator>former_member195698</dc:creator>
      <dc:date>2007-10-21T16:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935762#M691841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used your statment but I am getting this result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:   gc_msgid type sy-msgid value 'zmy_msg_class'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_errid type sy-msgno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lv_errid = '010'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE ID gc_msgid TYPE 'I' NUMBER gi_error_list-errid&lt;/P&gt;&lt;P&gt;          INTO lv_err_txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:  I:zmy_msg_class:010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please see what is wrong in this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Oct 2007 23:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935762#M691841</guid>
      <dc:creator>manoj_goyal2</dc:creator>
      <dc:date>2007-10-21T23:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935763#M691842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you try&lt;/P&gt;&lt;P&gt;MESSAGE  gi_error_list-errid(gc_msgid) INTO lv_err_txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Oct 2007 23:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935763#M691842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-21T23:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935764#M691843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Atish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used your statement and it is giving me following error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Three-digit error number XXX required in the "MESSAGE EXXX..  Statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 02:09:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935764#M691843</guid>
      <dc:creator>manoj_goyal2</dc:creator>
      <dc:date>2007-10-22T02:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935765#M691844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can use your earlier statement only&lt;/P&gt;&lt;P&gt;MESSAGE ID gc_msgid TYPE 'I' NUMBER gi_error_list-errid&lt;/P&gt;&lt;P&gt;INTO lv_err_txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the error you getting in this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 02:13:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935765#M691844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-22T02:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935766#M691845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;  I:zmy_msg_class:010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This ist the standard message which is shown if the specified message is not existing or does not have a translation to your logon language.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check if the name of the message class and the number are really correct. Perhaps writing the message class in capital letters might help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2007 04:55:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935766#M691845</guid>
      <dc:creator>romanweise</dc:creator>
      <dc:date>2007-10-22T04:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935767#M691846</link>
      <description>&lt;P&gt;You can use function module: FORMAT_MESSAGE&lt;/P&gt;&lt;P&gt;But remmeber about language translation. If it doesn't exist you don't get value in variable.&lt;/P&gt;&lt;P&gt;Here it's example code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; DATA: text TYPE string.


  CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
      id        = 'AUTH_WIZ'    " Application Area
      lang      = sy-langu
      no        = '003'
      v1        = 'TEST VALUE'   " 1st parameter
      v2        = sy-msgv2    " 2nd parameter
      v3        = sy-msgv3    " 3rd parameter
      v4        = sy-msgv4    " 4th Parameter
    IMPORTING
      msg       = text
    EXCEPTIONS
      not_found = 1.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    WRITE:/ text.
  ENDIF.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This simple FM check only table T100 as select single, so sometimes better is use select on T100 and get all message to global table/class attribute and after use read table on it. It's much better when u have many messages to handle in your class/ program.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  DATA: messages TYPE HASHED TABLE OF t100 WITH UNIQUE KEY msgnr.


  SELECT *
    FROM t100
    INTO TABLE @messages[]
   WHERE sprsl = @sy-langu
     AND arbgb = 'AUTH_WIZ'.
  IF sy-subrc EQ 0.
    READ TABLE messages INTO DATA(message) WITH KEY msgnr = '003'.
    IF sy-subrc EQ 0.
      REPLACE '&amp;amp;' IN message-text WITH 'TEST VALUE'.
      WRITE:/ message-text.
    ENDIF.
  ENDIF.
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Jul 2021 07:45:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935767#M691846</guid>
      <dc:creator>former_member558935</dc:creator>
      <dc:date>2021-07-23T07:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to move message text from message class using variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935768#M691847</link>
      <description>&lt;P&gt;Hi Dear, you can code in different ways. see one sample on below ABAP Code, please!&lt;/P&gt;&lt;P&gt;Best Regards!&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: lv_text type string.
   
"BAPI Message text
message id lw_bapiret2-id
      type lw_bapiret2-type
    number lw_bapiret2-number
      with lw_bapiret2-message_v1
           lw_bapiret2-message_v2
           lw_bapiret2-message_v3
           lw_bapiret2-message_v4
      into lv_text.

message s223(z1) with (lv_text) display like 'I'.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Jul 2021 04:01:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-move-message-text-from-message-class-using-variable/m-p/2935768#M691847</guid>
      <dc:creator>roberto_forti</dc:creator>
      <dc:date>2021-07-25T04:01:02Z</dc:date>
    </item>
  </channel>
</rss>

