cancel
Showing results for 
Search instead for 
Did you mean: 

Display error and stop processing

Former Member
0 Kudos

Hi

I've scoured this forum but not found a way to display an error and stop the processing.

I'm using report_error_message in the method WDDOBEFOREACTION for file validation but the processing doesn't stop there and the control goes on to the next view where it shows the error.

Is there a way to display an error like it is done when you give some garbage value in the UI element FileUpload ? (it just stops processing)

One more problem I have here is that for the same UI element though I've bound the fileName property with a string TYPE attribute and given a certain default value to that attribute, on executing the application the input file field is blank. However if I use get_attribute I can see the value I put in as default during debugging. Any idea?

Thanks

Pushpraj

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you used the SET_ATTRIBUTE method to set the value.

In think in the WDDOBEFOREACTION/or next event that gets processed you might have used

FIRE_PLUG event to fire to next view.

Or else you have used any code CLEAR_MEESAGES in any event.

In the debuggin check the MESSAGE MANAGER reference and check the meesage after the error occured. or in the subsequent event check the same. I think the messages are getting cleared.

Or do this way,

When the meesage occurs write an EXIT stament.

This should stop processing further.

Regards,

Lekha.

Former Member
0 Kudos

Hi,

I also, had a similar requirement in my project. I used the method "RAISE_ERROR_MESSAGE" and after the mesaage was displayed the processing stopped there itself. This is an obsolete method (not a good suggestion to use), but it worked for me. So, you can try as well.

Hope this helps.

Best Regards,

Ashish

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Processing will be automatically stopped by WD framework if error is raise by if_wd_message_manager method.

Try with following method

CALL METHOD wd_this->mo_message_manager->report_element_t100_message

EXPORTING

msg = lv_symsg

element = <element>

attributes = <attribute>

message_type = if_wd_message_manager=>co_type_error

cancel_navigation = abap_true

enable_message_navigation = abap_false

view = lo_api_controller->name.

ENDIF.

Thanks,

Rahul