on 2016 Apr 26 5:20 PM
Hello,
I am trying to incorporate RFC calls into some Personas scripts but they seem to be returning null values. I tested in SE37 the same function modules, same inputs and the expected values are returned. I decided to try one of the simple examples from the portal the and get the same result. Here is the code:
var rfc = session.createRFC("BAPI_USER_GET_DETAIL");
rfc.setParameter("USERNAME", "*******");
rfc.requestResults(JSON.stringify(["ADDRESS","RETURN"]));
rfc.send();
var address = JSON.parse(rfc.getResult("ADDRESS"));
Here is the error:
Error during script execution:
TypeError: Cannot read property 'textContent' of null
at sap.personas.scripting.scriptingEngine.GuiRFC.getResult (http://svrsaperpdev.mcc.local:8100/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/Script...)
at eval ([AppID:VA01]>[Flavor:VA01_RM_01_TEMP]>[Script:wnd[0]/scrptPersonas_0-GOTO_DETAIL]:50:30)
at Object.self.executeScriptInternal (http://svrsaperpdev.mcc.local:8100/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/Script...)
at Object.sap.personas.scripting.executeScriptInternal (http://svrsaperpdev.mcc.local:8100/sap/bc/personas3/core/script/sap/personas/fw/its/scripting/Script...)
Since I get the same error on all FMs I have tried could this be something related to the RFC connection? How to find out what RFC connection is used in this case?
Hello Rob,
Have you maintained the FM in the whitelist?
/n/personas/admin -> menu "Goto" -> "Whitelists" -> "FM Whitelist".
Please also visit the Wiki "How to call Remote Enabled ABAP Function Modules in Personas 3.0"
Kind regards,
Cris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Guys,
We did not have that note applied, so it has now been applied and now the "User detail" RFC example works as expected. Thank you! However, I having trouble with the actual FM I need to use, BAPI_CUSTOMER_GETDETAIL2. No error message but value returned is blanks. I verified the input parameters in SE37 test mode and I am getting the expected values returned. I am using the same syntax as with the example:
var rfc1 = session.createRFC("BAPI_CUSTOMER_GETDETAIL2");
rfc1.setParameter("CUSTOMERNO", ship_to);
rfc1.requestResults(JSON.stringify(["CUSTOMERGENERALDETAIL", "RETURN"]));
rfc1.send();
var customergeneraldetail = JSON.parse(rfc1.getResult("CUSTOMERGENERALDETAIL"));
var taxjurcode = customergeneraldetail.TAXJURCODE;
session.utils.log(taxjurcode);
When the code above is executed, the variable taxjurcode has a blank value, whereas in SE37 it returns the correct value. The FM is included in the whitelist and the script validates without errors.
Any help is appreciated.
Thanks,
Rob Howery
User | Count |
---|---|
83 | |
12 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.