cancel
Showing results for 
Search instead for 
Did you mean: 

Ccap_Alt_Date_Create not working in ASP.NET C#

Former Member
0 Kudos

Hello all,

I have tested with Ccap_Alt_Date_Create to create change number alternative date but failed. I have tried both SAP dot net connector 1.0 and 2.0 in Visual Studio 2003, but both failed.

It worked well in ABAP program.

I have tested with these code in a webform:

################

SAPProxy1 proxy1;

private void Page_Load(object sender, System.EventArgs e)

{

string strSapConn = "ashost=asmera sysnr=00 client=18 user=xxx passwd=xxx";

proxy1 = new SAPProxy1(strSapConn);

proxy1.Connection.Open();

AsyncCallback callback = new AsyncCallback(this.Ccap_Alt_Date_CreateAsyncCallback);

proxy1.BeginCcap_Alt_Date_Create("CHGNO1-03", "CHGNO1", "20041226", callback, null);

proxy1.Ccap_Alt_Date_Create("CHGNO1-03", "CHGNO1", "20041226");

}

protected void Ccap_Alt_Date_CreateAsyncCallback(IAsyncResult asycnResult)

{

proxy1.EndCcap_Alt_Date_Create(asycnResult);

proxy1.CommitWork();

proxy1.Connection.Close();

}

################

It threw the following exception:

###############

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: SAP.Connector.RfcAbapException: ??

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[RfcAbapException: ??]

SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo, Encoding encoding, String languangeCode) +186

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

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

alt_date_test_01.SAPProxy1.Ccap_Alt_Date_Create(String Alt_Date, String Change_No, String Valid_From) in SAPProxy1.cs:85

alt_date_test_01.WebForm1.Page_Load(Object sender, EventArgs e) in WebForm1.aspx.cs:33

System.Web.UI.Control.OnLoad(EventArgs e) +67

System.Web.UI.Control.LoadRecursive() +35

System.Web.UI.Page.ProcessRequestMain() +731

################

Please give advice if anyone has successfully used it.

Thank you very much!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Why did you make an asynchronous call and a synchronous call one after the other? Please remove the asynchronous call and see whether you still get the same error.

Regards,

Guangwei Li

Former Member
0 Kudos

Hi cb lee

Also, you can also ask your ABAP team to examine the RFM for the ERROR object which is defined as an exception in the function module .

On an initial look it seems that the exception is being raised in the code section marked as "General Preparation for all API-FB" in the FM code. Please refer to include LCCAPFA2

Thx, Gaurav

Former Member
0 Kudos

Hi

SAP.Connector.RfcAbapException is a managed .net type which is raised when an exception is thrown by the ABAP program.

I would advise you to check your RFM -"Ccap_Alt_Date_Create" for the scenarios in which it would raise the custom exception. Then try again by changing the parameters to the Ccap_Alt_Date_Create.

Cheers

Gaurav