ABAP FBI View

Build feeder class for the form GUIBB of initial screen

創(chuàng)建Class,進(jìn)入接口如下



添加如下Attribute



Method實(shí)現(xiàn)如下
method IF_FPM_FEEDER_MODEL~GET_INPORT_KEY.
    GET REFERENCE OF ms_object_key INTO rr_object_key.

method IF_FPM_FEEDER_MODEL~GET_OUTPORTS.
  DATA: ls_outport TYPE if_fpm_feeder_model=>ty_s_port.
  CLEAR: et_outport.
  GET REFERENCE OF ms_object_key INTO ls_outport-object_key.
  ls_outport-type = if_fpm_feeder_model=>cs_port_type-selection.
  ls_outport-identifier = if_fpm_feeder_model=>cs_port_type-selection.    "SE
  ls_outport-description = cl_wd_utilities=>get_otr_text_by_alias( '/SCMTMS/UI_CMN/SELECTION' ).
  INSERT ls_outport INTO TABLE et_outport.
  GET REFERENCE OF ms_object_key INTO ls_outport-object_key.
  ls_outport-type = if_fpm_feeder_model=>cs_port_type-collection.
  ls_outport-identifier = if_fpm_feeder_model=>cs_port_type-collection.   "CO
  ls_outport-description = cl_wd_utilities=>get_otr_text_by_alias( '/SCMTMS/UI_CMN/COLLECTION' ).
  INSERT ls_outport INTO TABLE et_outport.

method IF_FPM_FEEDER_MODEL~GET_OUTPORT_DATA.
  DATA: ls_root_key TYPE /bobf/s_frw_key,
    li_root_key TYPE /bobf/t_frw_key.
  data: lo_entity_coll type REF TO /BOFU/IF_FBI_ENTITY_COLLECTION.
  data: ls_object_key type /BOFU/CL_FBI_GUIBB_BASE=>TS_OBJECT_KEY.
  CREATE OBJECT lo_entity_coll TYPE /bofu/cl_fbi_entity_collection.
  CLEAR: li_root_key.
  ls_root_key-key = ms_data-key.
  INSERT ls_root_key INTO TABLE li_root_key.
  lo_entity_coll->set_self_keys(
    EXPORTING
      it_keys = li_root_key ).
  lo_entity_coll->set_source_conf_keys( ms_object_key ).
  ro_data ?= lo_entity_coll.    

method IF_FPM_FEEDER_MODEL~GET_NAMESPACE.
    rv_namespace = 'FBI'.

method IF_FPM_GUIBB_FORM~FLUSH.
  DATA: ls_change_log TYPE fpmgb_s_changelog.
  FIELD-SYMBOLS: <fs_id>  TYPE /BOBF/DEMO_CUSTOMER_ID.
  READ TABLE it_change_log INTO ls_change_log
  WITH KEY name = 'CUSTOMER_ID'.                            "#EC WARNOK
  IF sy-subrc = 0.
    ASSIGN ls_change_log-new_value->* TO <fs_id>.
    ms_data-customer_id = <fs_id>.
  ENDIF.

method IF_FPM_GUIBB_FORM~PROCESS_EVENT.
  data: lo_srv_mgr                  TYPE REF TO /bobf/if_tra_service_manager.
  data: lt_key_index                type /BOBF/T_FRW_KEYINDEX.
  data: ls_key_index                type /bobf/s_frw_keyindex.
  data: lt_customer_id              type STANDARD TABLE OF /BOBF/DEMO_CUSTOMER_ID.
  data: lr_customer                 TYPE REF TO /BOBF/S_DEMO_CUSTOMER_HDR_K.
  data: lt_key                      type /bobf/t_frw_key.
  data: ls_key                      type /bobf/s_frw_key.
  DATA: lo_fpm                      TYPE REF TO if_fpm,
        lo_event_data               TYPE REF TO cl_fpm_parameter,
        lo_event                    TYPE REF TO cl_fpm_event.
  DATA: ls_message                  TYPE fpmgb_s_t100_message,
        lv_new_key                  TYPE /bobf/conf_key,
        lt_mod                      TYPE /bobf/t_frw_modification,
        ls_mod                      TYPE /bobf/s_frw_modification.
  data: lo_change                   TYPE REF TO /bobf/if_tra_change,
        lo_message                  TYPE REF TO /bobf/if_frw_message.
  if mo_controller is initial.
    mo_controller ?= /bofu/cl_fbi_controller_base=>get_instance( ).
  endif.
  CASE io_event->mv_event_id.
    WHEN if_fpm_constants=>gc_event-leave_initial_screen.
      append ms_data-customer_id to lt_customer_id.
      lo_srv_mgr = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( /BOBF/IF_DEMO_CUSTOMER_C=>sc_bo_key ).
      lo_srv_mgr->CONVERT_ALTERN_KEY(
        exporting
          IV_NODE_KEY          =  /BOBF/IF_DEMO_CUSTOMER_C=>sc_node-root
          IV_ALTKEY_KEY        =  /BOBF/IF_DEMO_CUSTOMER_C=>SC_ALTERNATIVE_KEY-root-CUSTOMER_ID
*           IV_TARGET_ALTKEY_KEY = /BOBF/IF_FRW_C=>SC_ALTERNATIVE_KEY_KEY    " Alternative Key
          IT_KEY               =  lt_customer_id
*           IV_CHECK_EXISTENCE   = ABAP_FALSE    " Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')
*           IV_BEFORE_IMAGE      = ABAP_FALSE    " Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')
           IV_INVALIDATE_CACHE  = ABAP_true    " Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')
        importing
           EO_CHANGE            = lo_change    " Interface for transaction change objects
          ET_RESULT            =   lt_key_index
*           ET_KEY               =
      ).
      IF lo_change->has_failed_changes( ) IS not INITIAL or lt_key_index is INITIAL.
        MESSAGE e001(YHENG_MESSAGE) INTO ls_message-plaintext.
        ls_message-severity = if_fpm_message_manager=>gc_severity_error.
        APPEND ls_message TO et_messages.
        ev_result = if_fpm_constants=>gc_event_result-failed.
        RETURN.
      ENDIF.
      loop at lt_key_index into ls_key_index.
