/[sap_import]/pipe2sap.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /pipe2sap.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Tue Dec 17 19:24:37 2002 UTC revision 1.3 by dpavlin, Mon Feb 3 14:24:55 2003 UTC
# Line 29  my $outdir = $config->{outdir} || die "c Line 29  my $outdir = $config->{outdir} || die "c
29  # create output filename  # create output filename
30  my ($ss,$mm,$hh,$dd,$mm,$yy) = localtime(time);  my ($ss,$mm,$hh,$dd,$mm,$yy) = localtime(time);
31  $yy += 1900;  $yy += 1900;
32    $mm++;
33  my $outfile = $config_file;  my $outfile = $config_file;
34  $outfile =~ s/\.xml//i;  $outfile =~ s/\.xml//i;
35    $outfile =~ s/^.*\/([^\/]+)/$1/i;       # basename
36  $outfile .= "_${yy}-${mm}-${dd}_${hh}:${mm}:${ss}_$$";  $outfile .= "_${yy}-${mm}-${dd}_${hh}:${mm}:${ss}_$$";
37    
38  my $rfc = new SAP::Rfc(  my $rfc = new SAP::Rfc(
# Line 64  my $lines;     # number of lines in order Line 66  my $lines;     # number of lines in order
66  my $first = <STDIN>;  my $first = <STDIN>;
67  push @data,$first;  push @data,$first;
68  chomp $first;  chomp $first;
69  if ($first =~ m/\s+(\d+)\w+$/) {  $first=~s/ //g;
70          $lines = $1;  if ($first =~ m/\s+(\d+)\s+(\d+)\w+\s*$/) {
71          print "Processing $lines lines\n";          my ($nr,$lines) = ($1,$2);
72            print "Processing $lines lines order no. $nr\n";
73  } else {  } else {
74          die "FATAL: can't find number of lines in first line ($first) of input file.";          die "FATAL: can't find number of lines in first line ($first) of input file.";
75  }  }
# Line 93  if ($#data != $lines) { Line 96  if ($#data != $lines) {
96          print OUT $first,@data;          print OUT $first,@data;
97          close(OUT);          close(OUT);
98    
99            # cludge filename to nark.0004
100            rename "$outdir/$outfile", "$outdir/nark.0004";
101            $it->FILENAME("nark.0004");
102    
103          # call SAP R/3          # call SAP R/3
104          $rfc->callrfc( $it );          $rfc->callrfc( $it );
105  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.26