cancel
Showing results for 
Search instead for 
Did you mean: 

Nco 3.0 has problem calling function BAPI_USER_GET_DETAIL

Former Member
0 Kudos

Hi all,

I'm trying to create program using NCo 3.0. I am able to call function modules, except this particular BAPI_USER_GET_DETAIL. I have to call it few times in order to get the results. Most of time it gives the following error. Strangely, I have no problem calling other funtional modules like BAPI_USER_EXISTENCE_CHECK etc.

SAP.Middleware.Connector.RfcInvalidStateException: Lookup of function BAPI_USER_GET_DETAIL metadata failed for destination NCO_TESTS

---> SAP.Middleware.Connector.RfcInvalidStateException: Lookup of StructureOrTable BAPIAGR metadata failed for destination NCO_TESTS

---> SAP.Middleware.Connector.RfcCommunicationException: destination NCO_TESTS failed when calling DDIF_FIELDINFO_GET -- see log for details

at SAP.Middleware.Connector.RfcRepository.Execute(RfcFunction function)

at SAP.Middleware.Connector.RfcRepository.LookupRecordMetadataClassic(String name, RecordType recordType)

--- End of inner exception stack trace ---

at SAP.Middleware.Connector.RfcRepository.LookupRecordMetadataClassic(String name, RecordType recordType)

at SAP.Middleware.Connector.RfcRepository.LookupRecordMetadata(String name, RecordType recordType)

at SAP.Middleware.Connector.RfcRepository.LookupFunctionMetadataClassic(String name)

--- End of inner exception stack trace ---

at SAP.Middleware.Connector.RfcRepository.LookupFunctionMetadataClassic(String name)

at SAP.Middleware.Connector.RfcRepository.LookupFunctionMetadata(String name)

at SAP.Middleware.Connector.RfcRepository.GetFunctionMetadata(String name)

at SAP.Middleware.Connector.RfcRepository.CreateFunction(String name)

Edited by: VBEXPERT on Mar 23, 2011 2:14 PM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi gurus


i too got the issue on the same

Remote Function Module "/ACTIP/OCR_VENDOR_DATA" on SAP system and retrieve the result of the same to the SmartKey


can you please help me.


Pavan kumar.

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Pavan,

Check with note 460089 whether the user has all the required permissions for looking up the metadata. That's the only guess I can do without more information.

Best regards,

Markus

florian_christa
Explorer
0 Kudos

Hi Folks,

I had the same Problem and found that it has been caused by missing authorizations.

Now my RFC user has the following function groups in authorization object S_RFC:

SYST, RFC_METADATA, RFC1, "myfunctiongroup"

"myfunctiongroup" stands for the function group that contains the RFC function module that shall be called by .NET connector.

Bye

Florian

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Florian,

with regard to authorization profiles and RFC, it is a good idea to read note 460089. It describes the minimum profiles needed for certain scenarios.

Best regards,

Markus

Former Member
0 Kudos

It happens intermittently. Sometimes it work, while sometimes it just show the above error. No idea what's going wrong...

ronny_schneider
Explorer
0 Kudos

I have the same problem (VS2010, Win7x64, NCo 3.0 for .NET Framework 4.0 x86). It just happens sometimes. I can fix it either with a "clean solution", a rebuild or by changing the SAP User for the application.

Former Member
0 Kudos

I am running across the same issue. The error  i see is "invalid destination xxx (REPLACED)  Cannot get a client connection: invalid destination xxx (REPLACED) SAP.Middleware.Connector.RfcInvalidStateException"

And this is intermittent.

Any help is greatly appreciated.

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Suvarna,

this message means that while you try to use a destination some other thread has modified the destination configuration. As this means that the destination instance your thread is using is now out of date, it may no longer be used for invocations.

Best regards,

Markus

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hello Markus, i contact you because i have faced the same problem , sometimes we receive the error invalid destination xxx(replaced), sometimes works and sometimes no, i would like to know if there is a way to fix the issue, what i have to do?

Thanks for your help.

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Francisco,

As long as the destination remains stable and is not changed, you will not experience such an issue. If it needs to be reconfigured, and you use a cached RfcDestination instance, you will experience this situation. A good countermeasure is not to cache the RfcDestination instance, but to always use the RfcDestinationManager to get the destination when needed.

Best regards,

Markus

khurram_barakzai
Participant
0 Kudos

Dear Markus,

I have developed over 40 different applications that fetches information from SAP. most of the applications are running smoothly. yet there are some that are showing the error mentioned above. I have incorporated the instructions mentioned above, yet the system is showing the same error. this error occurs on a time to time basis.

Need your support in getting a fix on it.

Regards,

Muhammad.

MarkusTolksdorf
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Khurram,

you cannot exclude it completely that this exception occurs. The destination could have been adjusted by an administrator just after you have retrieved it and just before your code wants to use it. Hence, to b absolutely on the safe side, your code needs to be able to to react on such a situation and resume processing by simply executing the call again.

Best regards,

Markus

P.S.: This issue definitely happens more often, when using destination management in a wrong way and adding and removing destinations all the time programmatically, e.g. if one thinks that only thus a user to the same logical target can be exchanged, which would be done better using an RfcCustomDestination

ronny_schneider
Explorer
0 Kudos

Hi,

I cannot reproduce this error. My sample program works for BAPI_USER_GET_DETAIL too.

At first I got this RfcInvalidStateException when I initialize the RfcDestinationManager twice within one program.

RfcDestinationManager.RegisterDestinationConfiguration(new MyBackendConfig());

But in your case I don't think this is the error. Please check in SAP in SE37 to call function module DDIF_FIELDINFO_GET with import parameter TABNAME = BAPIAGR. I think it would be helpful if you find the logfile that is refered in your stack trace.

You don't have a problem calling the function module BAPI_USER_GET_DETAIL, you have a problem retrieving the metadata from your SAP system.

regards,

Ronny