<?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 Return Messages in FM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201220#M470350</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How we will handle return messages in function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF A = 0.&lt;/P&gt;&lt;P&gt;ERROR.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;RESULT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I REQUIRED ERROR MESSAGE WHEN I WILL EXECUTE MY FM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Apr 2007 10:01:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-24T10:01:25Z</dc:date>
    <item>
      <title>Return Messages in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201220#M470350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How we will handle return messages in function module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF A = 0.&lt;/P&gt;&lt;P&gt;ERROR.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;RESULT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I REQUIRED ERROR MESSAGE WHEN I WILL EXECUTE MY FM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 10:01:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201220#M470350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T10:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Return Messages in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201221#M470351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;after u call the FM , u will get the SY-MSGID , SY-MSGN0 .... with that u can build the error message , chk this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA :   L_ERR_MSG(500).

CALL FUNCTION 'TB_MESSAGE_BUILD_TEXT'
       EXPORTING
            LANGU = SY-LANGU
            MSGID = P_SY_MSGID
            MSGNO = P_SY_MSGNO
            MSGV1 = P_SY_MSGV1
            MSGV2 = P_SY_MSGV2
            MSGV3 = P_SY_MSGV3
            MSGV4 = P_SY_MSGV4
       IMPORTING
            TEXT  = P_L_ERR_MSG.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 10:05:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201221#M470351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T10:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Return Messages in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201222#M470352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;raise an exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set up exceptions in your FM header to deal with different exceptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then when you encounter the error simply write, Raise (Exception name).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can hande that from the return of the FM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 10:05:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201222#M470352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T10:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Return Messages in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201223#M470353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use EXCEPTIONS.&lt;/P&gt;&lt;P&gt;Also u can write the error message using Message Statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can do like this :&lt;/P&gt;&lt;P&gt;Define an Exception say : 'DATA_INVALID'.&lt;/P&gt;&lt;P&gt;Now, in the code write : &lt;/P&gt;&lt;P&gt;IF A = 0.&lt;/P&gt;&lt;P&gt;MESSAGE E000(0K) WITH 'Data Invalid' RAISING 'DATA_INVALID'.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;RESULT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 10:05:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201223#M470353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T10:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: Return Messages in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201224#M470354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;make use of keyword and maintain Execptions in ur FM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RAISE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2007 10:07:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/return-messages-in-fm/m-p/2201224#M470354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-24T10:07:49Z</dc:date>
    </item>
  </channel>
</rss>

