--- pipe2sap.pl 2003/02/03 13:36:52 1.2 +++ pipe2sap.pl 2003/02/03 14:24:55 1.3 @@ -29,6 +29,7 @@ # create output filename my ($ss,$mm,$hh,$dd,$mm,$yy) = localtime(time); $yy += 1900; +$mm++; my $outfile = $config_file; $outfile =~ s/\.xml//i; $outfile =~ s/^.*\/([^\/]+)/$1/i; # basename @@ -66,9 +67,9 @@ push @data,$first; chomp $first; $first=~s/ //g; -if ($first =~ m/\s+(\d+)\w+\s*$/) { - $lines = $1; - print "Processing $lines lines\n"; +if ($first =~ m/\s+(\d+)\s+(\d+)\w+\s*$/) { + my ($nr,$lines) = ($1,$2); + print "Processing $lines lines order no. $nr\n"; } else { die "FATAL: can't find number of lines in first line ($first) of input file."; } @@ -95,6 +96,10 @@ print OUT $first,@data; close(OUT); + # cludge filename to nark.0004 + rename "$outdir/$outfile", "$outdir/nark.0004"; + $it->FILENAME("nark.0004"); + # call SAP R/3 $rfc->callrfc( $it ); }