<?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 Personas: JavaScript to get BAPI return message in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/personas-javascript-to-get-bapi-return-message/m-p/11362614#M1922308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All, Anyone know how to coding JavaScript to display error message return from BAPI. Example: BAPI_USER_GET_DETAIL if I input invalid username (e.g.XXX), BAPI will return message “User XXX does not exist” in Tables RETURN I try to get this information to show on Personas screen with coding below: var user = session.findById("wnd[0]/usr/txtPersonas_1444359130625").text ; var fm = session.createRFC("BAPI_USER_GET_DETAIL"); fm.setParameter("USERNAME",user); fm.requestResults(JSON.stringify(["ADDRESS","ADMINDATA","RETURN"])); fm.send(); var address = JSON.parse(fm.getResult("ADDRESS")); var admindata = JSON.parse(fm.getResult("ADMINDATA")); var msg = JSON.parse(fm.getResult("RETURN")); if(msg.TYPE != "E"){session.findById("wnd[0]/usr/txtPersonas_1444359251560").text = msg.MESSAGE;} else {session.findById("wnd[0]/usr/txtPersonas_1444359200004").text = address.LASTNAME; session.findById("wnd[0]/usr/txtPersonas_1444359251557").text = admindata.TRDAT;} but can not get RETURN-MESSAGE to show on screen, please help. Thank you in advance. Kaew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Oct 2015 10:07:30 GMT</pubDate>
    <dc:creator>former_member286109</dc:creator>
    <dc:date>2015-10-09T10:07:30Z</dc:date>
    <item>
      <title>Personas: JavaScript to get BAPI return message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/personas-javascript-to-get-bapi-return-message/m-p/11362614#M1922308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All, Anyone know how to coding JavaScript to display error message return from BAPI. Example: BAPI_USER_GET_DETAIL if I input invalid username (e.g.XXX), BAPI will return message “User XXX does not exist” in Tables RETURN I try to get this information to show on Personas screen with coding below: var user = session.findById("wnd[0]/usr/txtPersonas_1444359130625").text ; var fm = session.createRFC("BAPI_USER_GET_DETAIL"); fm.setParameter("USERNAME",user); fm.requestResults(JSON.stringify(["ADDRESS","ADMINDATA","RETURN"])); fm.send(); var address = JSON.parse(fm.getResult("ADDRESS")); var admindata = JSON.parse(fm.getResult("ADMINDATA")); var msg = JSON.parse(fm.getResult("RETURN")); if(msg.TYPE != "E"){session.findById("wnd[0]/usr/txtPersonas_1444359251560").text = msg.MESSAGE;} else {session.findById("wnd[0]/usr/txtPersonas_1444359200004").text = address.LASTNAME; session.findById("wnd[0]/usr/txtPersonas_1444359251557").text = admindata.TRDAT;} but can not get RETURN-MESSAGE to show on screen, please help. Thank you in advance. Kaew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 10:07:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/personas-javascript-to-get-bapi-return-message/m-p/11362614#M1922308</guid>
      <dc:creator>former_member286109</dc:creator>
      <dc:date>2015-10-09T10:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Personas: JavaScript to get BAPI return message</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/personas-javascript-to-get-bapi-return-message/m-p/11362615#M1922309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;example works for me:&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/807392" width="450" /&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;if you are stuck, you should also consider debugging in console&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiki.scn.sap.com/wiki/display/Img/Debugging+options+in+SAP+Screen+Personas+3.0" title="http://wiki.scn.sap.com/wiki/display/Img/Debugging+options+in+SAP+Screen+Personas+3.0"&gt;Debugging options in SAP Screen Personas 3.0 - SAP Imagineering - SCN Wiki&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Oct 2015 16:51:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/personas-javascript-to-get-bapi-return-message/m-p/11362615#M1922309</guid>
      <dc:creator>sushant_priyadarshi</dc:creator>
      <dc:date>2015-10-09T16:51:40Z</dc:date>
    </item>
  </channel>
</rss>

