-
I am using PyRFC / RFC_READ_TABLE and have encountered a challenge when trying to pass multiple conditions. I have created options as a list of dicts
But i then receive
Does anyone have a hint :) ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
# instead of this:
options = [{'TEXT': "MATNR LIKE 'xxx%'"}, {'TEXT': "WEKRS LIKE 'yyy%'"}]
# do this:
options = [{'TEXT': "MATNR LIKE 'xxx%'"}, {'TEXT': "AND WEKRS LIKE 'yyy%'"}] In your way, Note that import textwrap
desired_string = "MATNR LIKE 'xxx%' AND WEKRS LIKE 'yyy%' AND (MATNR = 000000... OR MATNR = ...) AND ..."
options = [
{"TEXT": substring }
for substring in textwrap.wrap(desired_string , 72)
] |
Beta Was this translation helpful? Give feedback.
-
I just want to access the prod data with ABAP on the QA test system, that is, I don't want to pull a table, I just want to provide a connection, how do I do this? |
Beta Was this translation helpful? Give feedback.
-
OPTIONS are concatenated together as a long string
There is a prank... it won't crash if the cut is at the right place So I made an algorithm that takes up to 72 caracters, but cut at last comma encountered
(Code was updated after my next comment to not cut keywords in the middle) Maybe it will help someone one day. In my case I use it to extract SAP tables in cascade, just like a LEFT JOIN in SQL. |
Beta Was this translation helpful? Give feedback.
RFC_READ_TABLE
accepts a list of dict, as you defined, but then it concatenates them together. So you need to be sure they combine correctly. Try something like:In your way,
RFC_READ_TABLE
will think that your desired options string isMATNR LIKE 'xxx%'WEKRS LIKE 'yyy%'
.Note that
RFC_READ_TABLE
limits eachTEXT
value in options to max 72-characters, so I normally construct my desired options as a stingle long string and then split it into 72-character chunks like: