on 09-19-2012 8:27 AM
Hi,
I have built a RFC server with the SAP .Net Connector, which is listening to one function call.
Because everything should be initiated from the SAP side, I'm using this function for the first
initial call and then determine in the C# code, what kind of call it is. Within this call, I'm calling
the necessary function on the SAP side (from C# now) and in the end, I wanted to pass back
some table data to the RFC server function, which has been called at the beginning from SAP.
But everything, what I'm passing to this table, disappears in ABAP, after the function call has
been done.
My scenario:
ABAP program ---> Call RFC function "Z.....Interface" --> C# receives this call, calls several other RFC functions --> In the end, "Z.....Interface" function should pass back message information in a table.
This information disappears somehow, but in the very end of the C# code, the IRFCTable is still filled.
Can anyone explain me, why this data is not going to be passed back to the caller program, via the called function?
Thank you very much!
Michael
Michael -- your scenario makes sense. Can we take a look at your code to see if we can spot any problems there, please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Case,
thanks for the quick answer. I have built my C# application in several classes. One is just for the handling of the server calls:
public class ServerHandler
{
[RfcServerFunction(Name = "Z_INTERFACE_HANDLER")]
public static void IrdpConnection(RfcServerContext context, IRfcFunction function)
{
// Create SAPFunctions instance
SapFunctions sapFunctions = new SapFunctions();
// Create Structure for control data
IRfcStructure rfcControlData = function.GetStructure("CONTROL_DATA");
// Create Table for passing back messages
IRfcTable messageTable = function.GetTable("MESSAGE_TABLE");
// Read exchange type
String exchangeType = rfcControlData.GetString("EXCHNG_TYPE");
// Write log message for received call
LogFunctions logFunctions = new LogFunctions();
// Determine call type
switch (exchangeType)
{
case "01":
sapFunctions.extractDataToIrdp(rfcControlData, messageTable);
break;
}
}
}
So if I now check the IRfcTable messageTable in the end of the method, it is filled. But I'm not getting anything back to
the caller ABAP program. I hope, this is not a very stupid mistake, which I don't see anymore, cause it's too easy!
Thank You!
Michael
Hey again,
I have found the error by myself and it was something very easy...
I have created the function "Z_INTERFACE_HANDLER" in the SAP system and inside of it, I have added some code, which is creating log information for each call. Inside of this function, the "real" function "Z_INTERFACE_HANDLER", which is registered on the C# side, is going to be called. Within this function frame on the SAP side, I have wrongly passed the MESSAGE_TABLE information from the RFC server call back to the frame function. So the message_table information came always back from C#, but never reached the caller program, which was just calling the frame function.
Thank you for listening anyway!
Michael
When RFC calls from SAP Server controls comes inside ServerHandler but unable to move inside IrdpConnection.Kindly suggest me what i forgot to declare so all works fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.