*         ls_key-key = ls_key_index-KEY.
        ms_data-KEY = ls_key_index-key.
*         append ls_key to lt_key.
      ENDLOOP.
      lo_fpm ?= cl_fpm_factory=>get_instance( ).
      lo_fpm->mo_app_parameter->set_value(
        EXPORTING
          iv_key    = /bofu/if_fbi_runtime_c=>sc_application_parameters-change_mode
          iv_value  = mv_mode ).
      clear: lt_key.
      ls_key-key = ms_data-key.
      append ls_key to lt_key.
    WHEN OTHERS.
  ENDCASE.

method IF_FPM_GUIBB_FORM~GET_DATA.
  DATA: lo_event    TYPE REF TO cl_fpm_event,
        lo_fpm      type ref to if_fpm.
  if lo_fpm is initial.
    lo_fpm ?= cl_fpm=>get_instance( ).
  endif.
  IF  io_event->mv_event_id = cl_fpm_event=>GC_EVENT_CHANGE_CONTENT_AREA.
    ev_data_changed = abap_true.
    if lo_fpm is NOT INITIAL.
      lo_event = cl_fpm_event=>CREATE_BY_ID( cl_fpm_event=>GC_EVENT_REFRESH ).
      lo_fpm->raise_event( lo_event ).
    endif.
  endif.

method IF_FPM_GUIBB_FORM~GET_DEFINITION.
  eo_field_catalog ?= cl_abap_typedescr=>describe_by_name( '/BOBF/S_DEMO_CUSTOMER_HDR_K' ).

method IF_FPM_GUIBB~INITIALIZE.
  DATA: lo_event    TYPE REF TO cl_fpm_event,
        lo_fpm      type ref to if_fpm.
  ms_object_key-bo = /BOBF/IF_DEMO_CUSTOMER_C=>sc_bo_key.
  ms_object_key-node = /BOBF/IF_DEMO_CUSTOMER_C=>sc_node-root.
  if lo_fpm is initial.
    lo_fpm ?= cl_fpm=>get_instance( ).
  endif.
  IF lo_fpm is BOUND.
    lo_fpm->mo_app_parameter->get_value(
      EXPORTING
        iv_key    = /bofu/if_fbi_runtime_c=>sc_application_parameters-change_mode
      IMPORTING
        ev_value  = mv_mode ).
    if mo_controller is initial.
      mo_controller ?= /bofu/cl_fbi_controller_base=>get_instance( ).
      mo_controller->/bofu/if_fbi_controller~set_object_key( ms_object_key ).
      mo_controller->/bofu/if_fbi_controller~build_node_buffer(
          EXPORTING
            iv_bo_key     = /BOBF/IF_DEMO_CUSTOMER_C=>sc_bo_key
            iv_node_key   = /BOBF/IF_DEMO_CUSTOMER_C=>sc_node-root ).
    endif.
  endif.

Build viewexit class for FBI view

創(chuàng)建Viewexit class见秽,引入接口



引入Attribute



實(shí)現(xiàn)相應(yīng)的方法
method /BOFU/IF_FBI_VIEW_EXITINTF_RUN~ADAPT_EVENT.
  DATA: lo_srvmgr                   TYPE REF TO /bofu/if_fbi_controller=>ts_bo_srvmgr_map,
        lo_fpm                      TYPE REF TO if_fpm,
        lo_event_data               TYPE REF TO cl_fpm_parameter,
        lo_event                    TYPE REF TO cl_fpm_event.
  IF NOT mo_controller IS BOUND.
    mo_controller ?= /bofu/cl_fbi_controller_base=>get_instance( ).
  ENDIF.
  READ TABLE mo_controller->/bofu/if_fbi_controller~mt_bo_srvmgr_map REFERENCE INTO lo_srvmgr
      WITH TABLE KEY bo_key = iv_bo_key.
  case iv_eventid.
    WHEN 'BACK'.
      lo_fpm ?= cl_fpm_factory=>get_instance( ).
      lo_event = cl_fpm_event=>CREATE_BY_ID( iv_event_id = cl_fpm_event=>GC_EVENT_CHANGE_CONTENT_AREA ).
      lo_event->mo_event_data->set_value(
        iv_key = cl_fpm_event=>gc_event_param_trgt_cont_area
        iv_value = 'PAGE_INITIAL' ).
      lo_fpm->RAISE_EVENT( io_event = lo_event ).
    when OTHERS.
  ENDCASE.

