<?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: bapiret2 message not showing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203075#M1982011</link>
    <description>&lt;P&gt;1. Where do the message variables get filled (lv_type, lv_id, lv_no, lv_v1, lv_v2)? It’s not shown in your coding. &lt;BR /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt; Are the values coming from actual custom or standard defined messages, meaning, do the values that you insert in lv_id, lv_no exist in ABAP repository?&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;"...                                                                                                                         
DATA: lv_type TYPEsy-msgty.
DATA: lv_id TYPEsy-msgid.
DATA: lv_no TYPEsy-msgno.
DATA: lv_v1 TYPEsy-msgv1.
DATA: lv_v2 TYPEsy-msgv2.

es_bapiret2-type = lv_type.
es_bapiret2-id = lv_id.
es_bapiret2-number = lv_no.
es_bapiret2-message_v1 = lv_v1.
es_bapiret2-message_v2 = lv_v2.

"...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. In this part, you fill the message variables „manually“ and they are not based on existing ABAP repository messages. &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ID is not a real message Id code, instead you are misusing it as message content.&lt;/LI&gt;&lt;LI&gt;MESSAGE_V1 is misused as ‚further‘ message content when instead it should be in general a Dynamic value that is replaced for a placeholder in a static message content to give detailed info about the error, e.g. a material number, a order number, a Field Name, and so on.&lt;/LI&gt;&lt;LI&gt;ES_BAPIRET2 is also not cleared before filling it with new values, leading to „mixed“ messages.&lt;/LI&gt;&lt;LI&gt;MESSAGE is not set in your case of setting message content manually, e.g. not based on ABAP repository message.&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;"...
IF IV_MAX_ROWS GT0.
  es_bapiret2-type ='S'.
  es_bapiret2-id ='Input rows found'.
  es_bapiret2-message_v1 ='Record with input rows found'.

  select mandt ebeln bedat bsart lifnr waers knumv FROM ekko into
  CORRESPONDING FIELDS OF table it_zheader UP TO IV_MAX_ROWS ROWS.
"...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;3. if you want to replace placeholders in ABAP repository messages, you can use the MESSAGE statement or the FM BALW_BAPIRETURN_GET1&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapmessage.htm"&gt;https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapmessage.htm&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapmessage_into.htm"&gt;https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapmessage_into.htm&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;4. Have a look at this tutorial to learn a lot more about how to create custom message classes and messages as well as placeholders and how to replace those with dynamic values; and how to use all of this in coding:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://www.saptutorial.org/use-message-class-abap/"&gt;https://www.saptutorial.org/use-message-class-abap/&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;5. Search also for other question and answers about bapiret2 structures, how to fill them and use them:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://answers.sap.com/questions/3755618/how-to-fill-bapireturn-table-.html"&gt;https://answers.sap.com/questions/3755618/how-to-fill-bapireturn-table-.html&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://answers.sap.com/questions/1314977/how-to-fill-bapiret2-parameter.html"&gt;https://answers.sap.com/questions/1314977/how-to-fill-bapiret2-parameter.html&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Sat, 18 Apr 2020 10:58:19 GMT</pubDate>
    <dc:creator>michael_piesche</dc:creator>
    <dc:date>2020-04-18T10:58:19Z</dc:date>
    <item>
      <title>bapiret2 message not showing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203072#M1982008</link>
      <description>&lt;P&gt;Hi, im actually doing bapiret2 in Class, below are the following code i inserted for bapiret.&lt;/P&gt;
  &lt;P&gt;the system field sy-msgv1 it seems like it is not working as the message is &lt;STRONG&gt;Empty (check screenshot)&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt;Anything have i miseed?&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/1801727-capture.png"&gt;capture.png&lt;/A&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;ES_BAPIRET2	Exporting	Type	BAPIRET2                                                                                                                          
DATA: lv_type TYPE sy-msgty.
DATA: lv_id TYPE sy-msgid.
DATA: lv_no TYPE sy-msgno.
DATA: lv_v1 TYPE sy-msgv1.
DATA: lv_v2 TYPE sy-msgv2.


es_bapiret2-type = lv_type.
es_bapiret2-id = lv_id.
es_bapiret2-number = lv_no.
es_bapiret2-message_v1 = lv_v1.
es_bapiret2-message_v2 = lv_v2.

IF IV_MAX_ROWS GT 0.
es_bapiret2-type = 'S'.
es_bapiret2-id = 'Input rows found'.
es_bapiret2-message_v1 = 'Record with input rows found'.

