Showing results for 
Search instead for 
Did you mean: 

SPAM/SAINT error/completion flag?

Former Member
0 Kudos

Good afternoon,

My company is currently going through an upgrade in a sandbox system to get to EHP3. During every upgrade it seems we will run into an error and we have to monitor the system often to see if the upgrade has stopped or if it has completed.

Is there a standard table or flag set in SAP when SPAM or SAINT is run that could be monitored? I could write a program to run in the background every 15 minutes to monitor this table entry or flag and e-mail the "Basis" team if an error occurs or if it's completed. This would save our team from having to constantly monitor issues.

If anyone has any suggestions I'd appreciate it. If someone finds something and I can write an ABAP program to get it to work I'm willing to post it here for everyone else to use too.



Accepted Solutions (1)

Accepted Solutions (1)

Active Contributor
0 Kudos

Table PAT01 might help you

Former Member
0 Kudos


Thank you for the suggestion. It put me down a path to search. Unfortunately the table doesn't clear out once the SPAM/SAINT transaction is restarted so I can't use this table for my program. I'm currently looking at using table PATLOG3 to see if I can use it.

If anyone has any other suggestions I'm still open to options. Again, if I can figure something out I'll post it for everyone to use.


Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks to all for your suggestions. I was able to write the program and it actually work for us during our testing.

I wasn't able to upload to the code snippet section so I'm going to try to cut and paste in multiple sections here by using the "<code>" display as code option. If I add too many line items it just runs together and is unusable.

Feel free to use and modify for your own purposes.

PART 1 of code

*& Purpose: To monitor the SPAM and SAINT transactions during an upgrade
*&          for any errors.  SPAM and SAINT often run into errors that
*&          need to be reviewed before the upgrade can continue.  This
*&          program will e-mail employees in case any error messages are
*&          found.
*&          Create a batch job to run every 10 minutes during the
*&          upgrade process
*& History: Initial Creation - 09/10/09 - Jonathan Kullgren


      c_yes     type c length 1 value 'X'.

data: zpat like patlog3 occurs 0 with header line.
data: l_log_name like patlog3-log_name,
      l_curdate like patlog3-curdate,
      l_curtime like patlog3-curtime.
data: l_flag type c.

* Definitions for emailing
data: itab_text type table of tline with header line,
      itab_objpack type table of sopcklsti1 with header line,
      itab_objtxt type table of solisti1 with header line,
      itab_reclist type table of somlreci1 with header line,
      l_doc_chng type sodocchgi1,
      l_counter type i.

Former Member
0 Kudos

Part 2 of code

refresh zpat.
clear: l_flag, l_log_name.

*Get last log entry
select log_name curdate curtime
  into (l_log_name, l_curdate, l_curtime) from patlog3 order by curdate curtime.

*Search for any error entries in the current log
select * from patlog3
  into zpat
 where log_name = l_log_name
   and severity = 'E'.

* "write output to screen
  write:/ zpat-curdate,

  concatenate zpat-curdate zpat-curtime zpat-severity zpat-var1 zpat-var2
         into itab_text-tdline SEPARATED BY space.
  append itab_text.
  l_flag = 'X'.

Former Member
0 Kudos

Part 3 of code (of 3)

if l_flag = 'X'.

* Note (Keep e-mail in all upper case - didn't work without it)
* Add e-mail recipients
  itab_reclist-receiver = '<enter e-mail address here>'.     "add your e-mail
  itab_reclist-rec_type = 'U'.
  append itab_reclist.
* Add CC e-mail recipient
  itab_reclist-receiver = '<enter e-mail address here>'.    "add your cc e-mail
  itab_reclist-rec_type = 'U'.
  itab_reclist-copy     = c_yes.
  append itab_reclist.

  if itab_objpack[] is initial.
    loop at itab_text.
      itab_objtxt-line = itab_text-tdline.
      append itab_objtxt.

    l_doc_chng-obj_descr = 'SPAM/SAINT Error'.
    l_doc_chng-obj_prio = 1.            " High priority

* Packing for body text.
    describe table itab_objtxt lines l_counter.
    itab_objpack-head_start = 1.
    itab_objpack-head_num = 0.
    itab_objpack-body_start = 1.
    itab_objpack-body_num = l_counter.
    itab_objpack-doc_type = 'RAW'.
    itab_objpack-doc_size = l_counter * 255.
    append itab_objpack.

* Sending mail.
  call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      document_data              = l_doc_chng
      commit_work                = c_yes
      packing_list               = itab_objpack
      contents_txt               = itab_objtxt
      receivers                  = itab_reclist
      too_many_receivers         = 1
      document_not_sent          = 2
      document_type_not_exist    = 3
      operation_no_authorization = 4
      parameter_error            = 5
      x_error                    = 6
      enqueue_error              = 7
      others                     = 8.

  write:/ 'No errors found.'.

Former Member
0 Kudos

Hi Jonathan,

Why dont you keep a monitoring alert on the OCS_Import job of SPAM which gets started as background job when you start SPAM import. When SPAM errors, this job gets cancelled.

You can put a CCMS alert on job cancellation and email alert to your teams in turn.



Former Member
0 Kudos


While you are applying the support pack the support pack are being imported in the system so you can go as os level in /usr/sap/trans/tmp and check that the file created in the last with XXXXXXXX.SID where XXXXX is the support pack descrition.

So as long as the file is growing you support are being imported.I find this is the best wayto check.


Rishi Abrol