Skip to Content
author's profile photo Former Member
Former Member

Asynchronous call

Hi Reiner,

I have created my delegate and callback function for an Asynchronous windows application. After the BeginXXX function that has been processed,the return parameters at EndXXX is ok, I see the values of my table returned in the debugger. However because my table is a datamember from the Proxy field i dropped and configured earlier and bound to a datagrid, the values are not binding to the datagrid. In synchronous mode, it works, and in this mode it does not bind. I am not really a VS expert, is there another command I should be using to refresh the contents of my table after the async call?

cheers

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 06, 2004 at 08:57 AM

    Hi,

    If you use the BeginXXX and EndXXX methods pair generated by the Wizard to make the asynchronous call, instead of creating your own delegates, the connector runtime will refresh the bound controls for you automatically.

    You can ask wizard to generate methods for asynchronous calls by setting the property CreateAsyncs of your .sapwsdl file to "true".

    Regards,

    Guangwei

    Add a comment
    10|10000 characters needed characters exceeded

    • Windows Forms databinding in conjunction with asyncronous calls is a teribly complicated thing, even if you normally wont recognise it.

      This is caused by the fact that Windows forms controls are not thread-safe. You are not allowed to do any modification on a control outside the thread that created the control. This statement is also valid for datanbinding. As EndInvoke is called on a different thread, it MUST normally NOT update any control.

      We have a trick in NCo that automatically turns off Databdinding in BeginInvoke (by setting the table's SupportChangeNotification to false) and later in EndInvoke calls SAPClient.RefreshBoundTables -> SAPStructure.RefreshBindings - which internally uses some special API do update the databinding even from the different thread.

      And you are righ - this works only for databindings where "DataMember" is empty. For the other case you would need some additional manual coding.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.