Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Raising an error message from within an Enhancement Point

Former Member
0 Kudos

Hello colleagues,

I need to raise a message to MIGO screen from an enhancement point.

Please refer to the following piece of code,

ENHANCEMENT-POINT MB_POST_GOODS_MOVEMENTS_02 SPOTS ES_SAPLMBWL.

CALL FUNCTION 'MB_CREATE_MATERIAL_DOCUMENT_UT'

     EXCEPTIONS

       error_message = 4.

*  As soon as we have started to put things into UPDATE TASK, we must

*  ensure that errors definitely terminate the transaction.

*  MESSAGE A is not sufficient because it can be catched from

*  external callers which COMMIT WORK afterwards, resulting in

*  incomplete updates. Read note 385830 for the full story.

IF NOT sy-subrc IS INITIAL.

     MESSAGE ID sy-msgid TYPE x NUMBER sy-msgno WITH         "385830

                sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

*     MESSAGE A263.

   ENDIF.




Here in this code snippet, the above hilglighted function contains a perform which in turn contians many enhancement point. Inside one of these, I want to raise a message of type 'E'.

I tried.

MESSAGE E070(MESSAGE_CLASS).


Unfortunately, this doesn't work. Giving either of  Error or Abort, the control always comes to the outermost function above(MB_CREATE_MATERIAL_DOCUMENT_UT'). Here the message statement with type x  is executed which is  for DUMP.



I want to avoid this. I want to take the control at my enhancement point and show the necessary reason in the screen such that the control never reaches at the above dump.


Kindly give your inputs.


Thanks & Regards,

Varsha

1 REPLY 1

Private_Member_7726
Active Contributor
0 Kudos

Hi,

But the coding there and the referenced Note are very explicit as to why you cannot achieve the desired functionality at that point in processing... It is too late to attempt to validate something and return control to user from within the logic that is registering "modules" for asynchronous update; doing so may and therefore sooner or later will lead to inconsistent updates. It's difficult to suggest anything without knowing specifics, but all the validations that user should react to must happen prior to MB_POST_GOODS_MOVEMENT call - somewhere within MB_CREATE_GOODS_MOVEMENT, for example.

cheers

Janis