I have created authorization object code for company code validation.i have given code.
data : c_actvt(2) type c value '03'.
SELECT bukrs FROM t001 INTO TABLE i_bukrs WHERE bukrs IN s_bukrs.
IF sy-subrc EQ 0.
LOOP AT i_bukrs INTO wa_bukrs.
AUTHORITY-CHECK OBJECT 'F_LFA1_BUK'
ID 'BUKRS' FIELD wa_bukrs-bukrs
ID 'ACTVT' FIELD c_actvt.
IF sy-subrc <> 0.
MESSAGE 'You do not have authorization for Company code' TYPE c_error.
In this code excuted without any error..but its not giving proper answer..In run time i have changed some wrong company code like wa_bukrs-bukrs = 'ABCD' but its not giving the Error like "'You do not have authorization for Company code'".Please Help on this..
Moved to correct forum
Edited by: Rob Burbank on Apr 7, 2009 11:12 AM