Subject: | SAP::Struc - sub _pack_structure |
SAP-Rfc 1.36 and before
Hello!
I have 2 problems with subrutine _pack_structure in SAP::Struc.
1) SAP returns error 'Incorrect BCD format' for INTYPE=RFCTYPE_BCD and DECIMALS=0.
I fixed following
$fld->{VALUE} = sprintf("%0".int(($fld->{LEN}*2) +
(int($fld->{DECIMALS}) ? 1 : 0)).
".".$fld->{DECIMALS}."f", $fld->{VALUE});
2) INTYPE=RFCTYPE_CHAR and VALUE='0'. Subrutine _pack_structure transforms VALUE to ''.
I fixed replacing line 1365 (in version 1.63)
$fld->{VALUE} ||= "";
to
$fld->{VALUE} = "" if !defined $fld->{VALUE};
Thanks
Jarda