cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt program processing

Former Member
0 Kudos

Hi Gurus,

In my application ..if some condition fails , i m raising an error message as follows:

CALL METHOD lo_message_manager->report_error_message

EXPORTING

message_text = 'Please fill Sold To Customer field'

VIEW = 'ISSUEORD_VIEW'.

But the program processing is being continued for eg.. a table is getting updated and both the message

i.e earlier error message and the table updation message are both appearing on the screen together..

How can i interrpt program processing after the error message and display that on the screen.

Best Regards,

Navin Fernandes.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can stop the action from happening, if you raise an attribute error message in WDDOBEFOREACTION using the REPORT_ATTRIBUTE_ERROR_MESSAGE method of message manager.

For e.g.


  IF lo_action IS BOUND.
    CASE lo_action->name.
      WHEN <Your action name>.
        lo_node = wd_context->get_child_node( name = <Your node name> ).
        lo_element = lo_node->get_element( ).
        lo_element->get_attribute( EXPORTING name =  <Your attribute name> IMPORTING value = lv_value ).
        IF lv_value IS INITIAL.
         lo_msg_manager->report_attribute_error_message(
                message_text      = 'Field is empty'
                element                = lo_elment
                attribute_name    = <Your attribute name> ).
        ENDIF.
    ENDCASE.
  ENDIF.

Best Regards,

Loveline Thomas.

Answers (2)

Answers (2)

saket_abhyankar
Active Participant
0 Kudos

Hi

You can use 'exit' after erroneous condition. This will stop the further processing.

Regards,

Saket.

abhimanyu_lagishetti7
Active Contributor
0 Kudos

raising an error in web dynpro abap doesn't stop the further processing. use a return statement to get out of the method. or put the stmt in if and rest of the code in else part.

Abhi

Former Member
0 Kudos

Hi everyone..

I used return and exit and worked to some extent..

So i used a flag and set it to X to allow program processing.

Best Regards,

Navin fernandes.