Skip to Content
0
Former Member
Jan 05, 2012 at 07:03 PM

Capturing a system error from a FM

2505 Views

I'm adding/deleting/updating records in KNMT via the RV_CUSTOMER_MATERIAL_UPDATE function module. I'm trying to find a way to catch the errors from this function module. For example, if I try to insert a material that already exists, I get a "System error during INSERT (table KNMT subrc 4)" error and it stops the program. What I want to do is collect that error, write a message to the screen, and go on to the next record to insert/delete/update/etc. There are no exceptions to the FM so I'm not sure how i'm supposed to do it. I've tried a TRY/CATCH with a cx_root. I've also tried using the FMs MESSAGES_INITIALIZE and MESSAGES_GIVE but I can get them to work. Can anyone point me in the right direction?

Thanks,

CD