<?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: 'FORMAT_MESSAGE' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-message/m-p/3433120#M824559</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: msg TYPE string.
CALL FUNCTION 'FORMAT_MESSAGE'
 EXPORTING
   ID              = 'V'
   LANG            = '-D'
   NO              = '550'
   V1              = 'Test Message'
   V2              = 'using'
   V3              = 'function module'
   V4              = SY-MSGV4
 IMPORTING
   MSG             = msg
 EXCEPTIONS
   NOT_FOUND       = 1
   OTHERS          = 2       .

write:/ msg.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;V --&amp;gt; message class from SE91&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;550 --&amp;gt; message number which u would liek to display else choose nuber with &amp;amp;&amp;amp;&amp;amp;&amp;amp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Then if the message number contains three &amp;amp; u can pass three text upto V3...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output will be like&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Test Message using function module.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves ur query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Feb 2008 06:16:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-19T06:16:53Z</dc:date>
    <item>
      <title>'FORMAT_MESSAGE'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-message/m-p/3433118#M824557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to Use Std Function module 'FORMAT_MESSAGE' ?&lt;/P&gt;&lt;P&gt;What is the purpose of that ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;pandu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 06:06:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-message/m-p/3433118#M824557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-19T06:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: 'FORMAT_MESSAGE'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-message/m-p/3433119#M824558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;call transaction &amp;lt;t_code&amp;gt; using &amp;lt;bdc_table&amp;gt; mode &amp;lt;A/E/N&amp;gt; update &amp;lt;A/S&amp;gt; messages into &amp;lt;it_messages&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this it_messages has to be of type BDCMSGCOLL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see the structure of the BDCMSGCOLL and read the messages accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, the errors are logged automatically when we create a batch input session and execute the session, while in case of Call Transaction .. it is not so.. hence we use this method of storing the messages into the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the call transaction ... You can loop on this internal table and see the messages.&lt;/P&gt;&lt;P&gt;It will give you all the details like the message type - Error, warning , Info or abend. &lt;/P&gt;&lt;P&gt;the message is split into 4 parts...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BDCDATA TYPE TABLE OF BDCDATA. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ITAB TYPE TABLE OF BDCMSGCOLL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: PROGRAM LIKE SY-REPID, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_BDCDATA TYPE BDCDATA. &lt;/P&gt;&lt;P&gt;WA_BDCDATA-PROGRAM = 'SAPMS38M'. &lt;/P&gt;&lt;P&gt;WA_BDCDATA-DYNPRO = '0100'. &lt;/P&gt;&lt;P&gt;WA_BDCDATA-DYNBEGIN = 'X'. &lt;/P&gt;&lt;P&gt;APPEND WA_BDCDATA TO BDCDATA. &lt;/P&gt;&lt;P&gt;CLEAR WA_BDCDATA. &lt;/P&gt;&lt;P&gt;WA_BDCDATA-FNAM = 'RS38M-PROGRAMM'. &lt;/P&gt;&lt;P&gt;WA_BDCDATA-FVAL = PROGRAM. &lt;/P&gt;&lt;P&gt;APPEND WA_BDCDATA TO BDCDATA. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'SE38' USING BDCDATA MODE 'N' &lt;/P&gt;&lt;P&gt;MESSAGES INTO ITAB. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now formatting messages:&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;perform format_message USING itab-msgid itab-msgnr itab-msgv1 itab-msgv2 itab-msgv3 itab-msgv4.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM FORMAT_MESSAGE USING P_MSGID LIKE SY-MSGID&lt;/P&gt;&lt;P&gt;P_MSGNO LIKE SY-MSGNO&lt;/P&gt;&lt;P&gt;P_MSGV1 LIKE SY-MSGV1&lt;/P&gt;&lt;P&gt;P_MSGV2 LIKE SY-MSGV2&lt;/P&gt;&lt;P&gt;P_MSGV3 LIKE SY-MSGV3&lt;/P&gt;&lt;P&gt;P_MSGV4 LIKE SY-MSGV4.&lt;/P&gt;&lt;P&gt;DATA: P_TEXT(100) TYPE C.&lt;/P&gt;&lt;P&gt;CLEAR: P_TEXT.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'FORMAT_MESSAGE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ID = P_MSGID&lt;/P&gt;&lt;P&gt;LANG = SY-LANGU&lt;/P&gt;&lt;P&gt;NO = P_MSGNO&lt;/P&gt;&lt;P&gt;V1 = P_MSGV1&lt;/P&gt;&lt;P&gt;V2 = P_MSGV2&lt;/P&gt;&lt;P&gt;V3 = P_MSGV3&lt;/P&gt;&lt;P&gt;V4 = P_MSGV4&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;MSG = P_TEXT&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;NOT_FOUND = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;WRITE:/ P_TEXT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " FORMAT_MESSAGE[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 06:13:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-message/m-p/3433119#M824558</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-19T06:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: 'FORMAT_MESSAGE'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-message/m-p/3433120#M824559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: msg TYPE string.
CALL FUNCTION 'FORMAT_MESSAGE'
 EXPORTING
   ID              = 'V'
   LANG            = '-D'
   NO              = '550'
   V1              = 'Test Message'
   V2              = 'using'
   V3              = 'function module'
   V4              = SY-MSGV4
 IMPORTING
   MSG             = msg
 EXCEPTIONS
   NOT_FOUND       = 1
   OTHERS          = 2       .

write:/ msg.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;V --&amp;gt; message class from SE91&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;550 --&amp;gt; message number which u would liek to display else choose nuber with &amp;amp;&amp;amp;&amp;amp;&amp;amp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Then if the message number contains three &amp;amp; u can pass three text upto V3...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output will be like&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Test Message using function module.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves ur query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 06:16:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-message/m-p/3433120#M824559</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-19T06:16:53Z</dc:date>
    </item>
  </channel>
</rss>

