on 07-16-2014 7:13 AM
I have windows application which is built on top of old SAP connector framework. Not sure about the version but it is using SAP.Connector.DLL (v1.2.3.0).
I need to migrate it to .Net Framework 4.0 so I understand I would need to use SAP Connector 3.0.
I learnt that there are some major changes from the previous version of SAP connector framework for instance SAPServerHost , SAP.Connector.SAPServer are completely missing.
I have just started working with this API and I am not really how I should start with this migration.
Any pointers do this migration smoothly would really be helpful. I am currently stuck and not sure how to proceed further.
Regards,
Darshan
I started with the documentation provided. Both NCo_30_Overview.pdf and NCo_30_Tutorial.zip gave me a quick and sufficient insight into the NCO 3 concept.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Hynek,
I got the installable for NCo 3.0 separately so I could install it without issues. But accessing these documents require SAP market place login which I don't have.
I am particularly stuck at below point currently.
I am able to query the SAP Host status using below code and config below (and also able to execute BAPI functions but I do not need to do that)
But I am not able to Start or Stop the SAP Host. That means, if I write "SapHost.Start();"
SAPHost status is updated as Started but if I fetch the status next time (execute the application again), it is always stopped.
Code
Type[] RfcHandlers = new Type[1] { typeof(DxsRfcServer) };
RfcServer SapHost = null;
SapHost = RfcServerManager.GetServer("CONFIGENTRY", RfcHandlers);
app.config
<SAP.Middleware.Connector>
<ClientSettings>
<DestinationConfiguration>
<destinations>
<add NAME="ENTRY1" USER="*****" PASSWD="******" CLIENT="***" LANG="DE" ASHOST="**************************" SYSNR="**"/>
</destinations>
</DestinationConfiguration>
</ClientSettings>
<ServerSettings>
<ServerConfiguration>
<servers>
<add NAME="CONFIGENTRY" GWHOST="****" GWSERV="******" PROGRAM_ID="*****" REPOSITORY_DESTINATION="ENTRY1" />
</servers>
</ServerConfiguration>
</ServerSettings>
</SAP.Middleware.Connector>
Please suggest if you know how to fix this issue.
Thanks,
Darshan Bhatt
You shall not exit your application as long the server is running. And do a proper shutdown at the end.
If I understand your "execute the application again" - are you exiting right after the call to SapHost.Start() ?
Did you implement the error handlers?
SapHost.RfcServerError += OnRfcServerError;
SapHost.RfcServerApplicationError += OnRfcServerApplicationError
Thanks Hynek for your continuous help.
But here is what I need to do, Not sure if doing it right.
I need to query the "Status" of SAP Host (whether it is running ot not). If it is not running, I would like to start the SAP Host
So in my applicaiton, I an starting the SAP Host and stopping the application and next time I expect tahat I get SAP Host in "Started" status.
I am not sure if this is the correct way with NCo 3.0. But in my old application built on top of NCo 2.0 we were able to do change the sap host status by calling Start() method from SAP.Connector.SAPServerHost
Let's call the objects by names of their classes. So I assume your "SAP Host" means RfcServer.
RfcServer is hosted within your .NET Application. As soon as the application terminates, the RfcServer terminates too.
Could you split your effort into creation of
a) Windows service that will provide your RfcServer functionality and will run all the time you need the "SAP Host" to be up.
b) query/control tool, that will monitor the status. You can query the a) component via any standard .NET IPC mechanism, e.g. anon/named pipes.
Component b) would query the status of SAPServer (contained in component a)).
Then you may have two possible scenarios
1) You make start/stop of windows service independent of RfcServer start/shutdown. So the component b) would send commands to a) to start or stop the RFCServer. I.e. to issue SAPHost.Start() SAPHost.Shutdown(true/false), not to restart the Windows service.
2) You would implement RfcServer.Shutdown in Windows service shutdown and RfcServer Start in service startup. Then Windows service status = RfcServer status.
You read your RfcServer status e.g. via RfcServerMonitor.State.
Hi Hynek,
I am able to develop application as per your guidelines. Windows service and windows application which communicates through Net Pipe.
But here is my scenario I am trying to execute.
For eg. I have one console application, which is fetching RfcServer and starting it within the console application by invoking .Start() method. Assuming it is already stoppped.
I have other console application which is initializing same RfcServer and when I am trying to fetch the status, it is shown as "Stopped".
I would like to know if RfcServer being started by one application is reflected in other calls to that same RfcServer.
I know I am missing something here but I am not sure. If you can share your personal email Id, I am happy to share the solution as well.
Thanks for your extended support.
Hi Hynek, Darshan,
trying first to verify that I understood your question correctly: when starting the same RfcServer instance, i.e. twice with the same configuration, is this possible. If this is the question, then I can tell you that it is possible: The two executables don't know of each other and are independent. When starting those servers, both will register the same program ID on the same gateway, if each of them registers 2 connections for program ID Foo, there will be in the end 4 connections available for FOO on this gateway. Depending on the gateway settings, the connections will be used following a certain policy, default is a round robin policy.
One additional remark. You can also check from an ABAP system, whether a certain server is existing by sending a request to RFC_PING to the corresponding destination.
Best regards,
Markus
Hi Markus,
I think I got the idea. Now I have opened RfcServer and trying to capture STFC_DESTINATION request from Server.
I have a question though. I am not directly working with the SAP system so that I can not trigger this function directly to test my functionality.
I got some information regarding RfcServer can also be registered with saprfc.ini as well.
Now this might sound weird but is it possible to specify my RfcServer that I am hosting in saprfc.ini so when non-SAP application is making a call (dummy call to STFC_DESTINATION in this case) , I can handle it.
Thanks.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.