Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9236

Re: how to specify PACKAGE SIZE for to RFC_READ_TABLE from PyRFC?

$
0
0

in your example code, you do:

 

if 'tabfields' in kwargs.keys():            tabfields=kwargs['tabfields']    #        parameters['FIELDS']=tabfields            for field in kwargs['tabfields']:                parameters['FIELDS'].append([field])        else:            tabfields=''

This results in a keyerror because parameters['FIELDS'] has not been initialized before calling append([field]).

 

If I do intialize it, then pyrfc will fail when specifying a list of fields: tabfields = ['MANDT']:

AttributeError: 'str' object has no attribute 'iteritems'.

 

For example:

 

parameters['QUERY_TABLE'] = 'T001'

parameters['FIELDS'] = ['MANDT','BUKRS']

 

connection.call('RFC_READ_TABLE', NO_DATA='X', **parameters)

will fail with
AttributeError: 'str' object has no attribute 'iteritems'

 

(same thing with:

foo = conn.call('RFC_READ_TABLE',NO_DATA='X',QUERY_TABLE='T001',FIELDS=['MANDT','BUKRS'])


Viewing all articles
Browse latest Browse all 9236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>