how to call the RFC destination dynamically in CRM system?
i call an RFC in CRM which has an ECC destination.
i had written hardcoded, but when it went to production or quality the destination may change
CALL FUNCTION 'Z_Function_module' DESTINATION 'ERZCLNT301'.
so, Is there any FM to get the RFC destination, or any other process other than hard coding?
the below code will works
CALL FUNCTION 'SMOF0_READ_SITESELECT'
to_siteselect = lt_siteselect.
READ TABLE lt_siteselect INTO ls_siteselect
WITH KEY sitetypeid = cl_smw1_siteprovider=>c_sitetype_r3oltp.
ev_dest = ls_siteselect-rfcdest.