cancel
Showing results for 
Search instead for 
Did you mean: 

SY_UNAME in S/4HANA Cloud

Anna_Rafter
Participant
0 Kudos

Hello everyone,

We are trying to implement some badis in S/4HANA Public Cloud, for example, Generate Project IDs - /CPD/CL_ENGMTPROJECT_GEN_ID. To comply the requirements defined by our client, we need to verify the user ID which is creating the Project. In SAP R/3 we would use the System Variable 'SY_UNAME'. How could we get this information in S/4HANA Cloud?

Any help would be appreciated.

Thank you in advance.

Best Regards,

Anna

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anna,

This variable should be available as $session.user.

rgds,

Jeroen

Anna_Rafter
Participant

Hi Jeroen,

Thanks a million for such a quick answer.

Sadly, we don't think that variable is available in ABAP, as far as I know it's only suitable for JAVA script.

We ended up retrieving this information by using the following code:

DATA(lv_userID) = cl_abap_context_info=>get_user_technical_name( ).

We then retrieve the user logged to the system.

SELECT SINGLE PersonFullName INTO ‎@DATA(lv_name)

FROM I_BusinessUser

WHERE userID = ‎@lv_userID.

Hope this is useful if someone else needs to get this data.

Thanks again for your response.

Best Regards,

Anna

Answers (0)