Google+ Followers

Monday, August 8, 2011

Safeguard your ABAP code

An article from SDN

I have learned this lesson in a hard way, but would like to share the grief with everybody. While working with one of our clients, I developed a COBRA interface that sends out an automatic email to employees when their dependents turn 19 or 21 of age to inquire about COBRA forms.  We tested the COBRA interface and pushed it to production and guess what? The SAP Basis resource forgot to run the job with variants, so the interface run for everybody with end date ‘12/31/9999,’ which sent out 30,000 emails. Yes, 30,000 emails that morning. 

Instead of pointing out to the SAP Basis resource that he forgot to give the variant name in production, I held myself responsible as well for not creating a safeguard in the code.

I have included the following code below!!

IF SY-BATCH = 'X'.
   IF  SY-SLSET IS INITIAL. " Used Selection Screen Variant
     WRITE : 'No Variant Selected check SM36 & SM37' COLOR COL_NEGATIVE.
      MESSAGE  e016(RP) with 'No Variant Selected' space space space.
   ENDIF.
ENDIF.

No comments:

Post a Comment