Open aashakabra opened 11 months ago
With "all RFCs" you mean all RFCs used in your scenario, like RFCs whose names are listed in some input file?
Can you share some more info on your scenario and how the schema should be used? In design-time, using CLI for example, or in your application run-time, to dynamically read schemas of arbitrary RFCs?
We have a filter text box where if I mention SFTC* then I should be able to fetch all the RFC's starting from SFTC and display it in dropdown. Based on the RFC clicked on the dropdown, I should be able to fetch the fields(dynamically) of that RFC and able to display on input tab.
to further make actual runtime call. I am using gorfc.Connection's Call method to perform runtime operation.
Using Jco library I am able to perform both design time operation of fetching list of all RFC's based on text filter and display the schema/fields of the selected RFC so that I can take input from user and then perform runtime operation. But I am trying to see if I can do both design time operations using go library.
Not sure how JCo exactly is doing it but the RfcGetFunctionDesc
from SAP NW RFC SDK could be exposed, like Python RFC method get_function_description() for example.
Usage example is examples/clientPrintDescription.py,
RFM schema retrieved by this method looks like this: https://github.com/SAP/PyRFC/tree/main/tests/data, if it fits your requirements
Thankyou for suggestion. I think current method gorfc.Connection.GetFunctionDescription should help with the input and output fields of mentioned RFC. Right?
Is there any method available in gorfc that can help to list down all the RFC's starting from some keyword like SFTC* ?
Yes, gorfc.Connection.GetFunctionDescription sounds promising. The gorfc method to list RFCs can only pass the selection like STFC* to some ABAP RFC, to get the list of RFCs from ABAP system. I don't know if such RFC exists and how JCo is doing it. Perhaps to ask in SAP ABAP Community ?
The RFC_FUNCTION_SEARCH
is ABAP RFC that returns the list of ABAP RFC names.
Is there any plan to make such functionality available in https://github.com/SAP/gorfc ?
Not to my knowledge
Okay.
With JCo client I am able to use call above function in this manner-
JCoFunction func = client.getRepository().getFunction("RFC_FUNCTION_SEARCH");
My requirement is to do something like this using golang.
Yes, you can do it the same way in golang. It is standard function module call like in README examples
Thankyou, I was able to do so using below snippet-
params1 := map[string]interface{}{
"FUNCNAME": "STFC*",
}
r1, _ := conn.Call("RFC_FUNCTION_SEARCH", params1)
Hello bsrdjan, Can you please let me know what does nucLen and ucLen in FunctionDescription mean?
I can see for few RFC, having the RFCTYPE_CHAR has nucLen = 3 and ucLen=6 whereas another parameter having same type RFCTYPE_CHAR has nucLen = 1 and ucLen = 2
it is unicode and non-unicode length
Is there any way we can get the list of all RFC's and its schema using gorfc third party. Which methods can be used to do so? Something similar to SAP JCo library.