Skip to Content

Personas 3.0 SP 4 - Get user name in JavaScript.

Jan 23, 2017 at 06:15 PM


avatar image


I'm creating a flavor for IW21, and I need to load the user's name into a Reported By field using JavaScript.

I've searched for an answer in numerous posts, and I keep seeing a reference to SY-UNAME. However, this appears to be a system variable available for ABAP, but not JavaScript.

I would also like to be able to use the user name for a remote function call to BAPI_USER_GET_DETAIL, but the examples I've found, like the one below, use a hard-coded user name and don't explain how to get that dynamically.

var rfc = session.createRFC("BAPI_USER_GET_DETAIL");
rfc.setParameter("USERNAME", "PRIYADARSHIS");
rfc.requestResults(JSON.stringify(["ADDRESS", "RETURN"]));

Can someone provide a JavaScript example on how I can get the user name?

Thank you very much for your help!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Tamas Hoznek
Jan 23, 2017 at 10:23 PM
0 will give you the current user name.

10 |10000 characters needed characters left characters exceeded