Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving "No transaction handler is installed. Unable to process tRFC/qRFC requests." Error on Generic RFC Communication #75

Open
arunksinfo opened this issue Nov 22, 2022 · 5 comments

Comments

@arunksinfo
Copy link

Hello,

We've used the GenericServerHandler to receive messages via RFC. Server Launch is able to establish the connection between service and SAP. When we try to send any data to service, it shows "No transaction handler is instanlled. Unable to process tRFC/qRFC request"

Can you please provide details on how to register generic handler listener.

Here's the code


SapConnectionParameters sapConnectionParameters = new SapConnectionParameters();
                sapConnectionParameters.SncMyName = "XXXX";
                sapConnectionParameters.GatewayHost = "XX.XX.X.XXX";
                sapConnectionParameters.GatewayService = "MyGatewayServicename";
                sapConnectionParameters.ProgramId = "MyPgmID";
                sapConnectionParameters.RegistrationCount = "1";
                sapConnectionParameters.AppServerHost = "XX.XX.X.XXX";
                sapConnectionParameters.SystemNumber = "02";
                sapConnectionParameters.User = "Username";
                sapConnectionParameters.Password = "Password";
                sapConnectionParameters.Client = "900";
                sapConnectionParameters.Language = "EN";

SapServer.InstallGenericServerFunctionHandler(sapConnectionParameters, (connection, function) =>
                {
                    Console.WriteLine("Calling First");
                    var attributes = connection.GetAttributes();

                    switch (function.GetName())
                    {
                        case "IDOC_INBOUND_ASYNCHRONOUS":
                            Console.WriteLine("Received Metadata");
                            break;
                    }
                });

var server = SapServer.Create(sapConnectionParameters);
                server.Error += (object sender, SapServerErrorEventArgs args) => Console.WriteLine(args.Error.Message);
                server.StateChange += (object sender, SapServerStateChangeEventArgs args) => Console.WriteLine(args.OldState + " -> " + args.NewState);

server.Launch();
               

image

@tom-j-irvine
Copy link

Hi - I've used the GenericServerHandler quite a bit, but all calls have been synchronous. Looking at the RFC SDK doc, implementing a tRFC server is quite a bit more involved as you need to maintain state for executing transactions, etc... Are you able to change how you call the function in the SAP system and make the call synchronous?

@arunksinfo
Copy link
Author

Hello @tom-j-irvine,

Now, we are trying to InstallGenericServerHandler, but the calls are not receiving at the Action delegates. Can you please provide some sample to use GenericServerHandler ?

@tom-j-irvine
Copy link

Sorry, it is really clear what you need help with. Your originally handler code looks okay, though you need to provide two different sets of connection information. When calling InstallGenericServerFunctionHandler, you are provide client connection information (App host, user, etc..) - this is to fetch function metadata, etc. Then, when creating the server, you are providing information for the gateway host, etc. It might work with all of that together in one set of connection info, but if you look at the readme, it is using two different sets of info.

Then, it would be assumed you have an RFC destination setup with the same Program ID. Then, when calling a function from SAP, you would do something like this:

CALL FUNCTION 'YOUR_FUNCTION_NAME'
  DESTINATION 'YOUR_RFC_DEST'
  ...parameters, etc...

This function needs to be defined in the SAP system (this is where your server will get the metadata about the function).

Finally, you may need to look at the RFC Gateway security in your system (in SMGW) to make sure it allows outbound RFC calls to your program id/host, etc...

@ssamsundar
Copy link

@tom-j-irvine ,

Whether is it possible to enhance the SapNwRfc library to work for Asynchronous RFC (tRFC) ?

@tom-j-irvine
Copy link

@ssamsundar - First, I am not one of the developers. To date, I have used the RFC server functionality of the library and helped a little bit with testing, etc. So, to the possibility of adding the functionality, I'll have to defer to the developers for their input. The only thing I can add is that the implementation of a tRFC server would be quite a bit more complex as it needs to maintain state of transactions (likely in some sort of database).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants