webdyn bapi service call, supply fuction .



node:(supply function )  


DATAitab_bookings TYPE if_componentcontroller=>elements_bookings,
        stru_bookings LIKE LINE OF itab_bookings,
        stru_flightlist TYPE if_componentcontroller=>element_flight_list.
   parent_element->get_static_attributesIMPORTING static_attributes stru_flightlist ).
*  itab_bookings = cl_wdabap_flight_model=>get_bookings( carrid = stru_flightlist-airlineid
*                                                        connid = stru_flightlist-connectid
*                                                        fldate = stru_flightlist-flightdate ).

  select FROM sbook into CORRESPONDING FIELDS OF TABLE itab_bookings
    where carrid stru_flightlist-airlineid
       and  connid stru_flightlist-connectid
       and  fldate stru_flightlist-flightdate .
  node->bind_tableitab_bookings ).
**


 wizard (button action)

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

    lo_componentcontroller->execute_bapi_flight_getlist(
    ).


controller implementation .

* declarations for context navigation
  DATA lo_element TYPE REF TO if_wd_context_element.
  DATA lt_elements TYPE wdr_context_element_set.

* declarations for parameters

* get all involved child nodes

* get input from context

* the invocation - errors are always fatal !!!
  DATA lv_rfc_error   TYPE LENGTH 120.
  DATA lv_rfc_message TYPE string.
  data:t_list type wd_this->elements_flight_list .
  CALL FUNCTION 'BAPI_FLIGHT_GETLIST'
   EXPORTING
*      airline =                         wd_this->airline
      destination_from =                wd_this->destination_from
      destination_to =                  wd_this->destination_to
"      max_rows =                        wd_this->max_rows
   TABLES
"      date_range =
"      extension_in =
      flight_list =  t_list
"      extension_out =
"      return =
*    EXCEPTIONS
*      system_failure =                    1   MESSAGE    lv_rfc_error
*      communication_failure =             2   MESSAGE    lv_rfc_error.
** error handling
*  CASE sy-subrc.
*    WHEN  1.
*      lv_rfc_message = lv_rfc_error.
*      RAISE EXCEPTION TYPE cx_wd_no_handler
*        EXPORTING
*          textid        = cx_wd_no_handler=>kind_rfc
*          old_exception = `SYSTEM_FAILURE`
*          rfc_message   = lv_rfc_message.
*    WHEN  2.
*      lv_rfc_message = lv_rfc_error.
*      RAISE EXCEPTION TYPE cx_wd_no_handler
*        EXPORTING
*          textid        = cx_wd_no_handler=>kind_rfc
*          old_exception = `COMMUNICATION_FAILURE`
*          rfc_message   = lv_rfc_message.
*  ENDCASE.

.

data:node_root type REF TO if_wd_context_node .
data:node_list type REF TO if_wd_context_node .

node_root wd_context->get_child_nodename 'BAPI_FLIGHT_GETLIST' ).
node_list node_root->get_child_nodename 'FLIGHT_LIST' .
node_list->bind_tablenew_items t_list
                         set_initial_elements abap_true .


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值