cancel
Showing results for 
Search instead for 
Did you mean: 

Bapi Error when connecting through .net connector

Former Member
0 Kudos

Hi,

Could anyone help me with this error and the reason for this error. We have two SAP Systems, one for development and other one for test.

When I run my .net program to execute the same BAPI on SAP development system, my program runs fine and no errors/exceptions occur.

But when I run the program to connect to SAP Test system, I get the following error. The exception occurs as soon as I call the bapi. This is a custom bapi that we are trying to call. Is there any way we can test whether the connection to SAP system is established before calling the BAPI ?

Thanks,

Mike.

Message: CREATE OBJECT: Class \CLASS=ZCL_IM__WTY_BAPI_CREATE could not be found.

Source: SAP.Connector.Rfc

Stack Trace: at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode)

at SAP.Connector.Rfc.RfcClient.RfcInvoke(SAPClient proxy, String method, Object[] methodParamsIn)

at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn)

at TSI.WarrantyClaimCreateProxy.Zz_Bapi_Warrantyclaim_Create(BAPI2222HEADER Claim_Header, String Simulate, String& Claim, String& Claim_Tmp_Ident, BAPI2222ITEMTable& Claim_Item, BAPI2222MEASURETable& Claim_Measure, BAPI2222PRICINGTable& Claim_Pricing, BAPI2222LONGTEXTTable& Claim_Text, BAPI2222VERSIONTable& Claim_Version, BAPIPAREXTable& Extensionin, BAPI2222ITEMRELATIONTable& Item_Rel, BAPIRET2Table& Return2, BAPI2222VERSIONRELATIONTable& Version_Rel) in c:\inetpub\wwwroot\TSI\WarrantyClaimCreateProxy.cs:line 128

at TSI.CreateClaim.CreateClaim_BAPI() in c:\inetpub\wwwroot\tsi\createclaim.asmx.cs:line 357

Target Site: Void ThrowRfcException(SAP.Connector.RFC_ERROR_INFO_EX, System.Text.Encoding, System.String).

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

It seems that you were calling a customer BAPI which is

defined in your dev system but not defined in your test system.

To verify if the connection can be established, you can explicitly make a call to Connection.Open() before calling the BAPI method. But it is usually not necessary because the exception thrown by the method call will tell if it is a connection error or not. An RfcCommunicationException or RfcLogonException indicates a error when establishing the connection.

Guangwei