08-14-2007 4:42 PM
hi all,
i want to use exit for tcode--- CAT2 in HR module
the requirement is whenever employ enters the time sheet details if the employ forgot to fill the network number (RNPLNR) which is in Data entery section
at the time of seving the system has to give an error msg.
for this am using Enhancement CATS0006 and the exit name is EXIT_SAPLCATS_006
but i don't under stand how to write code for perticular that field?
plz its urgent,
i want code for that.
Thanks & Regards
Amit.
08-14-2007 8:18 PM
Amit,
There is a table parameter being passed into this function module called CHECK_TABLE. This table contains the data you want to verify.
There is another table parameter called I_MESSAGES. If you reach your error condition, then you populate this table with the message to send back out.
This may not be a complete solution, but here is start for you.
loop at check_table.
if check_table-rnplnr is initial.
i_messages-MSGID = 'ZHR'.
i_messages-MSGTY = 'E'.
i_messages-MSGNO = '000'.
i_messages-MSGV1 = 'Enter the network number.
i_messages-PERNR = w_CHECK_TABLE-PERNR.
i_messages-CATSDATE = w_CHECK_TABLE-WORKDATE.
APPEND i_messages.
CLEAR i_messages.
endif.
endloop.
Just be sure to use a valid message class and message number. This is an example from our system.
Best Regards,
Chris H.
08-16-2007 8:03 AM
Hi Chris
thanks for reply, i will use that code if am having any problem i will again send u the problem.
Thanks & Regards,
Amit.
08-22-2007 7:56 AM
Hi Chris
i hope u remember,
i want to use exit for tcode--- CAT2 in HR module
the requirement is whenever employ enters the time sheet details if the employ forgot to fill the network number (RNPLNR) which is in Data entery section
at the time of seving the system has to give an error msg.
for this am using Enhancement CATS0006 and the exit name is EXIT_SAPLCATS_006
and am using the code u have given me but when am looping the check table it is bringing the values in to the header and if condation is not satisfying.
i am giving the code which am using
plz suggest me what to do its very urgent.
data: w_check_table like check_table.
if SAP_TCATS-VARIANT eq 'BNC_MUMB'.
loop at check_table.
if check_table-rnplnr is initial.
i_messages-MSGID = 'ZH'.
i_messages-MSGTY = 'E'.
i_messages-MSGNO = '020'.
i_messages-MSGV1 = 'Enter the network id'.
i_messages-PERNR = w_CHECK_TABLE-PERNR.
i_messages-CATSDATE = w_CHECK_TABLE-WORKDATE.
APPEND i_messages.
CLEAR i_messages.
endif.
endloop.
endif.