‎2007 Feb 07 2:17 PM
Hi All,
I have an authorization object with following fields.
ACTVT = 02
WERKS = 1001
RANGE_FROM = 0
RANGE_TO = 999,999.00
I want to validate whether the user enters a value in between these two RANGE_FROM and RANGE_TO. How can i achieve this.
Also is there any way by which i can read the values maintained in the profile of the user for this authorization object. If this is possible then i can read the RANGE_FROM And RANGE_TO and then put a logic to validate.
Please let me know if any of the ways are possible.
Thanks
‎2007 Feb 07 3:37 PM
Hi Pankaj,
This is an example taken from the SAP Documentation:
Here, M_EINF_WRK is the object name, whilst ACTVT andWERKS are authorization fields. For example, a user with theauthorizations
M_EINF_WRK_BERECH1
ACTVT 01-03
WERKS 0001-0003 .
can display and change plants within the Purchasing and MaterialsManagement areas.
Such a user would thus pass the checks
AUTHORITY-CHECK OBJECT 'M_EINF_WRK'
ID 'WERKS' FIELD '0002'
ID 'ACTVT' FIELD '02'.
AUTHORITY-CHECK OBJECT 'M_EINF_WRK'
ID 'WERKS' DUMMY
ID 'ACTVT' FIELD '01': but would fail the check
AUTHORITY-CHECK OBJECT 'M_EINF_WRK'
ID 'WERKS' FIELD '0005'
ID 'ACTVT' FIELD '04'.
Hope it helps.
Regards,
Gilberto Li
‎2007 Feb 07 5:06 PM
Hi Gilberto,
Thanks for the input. I do have the idea of how authorization works.
My only issue is how can i check for a range of values. Like
AUTHORITY-CHECK OBJECT 'M_EINF_WRK'
ID 'WERKS' FIELD '0002'
ID 'ACTVT' FIELD '02'
ID 'FROM_RANGE >= 1000
ID TO_RANGE <= 1000
Where 1000 is the value entered by user in some cost field and
FROM_RANGE = 0
TO_RANGE = 9999999.
I hope this is clear.
Thanks
Pankaj