on 09-07-2010 6:45 PM
We currently have a requirement to prevent users issuing materials to orders of a certain type via transaction MB1A, unless they have the correct authorisation in one of their assigned roles.
So far I've managed to achieve this using a CO validation (defined in transaction OKC7) which calls exit U100, part of form pool ZGGBR000. The code I have in this exit currently looks like this:
FORM u100 USING b_result.
AUTHORITY-CHECK OBJECT 'I_AUART'
ID 'IWERK' FIELD '1000'
ID 'AUFART' FIELD 'ZHI1'.
IF SY-SUBRC = 0.
B_RESULT = B_TRUE.
ELSE.
B_RESULT = B_FALSE.
ENDIF.
ENDFORM.
This code currently works for order type ZHI1, but is obviously very rudimentary as I'm a functional consultant rather than an ABAPer. What I'd like to achieve is to avoid hard-coding the order type, by passing the type of the current order into the exit from the validation. How would I go about achieving this?
Alternatively, is there a way for the exit to retrieve the current order type itself? This can be achieved in the validation transaction by just referencing the field CAUFV-AUART, but I'm not sure how to achieve this in ABAP.
Any help or guidance would be greatly appreciated.
Thanks,
Richard
Hi
You can maintain a Z table where in you can specify the order types to be checked during the validation... if the order type fetched in u100 exists in the Z table, the validation should work, else not
You can also create a variable and mention your order types in this variable.. I dont know where this created.. your ABAPer would be knowing this... This variable is directly maintainable in production.. This way you can avoid Z table also
Regards
Ajay M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.