Quantcast
Channel: SCN : Unanswered Discussions - BI Platform
Viewing all articles
Browse latest Browse all 5661

Add roles using BAPI_USER_ACTGROUPS_ASSIGN

$
0
0

Hello everyone.

 

I'm trying to build a program to release roles to users.

I'm building with Visual Studio 2012 and .Net Connector 3.

 

After I made the connection, I do the following:

 

            RfcDestination dest = RfcDestinationManager.GetDestination("Conexao");
            RfcRepository repo = dest.Repository;
            IRfcFunction fAddRole = repo.CreateFunction("BAPI_USER_ACTGROUPS_ASSIGN");


            string getUser = 232377; //this is the user

 

            fAddRole.SetValue("USERNAME", getUser);

            IRfcTable tOptions = fAddRole.GetTable("ACTIVITYGROUPS");
            tOptions.Append();
            tOptions.SetValue("AGR_NAME", "Z_DEBUG_REPLACE"); //"Z_DEBUG_REPLACE" is the role I want to add
            fAddRole.Invoke(dest);

 

Here I can add the role to the user, BUT, it removes all of the roles that he had.

I've searched a lot on the internet, and everyone says that I have to use BAPI_GET_USER_DETAIL to obtain user roles and than add it again.

 

I don't know how to make this though. It's necessary to get the FROM_DAT and the TO_DAT of every role.

 

Appreciate any help.


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>