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

List all the RFC's and its schema using gorfc #39

Open
aashakabra opened this issue Oct 9, 2023 · 13 comments
Open

List all the RFC's and its schema using gorfc #39

aashakabra opened this issue Oct 9, 2023 · 13 comments

Comments

@aashakabra
Copy link

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.

@bsrdjan
Copy link
Contributor

bsrdjan commented Oct 9, 2023

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?

@aashakabra
Copy link
Author

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.

@bsrdjan
Copy link
Contributor

bsrdjan commented Oct 9, 2023

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

@aashakabra
Copy link
Author

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* ?

@bsrdjan
Copy link
Contributor

bsrdjan commented Oct 9, 2023

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 ?

@bsrdjan
Copy link
Contributor

bsrdjan commented Oct 9, 2023

The RFC_FUNCTION_SEARCH is ABAP RFC that returns the list of ABAP RFC names.

@aashakabra
Copy link
Author

Is there any plan to make such functionality available in https://github.com/SAP/gorfc ?

@bsrdjan
Copy link
Contributor

bsrdjan commented Oct 12, 2023

Not to my knowledge

@aashakabra
Copy link
Author

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.

@bsrdjan
Copy link
Contributor

bsrdjan commented Oct 13, 2023

Yes, you can do it the same way in golang. It is standard function module call like in README examples

@aashakabra
Copy link
Author

Thankyou, I was able to do so using below snippet-

params1 := map[string]interface{}{
		"FUNCNAME": "STFC*",
	}

r1, _ := conn.Call("RFC_FUNCTION_SEARCH", params1)

@aashakabra
Copy link
Author

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

@bsrdjan
Copy link
Contributor

bsrdjan commented Oct 17, 2023

it is unicode and non-unicode length

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

2 participants