2 errors when trying to use RFCDestination.Repository.GetTableMetadata(string tablename)

梦想与她 提交于 2019-12-11 07:29:42

问题


I know that you can get the data of a table in a SAP Server with the function RFCDestination.Repository.GetTableMetadata(string tablename). Unfortunately I get an error when I try to execute the command. The weird thing is when I give a exisiting table I get a different error when I try something random as a tablename.

Existing table:

var x = dest.Repository.GetTableMetadata("TFTIT");

Error:

SAP.Middleware.Connector.RfcInvalidStateException: "cannot find TABLE specified by TFTIT"

Random tablename:

var x = dest.Repository.GetTableMetadata("Test123");

Error:

SAP.Middleware.Connector.RfcInvalidStateException: "metadata for TableOnly TEST123 not available: NOT_FOUND: No active nametab exists for TEST123"

I know there is a way to get the data of a table with the help of a function module but I need to use the GetTableMetadata function.


回答1:


One cannot do so much wrong when calling RfcRepository.GetTableMetadata(string). Does your used user ID has the required RFC authorizations for repository queries as listed in SAP note 460089 (scenario 3)? If yes, this is maybe a bug in the NCo3 library or even in the ABAP backend. Do you use NCo's latest patch level? This is currently NCo 3.0.20. If not, try updating the library first. Otherwise I recommend to create an SAP support ticket for the first error message. The second error is normal when the specified table name does not exist.

Alternatively you may also try what happens if calling RfcRepository.GetStructureMetadata(string) for this table instead. The meta data for tables and structures is quite similar and the same remote function modules are used for the DDIC queries. Maybe this works. However, I think in the first place RfcRepository.GetTableMetadata(string) should work here.

I hope this helps.



来源:https://stackoverflow.com/questions/51512900/2-errors-when-trying-to-use-rfcdestination-repository-gettablemetadatastring-ta

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!