cancel
Showing results for 
Search instead for 
Did you mean: 

Databinding problem - tutorial

Former Member
0 Kudos

Hello,

I have just began to work with the SAP .NET connector.

I am trying to do the tutorial : "Write an ASP.NET Client Application with SAP.NET Connector".

The user writes a name in a textbox. Then the programm calls the Bapi RFC_CUSTOMER_GET and it returns the list of customers who have the name written in the textbox.

However the databinding is not working well between the textbox and the corresponding parameter in the method RFC_CUSTOMER_GET. The programm doesn't use the value in the textbox to find the customers. Instead, it always choses the default value in the SAPProxy11.

Once the list of customers is found, the value of the textbox changes automatically and is set to the default value of the SAPProxy.

I guess this is due to the databinding which only works in one direction. The textbox cannot set the value in the BAPI. But the value in the BAPI sets the value in the textbox.

To avoid the missing databinding, I have found the following solution :

there is a method Button_Click which calls the BAPI; at the beginning of this method, I write to following code to force the value of the parameter of the customer name

sapproxy11.CustName=this.TextBox1.Text;

However, this is not the right solution.

Have you ever had that problem ?

Any suggestions ?

Thank you.

Marie

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

It's true, in a ASP.NET the databinding only works in one way (by design) - from source to UI, and not the other way around (this will apparently change in ASP 2.0)... so your solution is in-fact the right one.

If you want to enjoy the 2-way binding, use winforms

Regards,

Ofer