cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Personas 3.0 -> retrieve data via RFC (Tables parameter)

jan_rehfeld
Explorer
0 Kudos

Hi experts,

I have a scripting problem when trying to retrieve data via RFC. I know how to get data from an export parameter (JSON.parse(rfc.getResult("Parameter Name")). But I want to retrieve data from a table parameter. In the community you can find an example with functional module 'BAPI_USER_GET_DETAIL'. Does anybody know how to get data from one of the table parameters (for example 'ACTIVITYGROUPS' or 'PROFILES')?

It would be great if someone could write a short answer.

Jan

Accepted Solutions (1)

Accepted Solutions (1)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

How to call Remote Enabled ABAP Function Modules in Personas 3.0 - SAP Imagineering - SCN Wiki has an example of working with tables. It is using the table type EXPORT parameter but I'd expect the same to work with TABLES as well (just by referencing the TABLES parameter name). Did you try that?

jan_rehfeld
Explorer
0 Kudos

Hi Tamas,

thank you for your reply. I tried to work with TABLES but it did not work. The scripting engine seems to expect some other keyword (not 'rfc.getResult'). I suspect that this is still an open point concerning calling remote function calls with Javascript.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

The following script works fine for me to accept a user name from a screen input then read the first profile of the user and write it into a label on the screen:

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

var user=session.findById("wnd[0]/usr/txtPersonas_1452134771561").text;

rfc.setParameter("USERNAME", user);

rfc.requestResults('["PROFILES", "RETURN"]');

rfc.send();

var profs=JSON.parse(rfc.getResult("PROFILES"));

var profile=profs[0].BAPIPROF;

session.findById("wnd[0]/usr/lblPersonas_1452135391279").text=profile;

Handling TABLES parameters doesn't differ from the example of 'BAPI_USER_GET_DETAIL' where the EXPORTed table parameter is used.

jan_rehfeld
Explorer
0 Kudos

Hi Tamas,

thank you very much for your example code. When I use the same syntax it works fine. My problem was that I did not use the associated type 'BAPIPROF'.

Jan

Answers (1)

Answers (1)

vijaybhaskarraju_vegesana
Active Participant
0 Kudos

Hi Jan,

Please refer to Step 9 in the below link provided.

Regards,

Vijay