The second RFC retrieves a list of individual data elements associated with a specific structure or table. Obviously, you don't need to invoke this RFC for import/export parameters as these are single fields and not structures. You would need to call "RFC_GET_STRUCTURE_DEFINITION" for each individual structure name returned from the previous RFC call.
I have already provided the code for this application as part of a SearchSAP.com IT checklist. Do a search for "jco cookbook" on SearchSAP.com for the complete source code.
Dig Deeper on SAP integration
Related Q&A from Austin Sincock
Explaining the difference between BAPIs and RFCs, how to find BAPIs in SAP and how to determine errors made from BAPI/RFC calls Continue Reading
Is there a way to view a list of SAP interfaces such as RFC, BAPI and ALE? Continue Reading
A list of SAP ports for JCo usage. Continue Reading