Skip to Content
avatar image
Former Member

How to get inserted/updated data from RFC table?

Hi,

We are looking for some help on RFC function call on RFC_READ_TABLE. Thank you in advance.

Our problems

We have one RFC table A, one program is adding data to the table A from time to time.

We have another RFC program(in java), calls RFC function RFC_READ_TABLE from time to time to get data from the RFC table A.

And Our target is to get inserted/updated data set in the RFC table in each call to RFC_READ_TABLE function or some other function.

Our tries

At first we tried to set some parameter such as “RowSkips” in each call to RFC_READ_TABLE to fetch the data which are not processes.

But we found that each time the result set returned from RFC_READ_TABLE, the row order is not consistent with the order they are added into the table.

So simply setting the RowSkips in each call to RFC_READ_TABLE cannot resolve this problem.

Questions

1.What is the exact behavior of function call RFC_READ_TABLE? Is the return data set ordered by any specific column? And any open formal document on this?

2.Is there any other mechanism in RFC table similar to database trigger? Or other mechanism to get the inserted/updated data set of a RFC table?

Regards and Thanks,

Ming

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 21, 2017 at 08:43 AM

    Hi Ming,

    RFC_READ_TABLE does not accept an order by clause and does not specify an order during the selection, so the results could be returned in random order and working with rowskips will not work. What you could do is add an update timestamp to your table and select only records with a timestamp larger than the latest one you have in your subsystem when passing the parameters to the function.

    An even better option would be to develop your own function to access the SAP data needed by your solution. RFC_READ_TABLE has many shortcomings and limitations and is not supposed to be publicly used. See SAP Not 382318.

    Kind regards,
    Patrick

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 22, 2017 at 03:14 AM

    Hi Patrick,

    Thank you very much for the quick reply. :)

    Is there any replacement public function available for generic table access?

    And where can I find the formal doc of public RFC functions and there interface definition?

    Regards,

    Ming

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Ming,

      For all I know there is none. I know of two more functions (TABLE_ENTRIES_GET_VIA_RFC and RFC_GET_TABLE_ENTRIES), which have other issues and are not meant for public use either.

      Just by looking at the number of questions around RFC_READ_TABLE out there, you can tell that the lack of an "official" function to access tables generically is a gap. From my POV, there is no problem with having such a generic function as long as you apply proper security checks inside. As I see you are an SAP employee, maybe you can help position that gap internally :-)