Create a web dynpro application

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市蔓肯,隨后出現(xiàn)的幾起案子振乏,更是在濱河造成了極大的恐慌,老刑警劉巖调限,帶你破解...
    沈念sama閱讀 206,839評(píng)論 6 482
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件旧噪,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡宦赠,警方通過(guò)查閱死者的電腦和手機(jī)米母,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 88,543評(píng)論 2 382
  • 文/潘曉璐 我一進(jìn)店門(mén)妙色,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)慧耍,“玉大人,你說(shuō)我怎么就攤上這事煌珊∶诙梗” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 153,116評(píng)論 0 344
  • 文/不壞的土叔 我叫張陵蔬浙,是天一觀的道長(zhǎng)畴博。 經(jīng)常有香客問(wèn)我兴革,道長(zhǎng),這世上最難降的妖魔是什么庶艾? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 55,371評(píng)論 1 279
  • 正文 為了忘掉前任咱揍,我火速辦了婚禮煤裙,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘且蓬。我一直安慰自己题翰,他們只是感情好恶阴,可當(dāng)我...
    茶點(diǎn)故事閱讀 64,384評(píng)論 5 374
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著豹障,像睡著了一般冯事。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上血公,一...
    開(kāi)封第一講書(shū)人閱讀 49,111評(píng)論 1 285
  • 那天昵仅,我揣著相機(jī)與錄音,去河邊找鬼累魔。 笑死摔笤,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的垦写。 我是一名探鬼主播籍茧,決...
    沈念sama閱讀 38,416評(píng)論 3 400
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了晚伙?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 37,053評(píng)論 0 259
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎迅皇,沒(méi)想到半個(gè)月后登颓,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體咕痛,經(jīng)...
    沈念sama閱讀 43,558評(píng)論 1 300
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,007評(píng)論 2 325
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片俗壹。...
    茶點(diǎn)故事閱讀 38,117評(píng)論 1 334
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖坤检,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情箭跳,我是刑警寧澤谱姓,帶...
    沈念sama閱讀 33,756評(píng)論 4 324
  • 正文 年R本政府宣布茄靠,位于F島的核電站嘹黔,受9級(jí)特大地震影響郭蕉,放射性物質(zhì)發(fā)生泄漏召锈。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,324評(píng)論 3 307
  • 文/蒙蒙 一梢薪、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧琐馆,春花似錦、人聲如沸滋饲。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 30,315評(píng)論 0 19
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)郭卫。三九已至贰军,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間许饿,已是汗流浹背陋率。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 31,539評(píng)論 1 262
  • 我被黑心中介騙來(lái)泰國(guó)打工菩浙, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留芍耘,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 45,578評(píng)論 2 355
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親拗小。 傳聞我的和親對(duì)象是個(gè)殘疾皇子哀九,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 42,877評(píng)論 2 345

推薦閱讀更多精彩內(nèi)容

  • Spring Cloud為開(kāi)發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見(jiàn)模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn)年扩,斷路器,智...
    卡卡羅2017閱讀 134,600評(píng)論 18 139
  • 1. Java基礎(chǔ)部分 基礎(chǔ)部分的順序:基本語(yǔ)法圈匆,類(lèi)相關(guān)的語(yǔ)法笆搓,內(nèi)部類(lèi)的語(yǔ)法,繼承相關(guān)的語(yǔ)法,異常的語(yǔ)法汁雷,線程的語(yǔ)...
    子非魚(yú)_t_閱讀 31,587評(píng)論 18 399
  • 今天老家一個(gè)親戚過(guò)生日厢漩,我們年前的返鄉(xiāng)進(jìn)程提前了宵膨。車(chē)子在七拐八彎的羊腸小道上緩慢前行焙压,路邊筆直的桉樹(shù),蓬蓬松松的柏...
    黃小麗的私人訂制閱讀 422評(píng)論 0 6
  • 代碼我用自己寫(xiě)的demo代碼拨黔,效果是我的項(xiàng)目效果 ShareController.m中 效果圖徽曲,項(xiàng)目的效果圖
    我的夢(mèng)想之路閱讀 701評(píng)論 2 0
  • 你說(shuō):我做了一個(gè)不該做的夢(mèng)弧哎,很悲傷; 我說(shuō):我被人扔了無(wú)數(shù)的炮彈非洲,滿地血。
    櫻黎閱讀 109評(píng)論 0 0