cancel
Showing results for 
Search instead for 
Did you mean: 

Sap Personas & RFC

Former Member
0 Kudos

Hi Guys,

I'm trying to get a simple data into my Personas textfield using RFC.

Same as showen in the link below:

How to use RFCs in Personas 3.0 - SAP Imagineering - SCN Wiki

var rfc = session.createRFC("BAPI_USER_GET_DETAIL", "");

     rfc.setParameter("USERNAME", "XXXXXX");

     rfc.requestResults(JSON.stringify(["ADDRESS", "RETURN"]));

     rfc.send();


var address = JSON.parse(rfc.getResult("ADDRESS"));

     session.utils.log(address.FULLNAME);

I'm getting an error when excuting my script

In Scripting editor session.createRFC is not found in the list of session.(objetcs)

Error during script execution:

TypeError: undefined is not a function

at eval (eval at <anonymous>


Can any one help me ?


Many thanks,

Medix

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

hi Mehdi,


Could you make sure you have implemented all the notes mentioned in 2050325.

Calling RFC was introduced in one of the last 2 notes I guess.

And after implementing all the notes, if it still doesn't work for you, please create a css with us.

Thanks,

Sushant

Former Member
0 Kudos

Hi Suchant,

Thanks a lot, I implemented the OSS notes and I have the Calling RFC now

But I still have an error when executing my script ( Statement rfc.send()  is anknown i guess).

Error during script execution:

Error: RestGui Batch Request Error:

Step 1 ({"get":"personas/state/xml/PERSONAS/RFC"}) failed: -1002 [expected tags: 'command']


I hope you can help me.


Many thanks

Mehdi

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sushant,

I am facing the same problem with Personas and RFC.

Moreover cannot find the note you have mentioned above . i.e. 2050325

Can you help?

Thankyou,

Umesh.

0 Kudos

Which Personas SP you are on right now?

And could show me your script

Former Member
0 Kudos

var usrName = session.findById("wnd[0]/usr/txtPersonas_1452796008773").text="USER01";

var rfc=session.createRFC("BAPI_USER_GET_DETAIL","");

rfc.requestResults(JSON.stringify(["ADDRESS","RETURN"]));

rfc.send();

session.utils.log("FIRST STEP");

var address=JSON.parse(rfc.getResult("ADDRESS"));

session.utils.log("second STEP");

session.findById("wnd[0]/usr/lblPersonas_1453926916445").text=ADDRESS.FULLNAME;

Former Member
0 Kudos

support package - SAPK-30002INPERSONAS

Release 300 - SP level -0002

0 Kudos

you have error in 2nd line

var rfc=session.createRFC("BAPI_USER_GET_DETAIL","");

should be

var rfc=session.createRFC("BAPI_USER_GET_DETAIL");

only 1 argument. This original discussion is an year old. Make sure you see the latest examples from our wiki page

http://wiki.scn.sap.com/wiki/display/Img/How+to+call+Remote+Enabled+ABAP+Function+Modules+in+Persona...

Former Member
0 Kudos

Thanks Sushant,

It worked.