mostrightfuture
19th November 2004, 16:30
Hi friends

How to read records from table "ttaad200", this table exists only in company "000". I have to read all records from this table and check what authorization roles are assigned to users.

Thanks in advance
Mahmood

mark_h
19th November 2004, 18:12
Something like this:


select ttaad200.stpr, ttaad200.utyp, ttaad200.user
from ttaad200
where ttaad200._index1 = {:prod.user}
and ttaad200._compnr = 0
as set with 1 rows
selectdo
selectempty
message("User not found.")
return(true)
endselect
if ttaad200.stpr = ttaad.stpr.menu.browser then
return(false)
endif
return(true)


Just pulled this from some code I was writing.

Mark

NPRao
19th November 2004, 20:38
You can use the print session ttams1400m000 from the Role Data session (ttams2100m000) and select only Authorizations to get the role data info.

Hitesh Shah
20th November 2004, 06:47
At times it is possible that ttaad200 data is not coverted to runtime and the data in ttaad200 does not reflect correct information. Also there are some parameters like session_timeout which u can maintain in ufile without being able to maintain in ttaad2100m000.

In such case u can use the get.resource$ function .


NAME
get.resource$ - function reading resource information.

SYNOPSIS
string GET.RESOURCE$ ( string name(256) )

DESCRIPTION
This function returns the value associated with the given resource of
the current user. Resources are specified in the u<user> file in the
'$BSE/lib/user' directory.

A string containing the resource value will be returned. If the resource
can't be found an empty string will be returned ( the resource may be
empty ! )

Example:
| user file contains e.g. following information:
| compnr:100
| pacc:30Sa

string company(3), pack_comb(8)

company = get.resource$ ( "compnr" )
pack_comb = get.resource$ ( "pacc" )

| Now, company contains the string "100" and pack_comb = "30Sa"