cancel
Showing results for 
Search instead for 
Did you mean: 

Displying records based on userrole.

Former Member
0 Kudos

Hello,

Can anyone help with the issue which i'm facing now.The issue is " I have one screen with both form & list which has been developed using feeder class.In the list,I'm showing all records from the custom database which i have.Now the issue is there is one field namely USERROLE with domain values as (LSMG USERS,CMSG USERS,HOD's).

Now i need to check whethere the logged in name with the roles and i need to show only that records into the list.

For ex: If my USERROLE in custom table is CSMG.If i run the application,I should see only those records where my sy-uname is there in particular user role.

Please help me in writing a query.

Santhosh

Accepted Solutions (1)

Accepted Solutions (1)

RicardoRomero_1
Active Contributor
0 Kudos

Hi,

If I have not misunderstood your doubt, you need to use the table AGR_USERS, where:

AGR_NAME = USERROLE
UNAME = sy-uname

Regards,

Former Member
0 Kudos

Hello Nihar,

My custom table is no where related to AGR_USERS. The userrole are there in the same table which i'm using to show records in list which i have.

SANTHOSH

Former Member
0 Kudos

Thanks Ricardo.

Issue resolved.

Santhosh

Answers (1)

Answers (1)

0 Kudos

Hi Santosh,

As mentioned by Ricardo, you can validate the content fetched from the custom table with the AGR_USERS table by giving the parameters for role and user name. If it matches then show only those records. I belive the requirement you have mentioned is just a query change.

Regards,

Nihar

Former Member
0 Kudos

Hello Nihar,

My custom table is no where related to AGR_USERS. The userrole are there in the same table which i'm using to show records in list which i have.

SANTHOSH

0 Kudos

You can use the function module as mentioned below.

 

CALL FUNCTION 'GET_DOMAIN_VALUES'

EXPORTING

domname = 'USERROLE'

TEXT = 'X'

 

* FILL_DD07L_TAB = ' '

 

TABLES

VALUES_TAB = values_tab

 

* VALUES_DD07L =

 

EXCEPTIONS

NO_VALUES_FOUND = 1

OTHERS = 2

.

This would fetch the value table of the domain userrole as you have mentioned then you can filterout on based on that i hope?

Is my understanding of your query correct?

Former Member
0 Kudos

Thanks Nihar.

Issue resolved.

Santhosh