Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Determining URI for a backend ABAP object

matt
Active Contributor

In ADT/Eclipse, to navigate to an object, you need its name, type and URI.

So for class /NAMESPACE/CL_MYCLASS, I need:

  1. Name: /NAMESPACE/CL_MYCLASS
  2. Type: CLAS/OC
  3. URI: /sap/bc/adt/oo/classes/%2fnamespace%2fcl_myclass/source/main

Now, I can construct the URI from the name and type using string operations, but I wondered if anyone is aware of a simpler way. I need it for function modules, function groups, programs and includes as well.

I'm looking for either a backend class or function module, or some class/method in a com.sap.adt package.

1 REPLY 1

thomasalexander_ritter
Active Contributor

Hi Matthew,

yes, we do not recommend building those URIs manually because they might change in the future. Please use the official URI mapper API.

data(uri) = cl_adt_tools_core_factory=>get_instance( )->get_uri_mapper( )->get_adt_object_ref_uri( name = 'sadt_rest_rfc_endpoint'type = conv #( 'FUGR' ) ).

Hope this helps.

Regards,

Thomas