1

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.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
  • 2
    There's no any code related to downloading, just some lists. Please, provide minimal reproducible example. – astentx Apr 12 '21 at 14:13
  • I am calling the following function to retrieve from SAP some table content: tables = self.conn.call("RFC_READ_TABLE", QUERY_TABLE=SQLTable, DELIMITER='|', FIELDS = Fields, OPTIONS=options, ROWCOUNT = MaxRows, ROWSKIPS=FromRow). – Adriano Bisogni Apr 13 '21 at 01:20
  • Here is how I define the WHERE clause if instead of just one OBJHNR value, I need to download data related one hundred od values? – Adriano Bisogni Apr 13 '21 at 01:22
  • 1
    Please, add all the details to the original question via [edit link](https://stackoverflow.com/posts/67059595/edit) to make it complete, because SO is not a forum. Also you've provided some call that has none of the lists `fields`, `table` and `where` in parameters. – astentx Apr 13 '21 at 10:11

0 Answers0