Skip to Content
0

How to use SAP URL in .NET APplication

Feb 08, 2017 at 07:50 PM

39

avatar image

Hi All,

Client has given one SAP URL. From that they have told to fetch data to our .net site.

Can someone help us how to use that url to fetch data.

url is something like

https://***.**.**.***:50001/dir/wsdl?p=**/f94ac0e18ab039****5703a9acf653a0

In that they have xml file with RFC name and table colum names

We have written following code:

public static SAP.Middleware.Connector.RfcDestination connect()

{

RfcDestination testconnect = RfcDestinationManager.GetDestination("QA"); return testconnect;

}

public DataSet GetData(string companycode,string empid)

{

RfcDestination test = connect(); DataSet contacts = new DataSet();

try {

//RfcRepository rfcrepos = test.Repository;

RfcSessionManager.BeginContext(test);

IRfcFunction rfcfunction = test.Repository.CreateFunction("ZHR_BCM_DATA");//error rfcfunction.SetValue("I_BUKRS", companycode);

rfcfunction.SetValue("I_PERNR", empid);

rfcfunction.Invoke(rfcdestination); contacts.Tables.Add(Converttodatatable(rfcfunction.GetTable("CONTACTS")));

}

catch (Exception ex)

{

throw new Exception(ex.InnerException.ToString());

}

return contacts;

}

we are getting error in

IRfcFunction rfcfunction = test.Repository.CreateFunction("ZHR_BCM_DATA");//error

like following attached screenshot

our config file:

<configSections>

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

<sectionGroup name="SAP.Middleware.Connector"> <sectionGroup name="ClientSettings"> <section name="DestinationConfiguration" type="SAP.Middleware.Connector.RfcDestinationConfiguration, sapnco"/> </sectionGroup> </sectionGroup>

</configSections>

<SAP.Middleware.Connector>

<ClientSettings>

<DestinationConfiguration>

<destinations>

<add NAME="QA" USER="***" PASSWD="*****" CLIENT="001" LANG="EN" SYSID="BCM" ASHOST="***.**.**.**l" SYSNR="50001" MAX_POOL_SIZE="200" IDLE_TIMEOUT="100"/>

</destinations> </DestinationConfiguration>

</ClientSettings>

</SAP.Middleware.Connector>

Please help us to connect to the given url.

Thanks in advance

no-auth-1.png (127.0 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers