Where I work, we have two systems that use SAP, one using Delphi and another using c#. I'm implementing the c# and both have the same problem, when I query for a great amount of columns using RFC_READ_TABLE
, depending on the table ( usually 60+ ), it returns a Rfcabapexception with no description and no Inner Exception, just a title. What is causing this exception and what can I do to prevent it?
Asked
Active
Viewed 1,756 times
2

Sandra Rossi
- 11,934
- 5
- 22
- 48

André Silva
- 1,149
- 9
- 30
-
Which RFC function module are you calling? RFC_READ_TABLE? – vwegert Jan 02 '13 at 17:41
-
Yes, using RFC_READ_TABLE. The system that I work on just retrieve information, so no insertion being made. – André Silva Jan 03 '13 at 09:11
1 Answers
6
The function module RFC_READ_TABLE
has to convert the data to a generic format because "really generic types" like DATA
or STANDARD TABLE
are not supported for RFC communication. Because of this, the outout is transmitted as a series of table lines, each a character field up to 512 characters in length.
This has several consequences:
- If the total size of all fields you requested exceeds 512 characters, you will get a short dump (check with transaction
ST22
) and the exception you mentioned. - If you try to read fields that can not be converted to character fields and/or do hot have a fixed-length (!) character representation, bad things will happen. Most likely,
RFC_READ_TABLE
will either abort with a short dump or barf all over your output data.
You can bypass the first problem by slicing the table vertically and reading groups of columns sequentially. Be aware that RFC_READ_TABLE
is not guaranteed to always return the data in the same order when stitching the results back together again. Also be aware that you might run into violations of transaction isolation, depending on how often the data you read changes.

vwegert
- 18,371
- 3
- 37
- 55
-
So if to bypass that problem, I'll have to break my search into columns up to 512 characters, right? That totally blew my mind. Thanks for the help. It really cleared my mind. – André Silva Jan 03 '13 at 10:09
-
Exactly - and you have to watch out for non-character-like fields and exclude them. Corollary: You won't be able to read fields that contain primary key fields of "offending" data types using RFC_READ_TABLE. – vwegert Jan 03 '13 at 10:15
-
I really appreciate your answer. If I could give you another upvote, I would. But since I can't, I won't. Thanks. :) – André Silva Jan 03 '13 at 10:20