aliknl64
5th February 2012, 22:12
Hello members,

I have requirement wherein i was asked to check if it is possible to write a code to validate a field in Item Master. We do not have any source codes.

The requirement is to limit user see only 2 item groups from the list insted of all item groups. I made a new display session and had written query extension command to see only 2 item groups. But the user knows the other item groups and is able to enter the item group which he cannot see it from my customized session.

How can i restrict user not to use other item groups in the standard session.


Thanks,

Ali.

JaapJD
6th February 2012, 09:54
You can use the Table Data Authorizations (ttams3145m000).

ulrich.fuchs
6th February 2012, 12:30
You could use a user exit (Provided that you are on an up to date FP3 or above):

Create a script that is named like the item master table + "ue", so tcibd001ue (The name ist important). Make it look like this:

#include <bic_dal>
#include "itcmcs2000"
#include <bic_dam>

table ttcibd001


function extern long ue.after.before.save.object(long mode)
{
if tcibd001.citg <> "bla " or tcibd001.citg <> "foo " then
dal.set.error.message ("@Item Group not allowed")
return (DALHOOKERROR)
endif
return (0)
}

JaapJD
6th February 2012, 12:36
I agree with Ulrich, except for the condition. The condition if tcibd001.citg <> "bla " or tcibd001.citg <> "foo " then is always true!

aliknl64
12th February 2012, 07:08
Thank you so much ulrich.fuchs. It helped me a lot.

ALi.

ulrich.fuchs
13th February 2012, 16:17
I agree with Ulrich, except for the condition. The condition is always true!

Ouch. You're right, of course :-)