12-23-2014 4:42 AM
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?
12-24-2014 8:42 AM
the below code will works
CALL FUNCTION 'SMOF0_READ_SITESELECT'
TABLES
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.
Regards,
akshath
12-23-2014 5:10 AM
Hi ,
In this system field sy-sysid , you can get the system id like is it DEV , Quality or production
depending on that you can pass the RFC destination.
12-23-2014 5:11 AM
12-24-2014 6:03 AM
12-23-2014 5:17 AM
You need some way of specifying the destination depending on what the calling system is. You could use a table that holds the valid destination, or a TVARVC variable, or something like
CASE sy-sysid.
WHEN 'DC4'.
dest = 'ECCDEV'.
WHEN 'TC4'.
dest = 'ECCTEST'.
WHEN 'PC4'.
dest = 'ECCPROD'.
ENDCASE.
Or you could look at setting up partner ids in ALE and using them.
12-23-2014 5:35 AM
If sy-mandt = '301' " for Production
CALL FUNCTION 'Z_Function_module' DESTINATION 'ERZCLNT301'
ELSEIF sy-mandt = '101' " for Development
CALL FUNCTION 'Z_Function_module' DESTINATION 'ERZCLNT101'
ELSE. " for quality
CALL FUNCTION 'Z_Function_module' DESTINATION 'ERZCLNT201'
ENDIF.
Create a variable of type RFCDEST and pass these destination as per client.
12-24-2014 6:02 AM
helo all,
thank you for the replies, really those are helpful but if i dont know the destination may it varies then what is the other approach. i think it is better to call the FM? is ther any FM?
12-24-2014 8:02 AM
Hi Akshath,
Use FM 'CRM_AV_CHECK_R3_GET_DESTIN' to get the destination.
CALL FUNCTION 'CRM_AV_CHECK_R3_GET_DESTIN'
IMPORTING
ev_destination = lv_destination
EXCEPTIONS
invalid_release = 1
OTHERS = 2.
Thanks,
Ritu
12-24-2014 8:29 AM
hi ritu,
i tried this earlier but it is not fetching any data in lv_destination. could you please elaborate how it will be helpful
12-24-2014 8:42 AM
the below code will works
CALL FUNCTION 'SMOF0_READ_SITESELECT'
TABLES
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.
Regards,
akshath
12-24-2014 9:11 AM
HI Akshath,
Both the fm CRM_AV_CHECK_R3_GET_DESTIN and SMOF0_READ_SITESELECT are giving same result.
See the screenshot for result.
Thanks,
Ritu
12-24-2014 10:02 AM