Skip to Content
avatar image
Former Member

dot net webservice using sap dot net connector not fetching data from sapR3

I am using SP-Dot net connector 2.0 and using it to access data from SAP . I have written webservice having webmethods which returns datasets .

I am intialising connection strings to sap through application variable in initialise method

public SapWebService()


//CODEGEN: This call is required by the ASP.NET Web Services Designer


sapProxy21=new SAPProxy2(Application.Get("ConnectionStringSapRetail").ToString());

//VendornameCls=new SAPProxy1(Application.Get("ConnectionStringSapRetail").ToString());

VendornameCls=new SAPProxyVendDetails(Application.Get("ConnectionStringSapRetail").ToString());

I have web methods like

[WebMethod(Description="Gets Staff's Loan balance where only balance is to be fetched based on SPGL indicator (Returns datatable) ",EnableSession=true , CacheDuration=0 , BufferResponse=true )]

public System.Data.DataSet BAPI_AP_ACC_GETKEYDATEBALANCEForAllSPGL( string VendorCode )


int VendorCodeLength = VendorCode.Length;

int BalanceZeros =10-VendorCodeLength;

int pad =0;

for (pad=0;pad < BalanceZeros ; pad=pad+1)

VendorCode="0" + VendorCode;

sapwebapplication.BAPIRETURN returnobj =new BAPIRETURN();

sapwebapplication.BAPI3008_3Table lineitemTbl = new BAPI3008_3Table();

VendorKeyBalance.Bapi_Ap_Acc_Getkeydatebalance("0","1000",System.DateTime.Today.ToString() ," " ,VendorCode,out returnobj ,ref lineitemTbl);

System.Data.DataTable AdvanceTable;

AdvanceTable = new System.Data.DataTable();

AdvanceTable = lineitemTbl.ToADODataTable();

//change column names and delete columns

int y;

int m;





for (y=m; y >=0; y--)


if (AdvanceTable.Columns[y].ColumnName.ToString()=="Sp_Gl_Ind")


if (AdvanceTable.Columns[y].ColumnName.ToString()=="T_Curr_Bal")


if (AdvanceTable.Columns[y].ColumnName.ToString()=="Db_Cr_Ind")



System.Data.DataSet Ds;

Ds= new DataSet();


return Ds;

When I hosted the application in many servers with win2003 and XP , it is fetching data from SAP .

SAP is behind firewall .

However when I hosted it in production server few days it worked . Now it is not giving any error however It is not fetching any data from SAP R/3 .

Firewall settings , port openings evrthing is fine .

Can any one please help ?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 22, 2007 at 12:35 PM

    hi bhatnp ,

    As you say taht i worked for few days it must wok now also. it might be Network address problem or Firewall problem.



    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Please let me know what is network address problem ?

      I had used microsoft network monitor tool and it is clearly showing activity between dot net application server and sap servers . Since R/3 is load balanced , response comes from any sap r/3 servers . This also proves that Firewall is not blocking any data in between .

      Since you have worked on these issues , please let me know what fire wall settings and network settings needs to be looked into .

      Thanks in advance .



  • avatar image
    Former Member
    May 22, 2007 at 03:19 PM

    Hi Bhat,

    I used to face similar issues when i worked on connector. one best way to deal such kind of issues is recreate the the proxy. i mean delete the proxy you created and create again. i hope it will solve your issue.



    Add comment
    10|10000 characters needed characters exceeded