Saturday, June 8, 2013

Reading database tables via RFC directly from the backend system

Purpose

With the META_READ_TABLE you can read any table of the ECC backend system. This function module can be useful, if you would like to check the content of the ECC backend system (follow-on document, customizing setting etc.).

Overview

Depending on the size of the backend table, you have to use different methods. When you get overflow by the RFC communication, you have to use te way described under Reading long tables
Relevance: all SRM releases

Reading short tables

  • In this first example we have a goods receipt document (5000014103) in the backend system, which is stored in the tables MKPF and MSEG. Here is the content of the backend table MKPF what we would like to read from the SRM system.

At first call the function META_READ_TABLE in the transaction SE37
Then fill into the QUERY_TABLE the name of the backend table (in our case the MKPF), the LOGICAL_SYSTEM (you can find it e.g. in the customizing "Define logical systems"), and then with the OPTIONS you have to fill the key field(s) of the record what you are searching for. Here you can use the following logical expressions: AND, OR (e.g. MBLNR EQ '5000014103' AND MJAHR EQ '2008').
Here is the result of your query. This is not separated into fields, you can see the result in one string. If you compare with the MSEG, you can see, that is has the same content.

Reading long tables

  • By longer tables you may have get an overflow if you try read all entries of the table. In case of overflow you get the "Communication error" message.


If you get this "Communication error" messages, you have to specify the name of the fields what you are searching for


    No comments:

    Post a Comment