I have requirement in which I need to call a BW FM from CRM environment.
Is there a standard FM or method which could be used to determine the BW destination .
some standard programs use function module RSA2_SERV_BW_CONNECTED to check whether BW is connected at all.
If you find in DB table RSBASIDOC record, where the following statement is true:
IF RSBASIDOC-RLOGSYS NE L_SLOGSYS
OR ( L_S_RSBASIDOC-OBJSTAT EQ 'ACT'
AND L_S_RSBASIDOC-SRCTYPE EQ 'M'
AND L_S_RSBASIDOC-RBWBCRL GE '350' ).
then RSBASIDOC-RLOGSYS is logical system of the BW system(s).
Then it depends how you want to determine the RFC destination - there can be several applications using several setup and different RFC destinations.
You can check, for example, link through standard setup of IDocs - via table EDP13 find receiver port (RCVPRN = BW logsys, RCVPRT='LS', MESTYP='RSSEND', RCVPORT contains the port), in table EDIPOA you can then find the very RFC destination for the port (field LOGDES - this is catch, it really contains the RFC destination ).
Hope this helps.