Problem solve Get help with specific problems with your technologies, process and projects.

Digesting Support Pack Notes

Support Packs often contain millions of bytes of binary corrections. How will it impact your system? Here's how to check!

Support Packs often contain millions of bytes of binary corrections associated with hundreds or, very often, thousands of associated OSS notes. Before applying the support packs to your system, it's best to examine the content of the notes to estimate the impact of the changes.

Unfortunately, there's no easy way to download the note text all at once through SAPNET. The only alternative is to use the R/3 front end to OSS, a much slower process that's prone to timeouts for many users. Once the notes are downloaded, it would be convenient to group them by functional area so that they may be analyzed by "power users" and specialists.

It would also be beneficial to flag extraordinary note instructions containing information about complementary programs to execute once the notes are applied.

I've developed a Perl script to "digest" the downloaded collections of notes. The script processes the raw note text, eliminating "boilerplate" information, all German text, unnecessary cross-reference information and all the ABAP code changes. This always reduces the filesizes by more than 60%. The descriptive text is retained for analysis by the functional specialists who may not also be ABAP programmers. The script also builds serveral cross-reference index files (by functional area, by note number) and builds an index of notes that may contain special supplemental programs by keying off of initial string fragments "RS" and "Z" and "Y" to look for potential program names that might need to be examined.

The script works in Windows using ActiveState Perl (a free download from It will process all files in the directory where it's invoked, ending with a .txt extension and beginning with the letter "n" (for notes, of course). I generally download the files of a given support pack with the name nxx.txt where "xx" is the support pack number. If you follow this convention, the script will incorporate the range of support packs in the names of the Digest and index files it produces. Perl is great at extraction tasks like this.

#strip out correction instructions
# This script will parse n*.txt files extracting:
#   1. a Digest file containing text, no code, no Xref, no German Language notes
#   2. Note num seq index with titles
#   3. Functional area, Notenum sequence index with titles
#   4. A list of possible Post Processing notes derived from extracting all strings that look like
#      program names beginning with Z*, Y*, or RS*
#   first check all n*.txt files in target directory
#my $dir = shift;
#$dir = "." unless -d $dir;
#print "Working on directory $dirn";
#opendir(DIR, $dir) or die "Can't open directory $dirn";
#@txtfiles = grep{/^n*.txt/} readdir(DIR);
@txtfiles = glob("n*.txt");
#chdir $dir or die "Can't change to directory $dirn";
print "@txtfilesn";
# get the range of notes, assuming filenames in n01.txt, n02.txt,...n08.txt format
$lo = 9999;
$up = 0;
foreach $fnam (@txtfiles) {
 #print "extracting digits from $fnamn";
 $fnam =~ /(d+)/;
 #print "Gotdigit? $1n";
 if ($lo gt $1) {$lo = $1}
 if ($up lt $1) {$up = $1}
 #print "Digit $tstdigit Lower $lo upper $upn";
$range = "$lo-$up";
open (DIG,"> digest$range.txt") or die "Can't create digestn";
open (NNSEQ, "> IndexNum$range.txt") or die "Can't create numseqn";
open (FNSEQ, "> IndexFun$range.txt") or die "Can't create funseqn";
open (PROG, "> PossibleProg$range.txt") or die "Can't create possprogn";

print "Range is $rangen";
# die "Quitting nown";

foreach $fnam (@txtfiles) {
 open (TXT, "< $fnam") or die "Can't read $fnamn";
 print "Parsing $fnamn";
 while ( <TXT> ) {
  next if (/^n/);
  print DIG if (/^R/3 note/);
  if (/^R/3 note/) {
   $notenum =~ s/^R/3 note no.s+//;
   $notenum =~ s/s+$//;
  if (/^Short text/) {
   $shortext =~ s/^Short texts+//;
   $shortext =~ s/s+$//;
  if (/^Component/) {
   $component =~ s/^Components+//;
   $component =~ s/s+$//;
   # print "Note=$notenum, Component=$component, Txt=$shortextn";
   $page = int (($line + 66) / 67);
   $numseq{$notenum} = "$fnamt$shortextt$componenttPage $page";
   $funcseq{$component, $notenum} = "$shortexttPage $page";
  next if (/^Status/);
  next if (/^Set by/);
  next if (/^Administrator/);
  next if (/^Source code correction/);
  if ((/^Valid relea/||/^Languages+DE/) .. /^R/3 note/){
     # skip another block
  else {
  next if (/^R/3 note/);
  # next regular expression tries to parse out "Zprograms" or "Yprograms" 
  # i.e. words beginning with "Z" or "Y" more than 4 characters long
  # notice unusual grouping ( (Z|Y) (w+) {3,} )
  #                         $1  $2    $3   min length
  if (/b((Z|Y|RS)(w+){3,})b/) {
    if ($tst =~ /YY.*|Year|Your|Yours|Zona|Zone|Zero|Zoom|ZERO|YEAR|YEARS|Yield|Yields/) { 
   else {
   $programs{$tst, $notenum} = "$prevlinet$_";
  print DIG;
 }  # end of while (more text in one file)
}   # end of foreach all text files  
print NNSEQ "Notes in Numeric Sequencenn";
$count= keys(%numseq);
print NNSEQ "$count Notes Totalnn";
foreach $nt (sort keys %numseq) {
 next unless ($nt =~ /^d+/);  # skip invalidly parsed note numbers
 print NNSEQ "$nt $numseq{$nt}n";
print FNSEQ "Notes in Functional Sequencenn";
foreach $nt (sort keys %funcseq) {
 next unless ($nt =~ /^[A-Z]/);   # skip invalidly parsed Functional areas
 print FNSEQ "$ntt$funcseq{$nt}n";
print PROG "Possible Post Processing Programs In Context nn";
print PROG "Program|Note    Two lines of text containing possible Program Referencenn";
foreach $nt (sort keys %programs) {
 print PROG "$ntt$programs{$nt}n";

This was last published in August 2002

Dig Deeper on SAP Basis

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.