cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to call RFC from webdynpro

Former Member
0 Kudos

Dear Experts , I want to call a rfc from my webdynpro application , but its not working

I have a function module in my ECC system , that I want to call from webdynpro application of SRM system but its not working , it is not showing any error also

I called the function module like

CALL FUNCTION 'ZFM_SR_GET_PLANT_RFC' DESTINATION lv_logsys

TABLES

it_plant = lt_pr.

the control is just passing thru this function call but not going inside it,

at the same time when I call this function module from my report program in SRM it's working fine , is there anything else i have to specify to call it from webdynpro application ?

Please help

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

When you use an RFC you can add the exceptions SYSTEM_EXCEPTION and COMMUNICATION_EXCEPTION to catch problems in the RFC layer itself. You probably want to also test the RFC destination from SM59. Make sure the connection settings are OK and that the Destination either has a user name and password in it or that it uses Trusted RFC or SSO Tickets. The destination can only prompt for username or password at runtime when running in the SAPGUI. For use in WDA it must have a way of connecting without having to query the user for authentication.

Former Member
0 Kudos

Hi Thomas , thanks for reply , I have tested my rfc connection it's ok , also when executed it from one of my report program I called my rfc function module it gets executed without any prompt for user name or password ,

I have debugged it at runtime it is not throwing any exception. The only thing I doubt is about RCS connection type currently I am using ABAP connection i.e. type 3 , do webdynpro require RFC to be of type HTTP connection ?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>do webdynpro require RFC to be of type HTTP connection ?

No it doesn't.

Did you add the two exceptions I suggested? If so are they triggered? Did you add the MESSAGE substatement to these excpetions? This will add much more technical details about the failure.

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/22/0425e0488911d189490000e829fbbd/frameset.htm

Former Member
0 Kudos

Hi thomas ,

I have added the exception for my function module , but they didnt triggered ,while debugging I have observed that no exception occured at the point of call , and my sy-subrc eq 0 ,

se I did like this

CALL FUNCTION 'ZFM_SR_GET_PLANT_RFC' DESTINATION lv_logsys

TABLES

it_plant = lt_pr

EXCEPTIONS

system_failure = 1 MESSAGE msg

communication_failure = 2 MESSAGE msg

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID 'ZMSG01' TYPE 'E' NUMBER '00' WITH msg

INTO ls_message-message.

CALL METHOD wd_comp_controller->gref_message_manager->report_error_message

EXPORTING

message_text = ls_message-message.

ENDIF.

AT CALL FUNCTION statment the control is just passing thru it , and not going inside function module

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Are you sure the value in LV_LOGSYS is correct? Are you sure the function module name is correct? It seems odd that you aren't getting any excpetions. Are you sure you aren't passing into the function module? If the RFC destination has a username and password (different than your own) embedded in the destination, you won't be able to debug into the remote portion of the call.

Former Member
0 Kudos

Thank you very very much thomas , my problem got solved.

I did two mistakes , my rfc destination had somebody others user name rather then mine when I loged in by his ID it went to debugging mode, and the name of table fields which I am passing to rfc are different then the formal parameter of the functiona module.

Answers (0)