Skip to content

How to use RFC_READ_TABLE with multiple options / where clauses? #271

Answered by amarvin
jedo-tm asked this question in Q&A
Discussion options

You must be logged in to vote

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:

# 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, RFC_READ_TABLE will think that your desired options string is MATNR LIKE 'xxx%'WEKRS LIKE 'yyy%'.

Note that RFC_READ_TABLE limits each TEXT 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:

import textwrap

desired_string = "MATNR LIKE …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
6 replies
@amarvin
Comment options

@chandra-a
Comment options

@amarvin
Comment options

@amarvin
Comment options

@blmksad
Comment options

Answer selected by jedo-tm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants