cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching data from RFC using screen personas

0 Kudos
844

Hi ,

I am new to SAP Screen Persona and I am trying to fetch values using RFC . For this I was trying some examples given in blog - sample . I did all the necessary checks and wrote the same piece of code given in the blog for tcode SU01 . But I am getting error . I will share some screenshots for clarity .

I am using the exact same code but its giving error for me . Can anyone please help me with it . As what to do in this case .

Its giving error line no.4 as - Argument of type 'string' is not assignable to parameter of type 'object'.

View Entire Topic
Mathys
Explorer
0 Kudos

Not sure why yours wouldn't work, maybe move the field value retrieval above the RFC processing?

I just used this on IW32 on the Control tab to get the detail from last changed by.

var username = session.findById("wnd[0]/usr/subSUB_ALL:SAPLCOIH:*/ssubSUB_LEVEL:SAPLCOIH:*/tabsTS_1100/tabpVWPA/ssubSUB_AUFTRAG:SAPLCOIH:1140/txtCAUFVD-AENAM").text;


var oRFC = session.createRFC("BAPI_USER_GET_DETAIL");
oRFC.setParameter("USERNAME", username);
oRFC.setParameter("RETURN", [{"TYPE":"","ID":"","NUMBER":"000","MESSAGE":"","LOG_NO":"","LOG_MSG_NO":"000000","MESSAGE_V1":"","MESSAGE_V2":"","MESSAGE_V3":"","MESSAGE_V4":"","PARAMETER":"","ROW":0,"FIELD":"","SYSTEM":"0000000000"}]);
oRFC.requestResults(["ADDRESS","RETURN"]);
oRFC.send();
var _ADDRESS = oRFC.getResultObject("ADDRESS");
var _RETURN = oRFC.getResultObject("RETURN");

session.utils.log(_ADDRESS.FULLNAME);