PyRFC how to download data from SAP based on list of values

502 Views Asked by At

I am able to connect to SAP and download data from table successfully. However I need to download data based on a list of values.

Defining one value for OBJNR is OK.

# Choose your fields and table
fields = ['KOKRS', 'PERIO', 'OBJNR', 'GJAHR']
table = 'COEP'

# you need to put a where condition in there... could be anything
where = ["GJAHR = 2021 AND KOKRS = 'H353' AND  OBJNR = 'KSH353MW09C11420'"]

But I am getting error when trying to define not one value, but a list of values.

How can I select data based on a list of values. ie. I have more than 200 different values od OBJNR, and I would like to download only data from SAP assigned to this OBJNR.

0

There are 0 best solutions below