I'm assuming that since you're asking about SEF URLs for your component that you've already built your own custom router (as SEF URLs for a custom component are dependent upon that). If not then you can follow the example described in https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_an_alias and following tutorial steps.
If you've done that then outputting an SEF URL on the admin backend is similar to how you create an SEF URL on the front end using JRoute::_
and passing the various parameters such as your component (option
), id of your item, Itemid of the menuitem, etc. Except that on the admin side you should use
use Joomla\CMS\Router\Route;
$url = Route::link("site", "index.php?option=com_example&view=showitem&id=14);
See Joomla Route link for the API definition and URLs in Joomla for a description of how to use these functions.
Note that the link
method is available only since Joomla 3.9, so if you're working on a version which predates that then it's rather more tricky, as you have to hack your way into the Joomla core code, but not impossible.
Also just be aware that the SEF URL may differ depending upon the Itemid of the menuitem which you pass to the link
function and how you've built your custom router.