09-08-2011 7:09 AM
hi all,
i am trying to make a field (RKOSTL) in the cat2 screen a required field. In researching this I found that cats0003 can be used to achieve this but I am not able to make it a required one.
If I attempt to save the cat2 screen without entering the CATSD-RKOSTL entry it should throw an error saying this is a required field. I used the cats0003 and cats0005 exits but my code is not being picked up in either of the user exits.
In my code I am checking the tcats-variant and then if beguz ne space and awart = z001, I am raising an error message.
but this is not working. If anyone could give me pointers or idea it would be very helpful to me.
thanks,
kiran
09-08-2011 8:56 AM
Hi Kiran,
Most Important pointer is: read thoroughly the documentation of CATS0003.
It is as below.
You can use this SAP enhancement to validate any data already recorded.
Validations are performed for one cell (an entry by one person on one
day).
Example: You do not want user XYZ to record time data for receiver cost
center 0000000666. The transfer structure used is the structure FIELDS.
This structure contains all the account assignment fields relevant to
you. If you want to return messages to the standard program, you will
also need to use internal table I_MESSAGES. In this example, error
message "001" is issued with message class "ZZ", message type "E", and
parameter "XYZ". Making entries in table I_MESSAGES is equivalent to
using the command "MESSAGE E001(ZZ) WITH 'XYZ'". However, to ensure that
all the program flows can run, fill the internal table I_MESSAGES rather
than use this command.
Example:
REFRESH I_MESSAGES.
IF FIELDS-RKOSTL = '0000000666' AND SY-UNAME = 'XYZ'.
I_MESSAGES-MSGTY = 'E'.
I_MESSAGES-MSGID = 'ZZ'.
I_MESSAGES-MSGNO = '001'.
I_MESSAGES-MSGV1 = 'XYZ'.
APPEND I_MESSAGES.
ENDIF.
Code not getting picked up? why? Put session break points and debug. Don't implement CATS0005 for a while and test it completely with CATS0003.
Let me know back. Thanks.
09-09-2011 2:32 AM
09-08-2011 10:06 AM
Hi Kiran,
Before using a user exit for coding please check if it is being added to a project or not.
If not added to a project your code will not be exicuted.
Check the same throuth CMOD.
Thanks,
Subhashree.
09-08-2011 3:02 PM
Kiran,
We do not need to use the exit to make the field CATSD-RKOSTL (Receiver Cost Centre) a required entry. This can be done through configuration. Please ask your functional consultant to check the field status settings (CAC2) and select the radio button "required" for this field. This should solve your request.
Regards
Sreekanth