Skip to content

PyRFC and RFC_READ_TABLE #259

Closed Answered by amarvin
the-master-student asked this question in Q&A
Discussion options

You must be logged in to vote

RFC_READ_TABLE returns a dictionary that contains the table schema, table data, and your query options. The table data is returned as long strings for each row of the table though, so you need to do some string parsing to get the value for each field. Here's an example:

> import pyrfc
>
> table = "my_table"
> delimiter = "|"  # how SAP should separate field values in response data. Be sure this character isn't in the field data!
> with pyrfc.Connection(...) as conn:
>   result = conn.call("RFC_READ_TABLE", QUERY_TABLE=table, DELIMITER=delimiter, ...)
> print(result)
{
  "DATA": [
    {"WA": "long_string_of_row_1_of_data"},
    {"WA": "long_string_of_row_2_of_data"},
    ...
  ],
  "FIELDS":…

Replies: 1 comment

Comment options

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