Showing results for 
Search instead for 
Did you mean: 

Calling a rfc function module with a dynamic field

Former Member
0 Kudos


I wish to call a function module from an external system, namely

HR_GETEMPLOYEEDATA_FROMUSER and i wish to default the

user name field to the user currently logged in to SAP i.e. sy-uname.

Is there a way to pass the value in to the fm so that the call

runs with the value of username = sy-uname.

i.e. what should ??? be in the following call from the remote system :



username = ???


Hope you can help! Many thanks in advance!


Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

You cannot send a token like "&sy-uname&" in a RFC parameter, but this information is available to your external program in the attributes of the Connection object it uses to communicate with SAP.

In DCOM, the Session object has the method "GetConnectionAttribute()" that can give you the login name you are using to connect to SAP. The java & .NET connections must have something similar.

Your code can find thus find the login name of your connection, even if the connection object is passed to it as a parameter from some other process.

Developer Advocate
Developer Advocate
0 Kudos


Rich Heilman

Message was edited by: Rich Heilman