cancel
Showing results for 
Search instead for 
Did you mean: 

portal role from abap user

Former Member
0 Kudos

hi sap-gurus

how can I get the portal roles which are connected with an abap sap user.

for example an abap user starts a wd application in the portal and I want to find out if he is in the administrator role for this web dynpro application and has enhanced rights for the application?

has anyone an idea how I can read out these informations in my wd application?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

In general, you wouldn't necessarily go after the portal roles for that information. You would use the local role information, by performing authorization checks in ABAP coding. The local role information is likely the basis of the portal roles, however there really isn't an API or Service (yet) to allow for the easy consumption of the portal roles.

Former Member
0 Kudos

thank you thomas for your answer...

ok you are right...the local roles from the abap user might be the solution but how can I read out the roles from the abap user?

is there a bapi or can I read some system tables to get these local roles which can be seen in ta su01?

what do you mean with "authorization checks"...can you give me a sample coding?

regards

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

In ABAP you don't generally read roles directly. Instead there is a concept called an authorization check. This is old school ABAP stuff, but it still holds true in Web Dynpro ABAP. You can lookup the term authority-check in the ABAP keyword documentation for more details. Here is a quick example. This is the authorization check to access Carriers - broken down by the Carrier ID and the Activity Display (03):

PARAMETERS carr TYPE spfli-carrid. 

AT SELECTION-SCREEN. 
  AUTHORITY-CHECK OBJECT 'S_CARRID' 
    ID 'CARRID' FIELD carr 
    ID 'ACTVT'  FIELD '03'. 

  IF sy-subrc <> 0. 
    MESSAGE 'No authorization' TYPE 'E'. 
  ENDIF. 

Usually you limit the access to object via different activity types.

There are also several sections of the online help on the topic:

ht[http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dbaccb35c111d1829f0000e829fbfe/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/9f/dbaccb35c111d1829f0000e829fbfe/frameset.htm]

Former Member
0 Kudos

thank you again....I found another post here..

I think I have to make the following steps to make an authority-check (step 2) in my wda coding:

1. Create an authorisation object (SU21)

2. Put an authorisation check for this object in your report (AUTHORITY-CHECK)

3. Create a role that contains this object (PFCG)

4. Assign this role to all the users who require access to the report (SU01).

is it the right way?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

That sounds roughly like the steps. If you are working with a standard SAP object, you might find that the authorization object already exists and you could just reuse it.

Former Member
0 Kudos

thank you thomas....I´ll try this when our vpn to the sap system is working

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Thorsten!

Came across your post and I seem to have a similar requirement. I need to read Portal roles for a user in a ABAP report.

Is there a way to do so. I mean a BAPI or FM that gets the portal roles for a specified user?

Any help in this regard is inviting.

Thanks,

Trishna

Former Member
0 Kudos

Hello,

Is there any way of accessing and manipulating portal user roles from ABAP WD? I know this is quite easily possible with JAVA, but we do not have java tools available to build applications for dynamic portal role assignement.

Regards,

Gopal.