In ESS, I want to perform custom validation on IT1067 ( Health Plan ) and allow only specific combinations of health plans to be selected. We are on ECC6.0 EhP4 . This infotype is "NOT PERMITTED" in the new decoupled framework and hence I cannot use NEW BADI's for validation and I am stuck with Classical BADI - HRPAD00INFTY.
In my classical badi HRPAD00INFTY, after validation, I want to display an error message if "Invalid Combination" is selected by the user.
I tried using the following code to display the error message :
DATA badi_message_handler TYPE REF TO cl_hrpa_message_list. DATA message_handler TYPE REF TO if_hrpa_message_handler. DATA msg TYPE symsg. DATA is_ok TYPE boole_d. CREATE OBJECT badi_message_handler. message_handler = badi_message_handler. msg-msgid = 'YHBN'. msg-msgty = 'E'. msg-msgno = '006'. msg-msgv1 = c_none_plans. "'Invalid Plan'(z09). CALL METHOD message_handler->add_message EXPORTING message = msg cause = message_handler->unknown. is_ok = space. badi_message_handler->add_messages( message_handler ). RAISE error_with_message.
The message is displayed in ESS but after that the Java Trace Exception is displayed. I want to display the error message in a user friendly way and provide an option to correct the plans.
Please let me know if anyone has done similar thing or have any suggestions.