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 |
$outfile =~ s/^.*\/([^\/]+)/$1/i; # basename |
67 |
push @data,$first; |
push @data,$first; |
68 |
chomp $first; |
chomp $first; |
69 |
$first=~s/
//g; |
$first=~s/
//g; |
70 |
if ($first =~ m/\s+(\d+)\w+\s*$/) { |
if ($first =~ m/\s+(\d+)\s+(\d+)\w+\s*$/) { |
71 |
$lines = $1; |
my ($nr,$lines) = ($1,$2); |
72 |
print "Processing $lines lines\n"; |
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 |
} |
} |
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 |
} |
} |