cancel
Showing results for 
Search instead for 
Did you mean: 

Porting DCOM to .net and want to make "object" style calls

Former Member
0 Kudos

We are currently trying to port the APS Connector to use the new .NET technology but we have run into a very specific problem which you may be able to help us with.

When using the DCOM Connector, we were able to call BAPI objects directly e.g.

ManufactOrderAPS.GetList

ManufactOrderAPS.GetList2

However, in the .NET Connector, the only thing which we have managed to work out is how to call the RFC functions e.g.

BAPI_MOSRVAPS_GETLIST

BAPI_MOSRVAPS_GETLIST2

Is there anyone who you know who would be able to tell us how we are suppose to make the object style calls and not the RFC calls?

Many thanks for any help you can provide us

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for the information. We will do as you suggest.

One other question has arisen when porting the code to .NET. Currently, we connect using a DCOM Desination. This if configured in the DCOM Connector utility and means we can connect simply by providing the name of the DCOM Destination. Ideally, we would want to recreate this in the new program, however, it only seems to be possible to connect by specifying all the usual connection parameters in the code.

Is there any way to connect using a .NET destination?

Many thanks

reiner_hille-doering
Active Contributor
0 Kudos

> to .NET. Currently, we connect using a DCOM

> Desination. This if configured in the DCOM Connector

> utility and means we can connect simply by providing

> the name of the DCOM Destination. Ideally, we would

> want to recreate this in the new program, however, it

> only seems to be possible to connect by specifying

> all the usual connection parameters in the code.

> Is there any way to connect using a .NET

> destination?

In NCo 1.x, we offer two destinations: Destination is the passive one just converts property values to a connection string. SAPLogonDestination takes as many properties from SAPLOGON.INI based on the DestinationName.

Both - like any .NET component - can be used in desginer to persist all propeties to code. But but also like in all .NET components they allow the properties to be "bound" to Web.config/app.config. Just check the "Dynamic Properties" feature provided in Visual Studio. This allows to easily configure destination setting at deployment time. BTW: In NCo 2.x, the destiantions will automatically set to bind most properties to config file.

Additionally NCo 2.x comes with a new ConfigDestination, that stores/reads all properties to config file in an easier to handle syntax.

reiner_hille-doering
Active Contributor
0 Kudos

BOR objects are in fact stateless objects with methods that are renamed RFC functions. So in fact this just a naming issue:

Just Call your proxy class ManufactOrderAPS (instead of SAPProxy1 or similar) and rename the Methods Bapi_Mosrvaps_Getlist and Bapi_Mosrvaps_Getlist2 to GetList and GetList2. You can easily do those customizations using the Proxy Designer.

BTW: The next major version of .NET Connector will have advanced BOR/BAPI support that does these customizations automatically for you based on the information stored in BOR. The beta is planned to be available within the next weeks.

Former Member
0 Kudos

> Just Call your proxy class ManufactOrderAPS (instead

> of SAPProxy1 or similar) and rename the Methods

> Bapi_Mosrvaps_Getlist and Bapi_Mosrvaps_Getlist2 to

> GetList and GetList2. You can easily do those

> customizations using the Proxy Designer.

Dear Reiner, could you please guide me though the process of changing name of the method. I managed to change name of the proxy class by modifying the .cs file name in Add New Item / Name field. Yet I do not see an option to specify method name in "Create SAP Connection class..." wizard.

As I wrote in the other topic I created, when I simply modify the name of the method in proxie's .cs file, I get NullReferenceException during call. There has to be something I am missing.

Thank you in advance,

Anton Maslo

Former Member
0 Kudos

Hi,

But you can change the name of a method later outside the wizard by opening the generated .sapwsdl file in design mode and changing the method name through the property sheet. After saving the changes, the C# files will be re-generated.

Regards,

Guangwei