Skip to Content
0
Former Member
Nov 12, 2010 at 10:56 AM

Displaying Error Message In ESS

356 Views

Hi Experts,

The steps of my program kinda look like this :

1. User input the begin date and end date of his / her travelling date on ESS web page.

2. If the end date was more than 2 weeks ago then the Error Message displayed in the web page.

I'm trying to use the CALL METHOD message_handler->add_message, but it seems doesn't work at all...

I'm using the method like this :

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 = 'PG'.

msg-msgty = 'E'.

msg-msgno = '016'.

msg-msgv1 = 'Cannot claim more than 2 weeks'.

CALL METHOD message_handler->add_message

EXPORTING

message = msg

cause = message_handler->unknown.

is_ok = space.

badi_message_handler->add_messages( message_handler ).

I've already attach that code in Include ZXTRVU03 for user exit FITR0003

and the Interface IF_EX_TRIP_WEB_CHECK~USER_CHECK_RECEIPTS for the BADI TRIP_WEB_CHECK.

Is there anything wrong with my code or the place where I put that code is not right?

Actually I'm a newbie in ABAP OO, but is there any other method to display the error message on ESS web page, because I think that method 'add_message' is only for adding the message to message handler, not displaying it.

I've really appriciated for all of your help.

Thx