<?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 Handling 2 messages in a function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260278#M1384855</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;&lt;/P&gt;&lt;P&gt;I have a requirement where I need to trigger 2 messages if sy-subrc fails in a Function Module.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;	Function module						GET_JOB_RUNTIME_INFO&lt;/P&gt;&lt;P&gt;	IMPORTING&lt;/P&gt;&lt;P&gt;	JOB名(JOBNAME)=		P_WK_JOBNM&lt;/P&gt;&lt;P&gt;	Error(SY-SUBRC &amp;lt;&amp;gt; 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	Result message output&lt;/P&gt;&lt;P&gt;	(EN) Total : &amp;amp;1, Success : &amp;amp;2, Error : &amp;amp;3&lt;/P&gt;&lt;P&gt;	Type: u2019Su2019&lt;/P&gt;&lt;P&gt;	&amp;amp;1:u20190u2019 	&amp;amp;2:u20190u2019	&amp;amp;3:u20190u2019&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	Perform error handling(-&amp;gt;Error Handling:030)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Handling 30:  Error Handling as ABEND&lt;/P&gt;&lt;P&gt;Show message (message type u2018Eu2019)&lt;/P&gt;&lt;P&gt;(EN)Error was found in function module. Function module: &amp;amp;1 Returned value: &amp;amp;2 &amp;amp;3&lt;/P&gt;&lt;P&gt;&amp;amp;1:'GET_JOB_RUNTIME_INFO'&lt;/P&gt;&lt;P&gt;&amp;amp;2: Exception No&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written the code in the following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GET_JOB_RUNTIME_INFO'&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EVENTID                       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EVENTPARM                     =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXTERNAL_PROGRAM_ACTIVE       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  JOBCOUNT                      =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   JOBNAME                       = l_job_name&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  STEPCOUNT                     =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   NO_RUNTIME_INFO               = 1&lt;/P&gt;&lt;P&gt;   OTHERS                        = 2&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;message s010(zmm)  with c_zero c_zero c_zero.&lt;/P&gt;&lt;P&gt;message e001(zmm) display like 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the above code is not working fine.  Only the second message ie [message e001(zmm) display like 'A' ] is being displayed.&lt;/P&gt;&lt;P&gt;In debugging mode the cursor is passing to the first message but still it is not being displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one help me in solving this problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Indira&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Oct 2009 03:42:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-30T03:42:19Z</dc:date>
    <item>
      <title>Handling 2 messages in a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260278#M1384855</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;&lt;/P&gt;&lt;P&gt;I have a requirement where I need to trigger 2 messages if sy-subrc fails in a Function Module.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;	Function module						GET_JOB_RUNTIME_INFO&lt;/P&gt;&lt;P&gt;	IMPORTING&lt;/P&gt;&lt;P&gt;	JOB名(JOBNAME)=		P_WK_JOBNM&lt;/P&gt;&lt;P&gt;	Error(SY-SUBRC &amp;lt;&amp;gt; 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	Result message output&lt;/P&gt;&lt;P&gt;	(EN) Total : &amp;amp;1, Success : &amp;amp;2, Error : &amp;amp;3&lt;/P&gt;&lt;P&gt;	Type: u2019Su2019&lt;/P&gt;&lt;P&gt;	&amp;amp;1:u20190u2019 	&amp;amp;2:u20190u2019	&amp;amp;3:u20190u2019&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;	Perform error handling(-&amp;gt;Error Handling:030)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Handling 30:  Error Handling as ABEND&lt;/P&gt;&lt;P&gt;Show message (message type u2018Eu2019)&lt;/P&gt;&lt;P&gt;(EN)Error was found in function module. Function module: &amp;amp;1 Returned value: &amp;amp;2 &amp;amp;3&lt;/P&gt;&lt;P&gt;&amp;amp;1:'GET_JOB_RUNTIME_INFO'&lt;/P&gt;&lt;P&gt;&amp;amp;2: Exception No&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written the code in the following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GET_JOB_RUNTIME_INFO'&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EVENTID                       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EVENTPARM                     =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXTERNAL_PROGRAM_ACTIVE       =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  JOBCOUNT                      =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   JOBNAME                       = l_job_name&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  STEPCOUNT                     =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   NO_RUNTIME_INFO               = 1&lt;/P&gt;&lt;P&gt;   OTHERS                        = 2&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;message s010(zmm)  with c_zero c_zero c_zero.&lt;/P&gt;&lt;P&gt;message e001(zmm) display like 'A'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the above code is not working fine.  Only the second message ie [message e001(zmm) display like 'A' ] is being displayed.&lt;/P&gt;&lt;P&gt;In debugging mode the cursor is passing to the first message but still it is not being displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one help me in solving this problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Indira&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 03:42:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260278#M1384855</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-30T03:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Handling 2 messages in a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260279#M1384856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First message is getting overlapped with the second message.&lt;/P&gt;&lt;P&gt;Try to combine the two messages into one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 04:00:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260279#M1384856</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-30T04:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Handling 2 messages in a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260280#M1384857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Harsh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replying. But I can not concatenate the two messages. Both the messages are to be displayed individually.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 04:05:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260280#M1384857</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-30T04:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Handling 2 messages in a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260281#M1384858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both the Messages have to be triggered independently.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 05:27:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260281#M1384858</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-30T05:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Handling 2 messages in a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260282#M1384859</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;Change the first message type from S to I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;message i010(zmm) with c_zero c_zero c_zero.&lt;/P&gt;&lt;P&gt;message e001(zmm) display like 'A'.&lt;/P&gt;&lt;P&gt;&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;Ginu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 05:32:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260282#M1384859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-30T05:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: Handling 2 messages in a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260283#M1384860</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;As you  need to display multiple messages, declare a table parameters of type BAPIRET2 and append the messages to this table parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Swarna Munukoti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 05:34:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260283#M1384860</guid>
      <dc:creator>former_member217544</dc:creator>
      <dc:date>2009-10-30T05:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Handling 2 messages in a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260284#M1384861</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;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how can I pass the place holders to Bapiret2 structure&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 09:38:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260284#M1384861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-30T09:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: Handling 2 messages in a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260285#M1384862</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;Use this function Module:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'BALW_BAPIRETURN_GET2'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      TYPE             =  &amp;lt;Message Type - E or S&amp;gt;&lt;/P&gt;&lt;P&gt;      CL               = &amp;lt;Mesage Class&amp;gt;&lt;/P&gt;&lt;P&gt;      NUMBER           = &amp;lt;Message Number&amp;gt;&lt;/P&gt;&lt;P&gt;      PAR1             = &amp;lt;variable1&amp;gt;&lt;/P&gt;&lt;P&gt;      PAR2             = &amp;lt;variable2&amp;gt;&lt;/P&gt;&lt;P&gt;      PAR3             = &amp;lt;variable3&amp;gt;&lt;/P&gt;&lt;P&gt;      PAR4             = &amp;lt;variable4&amp;gt;&lt;/P&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;P&gt;     RETURN           = return_msg&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return_msg is of type BAPIRET2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Swarna Munukoti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 09:48:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260285#M1384862</guid>
      <dc:creator>former_member217544</dc:creator>
      <dc:date>2009-10-30T09:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: Handling 2 messages in a function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260286#M1384863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here gt_return is of type bapiret2_t&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


    MOVE &amp;lt;fs_bank_details&amp;gt;-bankkey TO gv_msg_par1. 
    MOVE &amp;lt;fs_bank_details&amp;gt;-bankname TO gv_msg_par2.
    PERFORM fm_format_message USING gc_msgno083
                                    gc_e.


FORM fm_format_message  USING    pv_msgno TYPE sy-msgno
                                 pv_type TYPE bapi_mtype.

  DATA:ls_return TYPE bapiret2.

  CLEAR: ls_return.

  CALL FUNCTION 'BALW_BAPIRETURN_GET2'
    EXPORTING
      type   = pv_type   "Message type
      cl     = gc_bp     "Message class
      number = pv_msgno  "Message No
      par1   = gv_msg_par1 "value for place holder1
      par2   = gv_msg_par2 "value for place holder2
    IMPORTING
      return = ls_return.

  IF ls_return IS NOT INITIAL.
    APPEND ls_return TO gt_return.
  ENDIF.

ENDFORM.                    " FM_FORMAT_MESSAGE
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Oct 2009 09:51:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-2-messages-in-a-function-module/m-p/6260286#M1384863</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-10-30T09:51:30Z</dc:date>
    </item>
  </channel>
</rss>

