ABAP:Webdynpro BAPI调用期间出错。设置RFC

时间:2015-08-27 14:29:19

标签: abap webdynpro

我创建了一个调用BAPI的简单WebDynpro应用程序。但是,由于未设置RFC,我收到错误。

如何设置RFC调用?

错误: 由于错误,URL调用http://crmehp.sat.com:8024/sap/bc/webdynpro/sap/zwd_bapi_call已终止。

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

在webdynpro的WDDOINIT方法中调用程序bapi_flight_getlist:

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.

我检查了sm59并且BAPI调用RFC已经存在。但是,还有其他RFC连接可以使用。

1 个答案:

答案 0 :(得分:1)

假设您不想呼叫远程系统:

更改

DESTINATION  'BAPI Call'

DESTINATION  'NONE'

如果是远程系统,请在SM59中创建一个目的地(但没有空格)并改为引用它。