cancel
Showing results for 
Search instead for 
Did you mean: 

Does sapjco call RFC_Metadata_Get internally?

S0020961829
Explorer
0 Kudos

Does sapjco call RFC_Metadata_Get internally whenever we tries to call any Remote Enabled Function module using jco?

I am able to see RFC_Metadata_Get is getting called for each RFM call.

Is the purpose to fetch the metadata of any RFM? In that case how metadata of RFC_Metadata_Get was fetched in first place.

Sandra_Rossi
Active Contributor
0 Kudos

Yes it does. I think that all RFC SDK client libraries do it too (NCO, etc.) There's at least one SAP note about it.

Yes the purpose of "metadata get" is to fetch the metadata. But I guess your question is what "metadata" is it? It's the definition of function module parameters.

Please clarify your question, I don't really get what you are asking.

Thank you.

View Entire Topic
Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert

The answer is "yes" and "no".

JCo fetches the metadata of each RFM only the first time you try to call that RFM, and then caches it in memory. For each following call, it then uses the cached metadata. So no further calls to RFC_METADATA_GET are necessary!

Also it is possible to replace the call to RFC_METADATA_GET with calls to the older function modules RFC_GET_FUNCTION_INTERFACE and DDIF_FIELDINFO_GET by setting the JCo property use_roundtrip_optimization=0. (However, this is necessary only for old R/3 releases, which do not yet have RFC_METADATA_GET.)

And it is also possible to suppress these metadata calls completely, by using one of the two techniques:

  • Hard-code the metadata (function module parameters and structure information) in your code. (See documentation of the class CustomRepository.)
    But you need to be a real DDIC expert to do this, e.g. know all the alignment rules for structure- and table-fields, and how .include structures change the alignment etc... If you get it wrong, the result will be garbage data in your function calls...
  • Fetch the metadata from the backend DDIC once, e.g. using a test program, safe it into a file, and then at startup of the productive JCo program, just read the file back into memory. (See documentation of the Repository store() and load() methods.)

> In that case how metadata of RFC_Metadata_Get was fetched in first place.
It's hard-coded into the JCo library.

And as Sandra already guessed correctly: the same mechanisms are also implemented in SAP NCo and the NW RFC library.