Search code examples
abapsaprfcbapiwebdynpro

COMMUNICATION_FAILURE during a Webdynpro BAPI call?


I have created a simple WebDynpro application that calls a BAPI. However, i am getting an error as RFC is not setup.

How do i setup the RFC call?

Error: The URL call http://crmehp.sat.com:8024/sap/bc/webdynpro/sap/zwd_bapi_call was terminated because of an error.

The following error text was processed in system EH5 : RFC Exception COMMUNICATION_FAILURE with Message RFC destination BAPI Call does not exist. Occurred 
◾ The error occurred on the application server CRMEHP2_EH5_24 and in the work process 0 . 
◾ The termination type was: RABAX_STATE
◾ The ABAP call stack was: 
Method: EXECUTE_BAPI_FLIGHT_GETLIST of program /1BCWDY/0AA4D2ZOSMWRNSH8KCQZ==CP
Method: IF_COMPONENTCONTROLLER~EXECUTE_BAPI_FLIGHT_GETLIST of program /1BCWDY/0AA4D2ZOSMWRNSH8KCQZ==CP
Method: WDDOINIT of program /1BCWDY/0AA4D2ZOSMWRNSH8KCQZ==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_INIT of program /1BCWDY/0AA4D2ZOSMWRNSH8KCQZ==CP
Method: DO_INIT of program CL_WDR_DELEGATING_VIEW========CP
Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
Method: INIT of program CL_WDR_CONTROLLER=============CP
Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP
Method: BIND_ROOT of program CL_WDR_VIEW_MANAGER===========CP

Calling procedure bapi_flight_getlist in WDDOINIT method of webdynpro:

method WDDOINIT .
  DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
  lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).

    lo_componentcontroller->execute_bapi_flight_getlist(
     airline =    'AA'                       " bapisflkey-airlineid
*     destination_from =                  " bapisfldst
*     destination_to =                    " bapisfldst
*     max_rows =                          " bapisflaux-bapimaxrow
    ).

endmethod.

execute_bapi_flight_getlist defination:

  CALL FUNCTION 'BAPI_FLIGHT_GETLIST'
    DESTINATION  'BAPI Call'
    EXPORTING
       airline =                         airline
       destination_from =                destination_from
       destination_to =                  destination_to
       max_rows =                        max_rows
    TABLES
       date_range =                      lt_c_date_range
       extension_in =                    lt_c_extension_in
       flight_list =                     lt_c_flight_list
       extension_out =                   lt_c_extension_out
       return =                          lt_c_return
    EXCEPTIONS
      system_failure =                    1   MESSAGE    lv_rfc_error
      communication_failure =             2   MESSAGE    lv_rfc_error.

I checked sm59 and a BAPI Call RFC dosen't exist. However, there are other RFC connections that work.


Solution

  • Assuming you don't want to call a remote system:

    Change

    DESTINATION  'BAPI Call'
    

    To

    DESTINATION  'NONE'
    

    If it is a remote system, create a destination in SM59 (but without the space) and reference that instead.