cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying Error Message In ESS

Former Member
0 Kudos

Hi Experts,

I want to display an Error message in ESS page. The error message was triggered in user exit (not from abap web dynpro)

I've already using the CL_WDR_MESSAGE_MANAGER class, but it not working too...

My code in the user exit is like this

=====================================================

DATA message_manager TYPE REF TO cl_wdr_message_manager.

DATA message_comp TYPE REF TO cl_wdr_component.

CREATE OBJECT message_manager

EXPORTING

component = message_comp.

CALL METHOD message_manager->raise_message

EXPORTING

msg = 'Test Error'

type = 1.

========================================================

It will create Critical Error in the page : Access via NULL object reference not possible

I think it because the object of message_comp is not created properly. The CL_WDR_COMPONENT class is an abstract class so I couldn't make the instance of that class...

Is there any other solutions?

Any Helpfull Answer will be appriciated

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can't just create a new instanace of the message manager. You must get the instance that already has been instaniated by the Web Dynpro Component via the Component APIs.

Former Member
0 Kudos

Hi Thomas,

Is there any way to use the instantiated webdynpro component in user exit?

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

You can try getting the current component instance using somthing like this "wd_this->wd_get_api( )->get_component( )"

and pass this to the CREATE OBJECT statement...

Not sure if it will work..give it a try though.

Thanks,

Aditya.