Subject: | SAP::Iface returns confusing values |
Hello,
I was writing a test script which should connect to a SAP system,
call the function "TF_FSYS_SINGLE" and print out the path and the sizes of different directories on the file system (it's a SAP standard function).
Therefore I used Perl 5.8.3 built for i586-linux-thread-multi and the SAP-Rfc package 1.32. The R/3 Release is 4.6C.
The output in the SAP system is OK, but on my linux machine I got wrong directory sizes (often neg. or very big integers).
Maybe it's my fault... I'm not sure, but I hope you could help me.
Thank you very much.
With kind regards,
Osman Redzepi
The test script:
#!/usr/bin/perl
use strict;
use SAP::Rfc;
my $rfc = new SAP::Rfc (
ASHOST => 'e...',
USER => 'Z...',
PASSWD => 'k...',
LANG => 'DE',
CLIENT => '900',
SYSNR => '09',
TRACE => '1' );
my $iface = $rfc->discover("GET_FSYS_SINGLE");
if (defined $iface) {
$rfc->callrfc($iface);
foreach my $row ( $iface->tab('TF_FSYS_SINGLE')->hashRows() ) {
my $fsn = $row->{'FSYSNAME'};
my $cap = $row->{'CAPACITY'};
my $fre = $row->{'FREE'};
print "> $fsn | $cap | $fre < \n";
}
} else {
print "Error: " . $rfc->error() . "\n";
}
$rfc->close();
This is the output, how it looks like on my console:
Show quoted text
> /stand | -1979711488 | 1258291200 <
> / | 268500992 | 1879048192 <
> /home | -1610416128 | -1811808256 <
> /opt | 1883045888 | -399245312 <
> /tmp | 268566528 | -687800320 <
> /usr | 393216 | 771883008 <
> /var | 268632064 | -654311424 <
> /var/adm/crash | 1074266112 | 973406208 <
> /var/adm/sw | 268566528 | -989855744 <
> /usr/sap/SID | -2147287040 | 1174601728 <
> /opt/Tivoli | -2147418112 | 604045312 <
> /opt/Tivoli/TSM | -2147418112 | 1711341568 <
... and this is the output on my SAP-Gui (there are just more fields):
--------------------------------------------------------------------------------
|TYPE |SUBTY|SERIA|FSYSNAME |CAPACITY |FREE |
-------------------------------------------------------------------------------|
| 107 | 1 | 0 |/stand | 138 | 75 |
| 107 | 1 | 1 |/ | 272 | 112 |
| 107 | 1 | 2 |/home | 928 | 660 |
| 107 | 1 | 3 |/opt | 15.728 | 13.544 |
| 107 | 1 | 4 |/tmp | 528 | 470 |
| 107 | 1 | 5 |/usr | 1.536 | 558 |
| 107 | 1 | 6 |/var | 784 | 218 |
| 107 | 1 | 7 |/var/adm/crash | 2.112 | 1.338 |
| 107 | 1 | 8 |/var/adm/sw | 528 | 197 |
| 107 | 1 | 9 |/usr/sap/SID | 896 | 838 |
| 107 | 1 | 10 |/opt/Tivoli | 384 | 292 |
| 107 | 1 | 11 |/opt/Tivoli/TSM | 384 | 358 |