select mandt ebeln bedat bsart lifnr waers knumv
FROM ekko into CORRESPONDING FIELDS OF table it_zheader UP TO IV_MAX_ROWS ROWS.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Apr 2020 17:00:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203072#M1982008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2020-04-17T17:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: bapiret2 message not showing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203073#M1982009</link>
      <description>&lt;P&gt;MESSAGE is empty because you don't fill it.&lt;/P&gt;&lt;P&gt;If you want to fill it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MESSAGE ID lv_id TYPE lv_type NUMBER lv_no WITH lv_v1 lv_v2
    INTO es_bapiret2-message.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Apr 2020 18:05:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203073#M1982009</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2020-04-17T18:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: bapiret2 message not showing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203074#M1982010</link>
      <description>&lt;P&gt;To properly use BAPIRET2 messages;&lt;/P&gt;&lt;P&gt;TYPE - Type of message (S, E, A, X, I, W)&lt;/P&gt;&lt;P&gt;ID - Message class containing your message&lt;/P&gt;&lt;P&gt;NUMBER - Message number in message class used&lt;/P&gt;&lt;P&gt;MESSAGE - Actual Message&lt;/P&gt;&lt;P&gt;MESSAGE_V1 = Message variable 1&lt;/P&gt;&lt;P&gt;MESSAGE_V2 = Message variable 2&lt;/P&gt;&lt;P&gt;MESSAGE_V3 = Message variable 3&lt;/P&gt;&lt;P&gt;MESSAGE_V4 = Message variable 4&lt;/P&gt;&lt;P&gt;Then you can fill your BAPIRET2 like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MESSAGE ID lv_id 
   TYPE lv_type
 NUMBER lv_no 
   WITH lv_v1 lv_v2
   INTO es_bapiret2-message.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Apr 2020 08:28:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203074#M1982010</guid>
      <dc:creator>teshanappadoo</dc:creator>
      <dc:date>2020-04-18T08:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: bapiret2 message not showing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203075#M1982011</link>
      <description>&lt;P&gt;1. Where do the message variables get filled (lv_type, lv_id, lv_no, lv_v1, lv_v2)? It’s not shown in your coding. &lt;BR /&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt; Are the values coming from actual custom or standard defined messages, meaning, do the values that you insert in lv_id, lv_no exist in ABAP repository?&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;"...                                                                                                                         
DATA: lv_type TYPEsy-msgty.
DATA: lv_id TYPEsy-msgid.
DATA: lv_no TYPEsy-msgno.
DATA: lv_v1 TYPEsy-msgv1.
DATA: lv_v2 TYPEsy-msgv2.

es_bapiret2-type = lv_type.
es_bapiret2-id = lv_id.
es_bapiret2-number = lv_no.
es_bapiret2-message_v1 = lv_v1.
es_bapiret2-message_v2 = lv_v2.

"...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;2. In this part, you fill the message variables „manually“ and they are not based on existing ABAP repository messages. &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ID is not a real message Id code, instead you are misusing it as message content.&lt;/LI&gt;&lt;LI&gt;MESSAGE_V1 is misused as ‚further‘ message content when instead it should be in general a Dynamic value that is replaced for a placeholder in a static message content to give detailed info about the error, e.g. a material number, a order number, a Field Name, and so on.&lt;/LI&gt;&lt;LI&gt;ES_BAPIRET2 is also not cleared before filling it with new values, leading to „mixed“ messages.&lt;/LI&gt;&lt;LI&gt;MESSAGE is not set in your case of setting message content manually, e.g. not based on ABAP repository message.&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;"...
IF IV_MAX_ROWS GT0.
  es_bapiret2-type ='S'.
  es_bapiret2-id ='Input rows found'.
  es_bapiret2-message_v1 ='Record with input rows found'.

  select mandt ebeln bedat bsart lifnr waers knumv FROM ekko into
  CORRESPONDING FIELDS OF table it_zheader UP TO IV_MAX_ROWS ROWS.
"...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;3. if you want to replace placeholders in ABAP repository messages, you can use the MESSAGE statement or the FM BALW_BAPIRETURN_GET1&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapmessage.htm"&gt;https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapmessage.htm&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapmessage_into.htm"&gt;https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapmessage_into.htm&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;4. Have a look at this tutorial to learn a lot more about how to create custom message classes and messages as well as placeholders and how to replace those with dynamic values; and how to use all of this in coding:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://www.saptutorial.org/use-message-class-abap/"&gt;https://www.saptutorial.org/use-message-class-abap/&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;5. Search also for other question and answers about bapiret2 structures, how to fill them and use them:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://answers.sap.com/questions/3755618/how-to-fill-bapireturn-table-.html"&gt;https://answers.sap.com/questions/3755618/how-to-fill-bapireturn-table-.html&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://answers.sap.com/questions/1314977/how-to-fill-bapiret2-parameter.html"&gt;https://answers.sap.com/questions/1314977/how-to-fill-bapiret2-parameter.html&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Sat, 18 Apr 2020 10:58:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203075#M1982011</guid>
      <dc:creator>michael_piesche</dc:creator>
      <dc:date>2020-04-18T10:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: bapiret2 message not showing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203076#M1982012</link>
      <description>&lt;P&gt;I also doubt that 'Input rows found' is a valid message class.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Apr 2020 17:19:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapiret2-message-not-showing/m-p/12203076#M1982012</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2020-04-18T17:19:43Z</dc:date>
    </item>
  </channel>
</rss>

