This website is not affiliated with, sponsored by, or approved by SAP AG.

Runtime error in USEREXIT_CHECK_XVBAP_FOR_DELET

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Runtime error in USEREXIT_CHECK_XVBAP_FOR_DELET

Postby bart jongen » Fri Jun 27, 2014 6:15 am

Dear,

I have programmed USEREXIT_CHECK_XVBAP_FOR_DELET in include MV45AFZB, but run into a runtime error.
Source code is as follows:

Code: Select all
  DATA: lv_auart  TYPE  auart.

  SELECT SINGLE auart
      FROM zzordertype
      INTO lv_auart.

  IF xvbak-auart EQ lv_auart.
    us_exit = charx.

  ENDIF.

  IF us_exit NE space.
    MESSAGE e001(zbj4).
  ENDIF.

This goes well;
I have maintained with SM31 (just/only) an Order type Z123 in table ZZORDERTYPE.
When I create a Sales order with Order type TA (so <> Z123), I can delete the Sales order item (in debugging, us_exit does not become X, it stays blank).
If I do the same with an Order type Z123, in debugging, us_exit becomes X, and accordingly I cannot delete the item.
In that latter case, also the Message appears, all good so far.

There is only one problem: when I try to delete an Order (of type Z123) as a whole, so via VA02 > Sales document > Delete (Do you really want to delete Order xxx ?, I clicked YES), then I get the following runtime error:
DYNPRO_MSG_IN_HELP, Short text: Screen: Illegal message, Error analysis: The program attempted to issue a “ “message during “Exit Command” processing. This is an illegal operation. This is probably due to an error in the ABAP program or in the current screen.

Does anyone know how I can change my code in order to prevent the runtime error from happening?
Thanks so much in advance for your replies.
Kind regards,
Bart Jongen
Eindhoven, the Netherlands
bart jongen
 
Posts: 209
Joined: Mon Sep 12, 2005 3:26 am
Location: Eindhoven, The Netherlands

Re: Runtime error in USEREXIT_CHECK_XVBAP_FOR_DELET

Postby Gothmog » Fri Jun 27, 2014 8:16 am

You can't use a type 'E' (or 'W' message) when deleting a sales order.
either:
- use an 'I' message (us_exit = charx is sufficient to prevent the item deletion)
- first check if the whole order is deleted before issuing your message (not sure how, as the update indicator are not set yet - maybe FCODE = LOES)

You can also try to only send the message if US_ERROR = X.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: Runtime error in USEREXIT_CHECK_XVBAP_FOR_DELET

Postby bart jongen » Mon Jun 30, 2014 4:03 am

Hello Gothmog,

Thanks so much for your reply;
I made the e(rror) and i(nformation) message and that was the solution.
Thanks!
Kind regards,
Bart Jongen
Eindhoven, the Netherlands
bart jongen
 
Posts: 209
Joined: Mon Sep 12, 2005 3:26 am
Location: Eindhoven, The Netherlands


Return to ABAP

Who is online

Users browsing this forum: No registered users and 10 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.