Populate Grid Asyncronously via Call to SAP

2 posts, 0 answers
  1. sircutbreaker
    sircutbreaker avatar
    111 posts
    Member since:
    Oct 2007

    Posted 28 Apr 2009 Link to this post

    I am currently using a radgrid to display contents from a remote function call to SAP.

    It works great... But I need to architect it async. Sometimes the calls take some time to come back.

    I am using the SAP .NET connector.  It comes with the Async routines.

    I am able to get the data... but I have the code set up wrong to bind and display the dataset once it returns from SAP.

    I think i need some sort of handler....

    Ultimately, I would like to display a loading gif while the data is being retrieved..

    Here is what the call looks like in c#

    I have removed most of the data code...

    how would I set the grid up to populate from this?

    Object asyncState = null
                //AsyncCallback callback; 
                IAsyncResult asyncresult = null
                    DateTime begintime = DateTime.Now; 
                    proxy.Connection = new SAP.Connector.SAPConnection(destination1); 
                    // Call SAP RFC HERE 
                    string strCustNo = "0000000000" + user.SAPCustomerNo.Trim(); 
                    strCustNo = strCustNo.Substring(strCustNo.Length - 10, 10); 
                    string cust = strCustNo; 
                    AsyncCallback callback = new AsyncCallback(ProcessInfo); 
                    asyncresult = proxy.BeginZvasec_Pnlookup_And_Ixos(cust, portal, strPN, ref tblALTPN_ACTYPE, ref tblALTPN_AVAIL, ref tblPN_ACTYPE, ref tblPN_AVAIL, callback, asyncState); 
                    DateTime endtime = DateTime.Now; 
                    TimeSpan elapsedtime = endtime - begintime; 
                catch (Exception ex) 
                    _return = false

    Here is the receiving routine...

    void ProcessInfo(IAsyncResult result) 
            OrderFunctions objOF = new OrderFunctions(); 
            TList<Cart> reg = new TList<Cart>(); 
            TList<Cart> alt = new TList<Cart>(); 
            ArrayList ary = new ArrayList(); 
            string pnDesc; 
            int partNo; 
            SAPDestinationFunctions objSF = new SAPDestinationFunctions(); 
            bool blnProduction = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings.Get("isproduction")); 
            SAP.Connector.Destination destination1 = objSF.GetR3Destination(blnProduction); 
            SAPR3Proxy proxy = new SAPR3Proxy(); 
            proxy.Connection = new SAP.Connector.SAPConnection(destination1); 
            proxy.EndZvasec_Pnlookup_And_Ixos(result, out pnDesc, out partNo, ref tblALTPN_ACTYPE, ref tblALTPN_AVAIL, ref tblPN_ACTYPE, ref tblPN_AVAIL); 
            UserProfile user = new UserProfile();// = (UserProfile)HttpContext.Current.Session["user"]; 
            DateTime endtime = DateTime.Now; 

  2. Sebastian
    Sebastian avatar
    9934 posts

    Posted 04 May 2009 Link to this post

    Hi sircutbreaker,

    As long as your SAP .NET connector returns a collection which implements IList, IEnumerable or ICustomTypeDescriptor interfaces as explained in this help topic, this should be sufficient to pass the source to the control and bind it. Can you please verify that?

    Moreover, you can utilize our RadAjax framework to perform the operations with ajax calls and display RadAjaxLoadingPanel while the update is in progress.

    Best regards,

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top