BAPI problem

  • Hello.

    I try the witch come with pysap and I have the following error message :
    Traceback (most recent call last):
      File "", line 67, in ?
        print p
      File "C:\usr\Python24\lib\site-packages\", line 559, in __str__
        s+='%s = %r\n' % (f[0],self[f[0]])
      File "C:\usr\Python24\lib\site-packages\", line 381, in __repr__
        else: return repr(self.ext_value)
      File "C:\usr\Python24\lib\site-packages\", line 374, in __get_value
        return _do_conversion_out(self,RfcGetBcd(self,self._length_,self._decs_))
      File "C:\usr\Python24\lib\site-packages\", line 82, in RfcGetBcd
        else: return eval(vs)
      File "<string>", line 1
    SyntaxError: invalid syntax

    the call is :
    client = '%010d' % 101084
    date_cde = '20050106'

    what can I test to detect where come from the problem ?


    • Hello,

      it took me some time to figure out what is going wrong. It seems that at least one of the decimal (packed) values in the result contains ':.000' which confuses the eval function - the collon at the start of the string raises SyntaxError. I have no idea where that strange value came from. Module uses the RfcConvertBcdToChar from the librfc32.dll to convert packed decimal values (aka BCD - format used by SAP to store decimal values internally) into strings. The ':.000' comes from this function.


    • Thanks for your answer !
      This problem is very strange, because some lines are ok,
      but a few not. If I see the lines with problem in sap, I don't see an anomalie or or a common thing.
      Strange, very strange...

      For information we have an old version of sap (4.0B).