如何/我必须指定一个表结构PyRFC来调用BAPI

时间:2014-12-15 15:41:56

标签: python sap rfc

如何定义表结构来调用BAPI?我想调用“BAPI_PRODORD_GET_LIST”

connection = Connection(user='user', passwd='password', ashost='IP', sysnr='00', client='100')

function_name = "BAPI_PRODORD_GET_LIST"

func_desc = connection.call(function_name)

value = {u'SIGN':'I',u'OPTION':'EQ',u'LOW':'MatNumber',u'HIGH':'',u'HIGH_EXTERNAL':'',u'HIGH_GUID':'',u'HIGH_VERSION':'',u'LOW_EXTERNAL':'',u'LOW_GUID':'',u'LOW_VERSION':''}

func_desc['MATERIAL_RANGE'].append(value)

func_desc1 = connection.call(function_name, **func_desc)

1 个答案:

答案 0 :(得分:1)

我找到了使用RFC_TABLE调用BAPI的正确语法。

connection = Connection(user='user', passwd='password', ashost='IP', sysnr='00', client='100')

function_name = "BAPI_PRODORD_GET_LIST"    

value = {u'SIGN':'I',u'OPTION':'EQ',u'LOW':'4711'}

result = connection.call(function_name, MATERIAL_RANGE=[value])

print result