RERCS系统-WDA+BOPF框架实战例子 PART 3-Feeder Class 方法处理与解释

本文主要是介绍RERCS系统-WDA+BOPF框架实战例子 PART 3-Feeder Class 方法处理与解释,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

涉及到的相关类:1)List UIBB对应的Feeder Class 2)BOPF对应的Determination的实施类

1、SE24把新建的Feeder Class类进行主要处理,List UIBB的Feeder Class参照超类:/BOFU/CL_FBI_GUIBB_LIST;
在这里插入图片描述
接口页签自动带出继承的接口,方法页签自动带出继承的方法;
在这里插入图片描述在这里插入图片描述
对应Feeder Class几个方法的说明:
1)IF_FPM_GUIBB~INITIALIZE:初始化页面数据,获取服务前端页面数据。

  METHOD IF_FPM_GUIBB~INITIALIZE.CALL METHOD SUPER->IF_FPM_GUIBB~INITIALIZEEXPORTINGIT_PARAMETER      = IT_PARAMETERIO_APP_PARAMETER  = IO_APP_PARAMETERIV_COMPONENT_NAME = IV_COMPONENT_NAMEIS_CONFIG_KEY     = IS_CONFIG_KEYIV_INSTANCE_ID    = IV_INSTANCE_ID.MO_FPM ?= CL_FPM_FACTORY=>GET_INSTANCE( ).ENDMETHOD.

2)IF_FPM_GUIBB_LIST~PROCESS_EVENT:页面按钮等触发型的动作事件。

  METHOD IF_FPM_GUIBB_LIST~PROCESS_EVENT.
*CALL METHOD SUPER->IF_FPM_GUIBB_LIST~PROCESS_EVENT
*  EXPORTING
*    IO_EVENT            = IO_EVENT
**    IV_RAISED_BY_OWN_UI = IV_RAISED_BY_OWN_UI
*    IV_LEAD_INDEX       = IV_LEAD_INDEX
*    IV_EVENT_INDEX      = IV_EVENT_INDEX
*    IT_SELECTED_LINES   = IT_SELECTED_LINES
**    IO_UI_INFO          = IO_UI_INFO
**  IMPORTING
**    EV_RESULT           = EV_RESULT
**    ET_MESSAGES         = ET_MESSAGES
*    .DATA:LO_ENTITY_COLLECTION TYPE REF TO  /BOFU/IF_FBI_ENTITY_COLLECTION,LS_SELECTED_LINE     LIKE LINE OF IT_SELECTED_LINES,LT_SELECTED_LINES    LIKE         IT_SELECTED_LINES,LR_TABLE_DESCR       TYPE REF TO  CL_ABAP_TABLEDESCR,LR_DATA_DESCR        TYPE REF TO  CL_ABAP_DATADESCR,LV_TAB_KEYS          TYPE         ABAP_TABLE_KEYDESCR_TAB,LR_DATA_STRUC        TYPE REF TO  DATA,LR_VALUE             TYPE REF TO  DATA,LT_KEYS              TYPE         /BOBF/T_FRW_KEY.FIELD-SYMBOLS:<FT_DATA> TYPE INDEX TABLE,<FS_DATA> TYPE              DATA,<FV_KEY>  TYPE              /BOBF/CONF_KEY.LR_TABLE_DESCR ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA_REF( P_DATA_REF = MT_DATA ).LR_DATA_DESCR = LR_TABLE_DESCR->GET_TABLE_LINE_TYPE( ).CREATE DATA LR_DATA_STRUC TYPE HANDLE LR_DATA_DESCR.ASSIGN LR_DATA_STRUC->* TO <FS_DATA>.ASSIGN MT_DATA->* TO <FT_DATA>.IF IO_EVENT->MV_EVENT_ID EQ CL_FPM_EVENT=>GC_EVENT_LEAVE_INITIAL_SCREEN.
*      fill_select_line_on_leave_scrn(
*        EXPORTING
*          io_event      =   io_event  " CL_FPM_EVENT
*          iv_lead_index =   iv_lead_index  " Index of Internal Tables
*      ).ENDIF.IO_EVENT->MO_EVENT_DATA->GET_VALUE(EXPORTINGIV_KEY   = /BOFU/IF_FBI_RUNTIME_C=>SC_EVENT_PARAMETERS-COMMON_PARAMS-ACT_CONF_KEYIMPORTINGER_VALUE = LR_VALUE ).
*The action is a BO actionIF  LR_VALUE IS NOT INITIAL.
*Filter out the rows that correspond to empty keysLOOP AT IT_SELECTED_LINES INTO LS_SELECTED_LINE.READ TABLE <FT_DATA> INTO <FS_DATA> INDEX LS_SELECTED_LINE-TABIX.ASSIGN COMPONENT 'KEY' OF STRUCTURE <FS_DATA> TO <FV_KEY>.READ TABLE MT_EMPTY_KEYS WITH TABLE KEY KEY = <FV_KEY> TRANSPORTING NO FIELDS.IF SY-SUBRC <> 0.INSERT LS_SELECTED_LINE INTO TABLE LT_SELECTED_LINES.ENDIF.ENDLOOP.
*      mv_is_filtered = abap_true.PROCESS_EVENT(EXPORTINGIO_EVENT            = IO_EVENTIV_RAISED_BY_OWN_UI = IV_RAISED_BY_OWN_UIIT_SELECTED_LINES   = LT_SELECTED_LINESIT_DATA             = MT_DATAIMPORTINGEV_RESULT           = EV_RESULT).ELSE.
*      mv_is_filtered = abap_false.PROCESS_EVENT(EXPORTINGIO_EVENT            = IO_EVENTIV_RAISED_BY_OWN_UI = IV_RAISED_BY_OWN_UIIT_SELECTED_LINES   = IT_SELECTED_LINESIT_DATA             = MT_DATAIMPORTINGEV_RESULT           = EV_RESULT).ENDIF.
* Return messages
*--------------------------------------------------------------------*
* Messages dispatched in process event doesn't get highlightedIF MS_DEFAULTS-MSGS_IN_PE = ABAP_TRUE.GET_MESSAGES(EXPORTINGIT_DATA     = MT_DATAIMPORTINGET_MESSAGES = ET_MESSAGES).ENDIF.*    DATA: LV_AMT      TYPE /RER/AMT,
*          LS_TAX      TYPE /RER/S_BO_CONT_TAX_C,
*          LS_MESSAGES TYPE FPMGB_S_T100_MESSAGE.CASE IO_EVENT->MV_EVENT_ID.WHEN 'FPM_SAVE'.
*        IF <ft_data> IS NOT INITIAL.
*          CLEAR lv_amt.
*          LOOP AT <ft_data> ASSIGNING <fs_data>.
*            MOVE-CORRESPONDING <fs_data> TO ls_tax.
*            lv_amt = lv_amt + ls_tax-amt_intax.
*          ENDLOOP.
*
*          IF lv_amt <> /rer/cl_cont_toolbar=>ms_root-conamt.
*            ls_messages-msgid = '/RER/CO'.
*            ls_messages-msgno = '449'.
*            ls_messages-severity = 'W'.
*            APPEND ls_messages TO et_messages.
*            IF 1 = 2.
*              MESSAGE s449(yrre_co).
*            ENDIF.
*          ENDIF.
*        ENDIF.ENDCASE.ENDMETHOD.

3)IF_FPM_GUIBB_LIST~GET_DATA:获取数据,此处触发bopf去获取数据库表数据。

  METHOD IF_FPM_GUIBB_LIST~GET_DATA.GET_DATA(EXPORTINGIV_EVENTID                = IV_EVENTID    " ID of the FPM EventIT_SELECTED_FIELDS        = IT_SELECTED_FIELDS    " Selected(Used) FieldsIV_RAISED_BY_OWN_UI       = IV_RAISED_BY_OWN_UI    " Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')IV_VISIBLE_ROWS           = IV_VISIBLE_ROWSIV_EDIT_MODE              = IV_EDIT_MODE    " FPM: Edit ModeIO_EXTENDED_CTRL          = IO_EXTENDED_CTRL    " Provides extended List ATS specific configuration optionsIMPORTINGET_MESSAGES               = ET_MESSAGES    " FPMGB Messages (T100 & Plaintext)EV_DATA_CHANGED           = EV_DATA_CHANGED    " Boolean Variable (X=True, -=False, Space=Unknown)EV_FIELD_USAGE_CHANGED    = EV_FIELD_USAGE_CHANGED    " Boolean Variable (X=True, -=False, Space=Unknown)EV_ACTION_USAGE_CHANGED   = EV_ACTION_USAGE_CHANGED    " Boolean Variable (X=True, -=False, Space=Unknown)EV_SELECTED_LINES_CHANGED = EV_SELECTED_LINES_CHANGED    " Boolean Variable (X=True, -=False, Space=Unknown)EV_DND_ATTR_CHANGED       = EV_DND_ATTR_CHANGED    " Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')EO_ITAB_CHANGE_LOG        = EO_ITAB_CHANGE_LOG    " Change log for internal tablesCHANGINGCT_DATA                   = CT_DATACT_FIELD_USAGE            = CT_FIELD_USAGE    " Field UsageCT_ACTION_USAGE           = CT_ACTION_USAGE    " Action DefinitionCT_SELECTED_LINES         = CT_SELECTED_LINES    " Repository Infosystem: TabixCV_LEAD_INDEX             = CV_LEAD_INDEX    " Index of Internal TablesCV_FIRST_VISIBLE_ROW      = CV_FIRST_VISIBLE_ROWCS_ADDITIONAL_INFO        = CS_ADDITIONAL_INFO    " Additinal info on the GUIBB tableCT_DND_ATTRIBUTES         = CT_DND_ATTRIBUTES    " Drag and Drop Attributes Definition).DATA: LO_FPM     TYPE REF TO IF_FPM,LO_SRV_MGR TYPE REF TO /BOBF/IF_TRA_SERVICE_MANAGER,LO_MESSAGE TYPE REF TO /BOBF/IF_FRW_MESSAGE,LO_CHANGE  TYPE REF TO /BOBF/IF_TRA_CHANGE.DATA: LT_MODIFY     TYPE /BOBF/T_FRW_MODIFICATION,LS_MODIFY     TYPE /BOBF/S_FRW_MODIFICATION,LT_KEY        TYPE /BOBF/T_FRW_KEY,LS_KEY        TYPE /BOBF/S_FRW_KEY,LV_UG_REF_KEY TYPE /BOBF/CONF_KEY,LV_XMJD       TYPE ZRRE_XMJD,LT_MESSAGE    TYPE /BOBF/T_FRW_MESSAGE_K,LS_MESSAGE    TYPE /BOBF/S_FRW_MESSAGE_K.FIELD-SYMBOLS:<FS_LHTDW> TYPE ZRRE_S_GCLX_LHTDW.DATA:LT_LHTDW TYPE ZRRE_T_GCLX_LHTDW,LR_LHTDW TYPE REF TO DATA.DATA:LT_SORT TYPE ABAP_SORTORDER_TAB.DATA: LV_CHANGE_MODE TYPE    CHAR1,LV_IS_JGC      TYPE CHAR1.FIELD-SYMBOLS: <FT_DATA> TYPE STANDARD TABLE,<FS_KEY>  TYPE /BOBF/CONF_KEY,<FS_DATA> TYPE ANY.ASSIGN CT_DATA TO <FT_DATA>."列表数据存至临时动态内表 <FT_DATA>MOVE-CORRESPONDING ZRRE_CL_FD_PROJ_ROOT=>MS_ROOT TO MS_ROOT.LO_FPM     ?= CL_FPM_FACTORY=>GET_INSTANCE( ).LO_SRV_MGR = /BOBF/CL_TRA_SERV_MGR_FACTORY=>GET_SERVICE_MANAGER( ZRRE_IF_PROJ_CONSTANTS=>SC_BO_KEY ).CALL METHOD LO_FPM->MO_APP_PARAMETER->GET_VALUEEXPORTINGIV_KEY   = 'XMJD'IMPORTINGEV_VALUE = LV_XMJD.CASE IV_EVENTID->MV_EVENT_ID.WHEN  CL_FPM_EVENT=>GC_EVENT_LEAVE_INITIAL_SCREEN.IF LV_XMJD = '05' AND IV_EDIT_MODE = 'E'."工程立项-调整CALL METHOD LO_FPM->MO_APP_PARAMETER->GET_VALUEEXPORTINGIV_KEY   = 'XM_UG_REF_KEY'IMPORTINGEV_VALUE = LV_UG_REF_KEY. "原工程立项的DB_KEYAPPEND VALUE #( KEY = LV_UG_REF_KEY ) TO LT_KEY.CALL METHOD LO_SRV_MGR->RETRIEVE_BY_ASSOCIATIONEXPORTINGIV_NODE_KEY    = ZRRE_IF_PROJ_CONSTANTS=>SC_NODE-ROOTIT_KEY         = LT_KEYIV_ASSOCIATION = ZRRE_IF_PROJ_CONSTANTS=>SC_ASSOCIATION-ROOT-GCLX_LHTDWIV_FILL_DATA   = ABAP_TRUEIMPORTINGET_DATA        = LT_LHTDW.CLEAR:LT_MODIFY.IF LT_LHTDW IS NOT INITIAL AND <FT_DATA> IS INITIAL.LOOP AT LT_LHTDW INTO DATA(LS_LHTDW).CREATE DATA LR_LHTDW TYPE ZRRE_S_GCLX_LHTDW.ASSIGN LR_LHTDW->* TO <FS_LHTDW>.<FS_LHTDW>-KEY = /BOBF/CL_FRW_FACTORY=>GET_NEW_KEY( ).<FS_LHTDW>-ROOT_KEY = MS_ROOT-KEY.<FS_LHTDW>-PARENT_KEY = MS_ROOT-KEY.<FS_LHTDW>-ZLHTDW_ID = LS_LHTDW-ZLHTDW_ID.<FS_LHTDW>-ZLHTDW_NAME = LS_LHTDW-ZLHTDW_NAME.<FS_LHTDW>-ZNOTE = LS_LHTDW-ZNOTE.<FS_LHTDW>-CREA_UNAME = LS_LHTDW-CREA_UNAME.<FS_LHTDW>-CREA_DATE = LS_LHTDW-CREA_DATE.<FS_LHTDW>-CREA_TIME = LS_LHTDW-CREA_TIME.<FS_LHTDW>-UPDATE_UNAME = LS_LHTDW-UPDATE_UNAME.<FS_LHTDW>-UPDATE_DATE = LS_LHTDW-UPDATE_DATE.<FS_LHTDW>-UPDATE_TIME = LS_LHTDW-UPDATE_TIME.APPEND <FS_LHTDW> TO <FT_DATA>.LS_MODIFY-KEY = <FS_LHTDW>-KEY.LS_MODIFY-NODE = ZRRE_IF_PROJ_CONSTANTS=>SC_NODE-GCLX_LHTDW.LS_MODIFY-CHANGE_MODE = /BOBF/IF_FRW_C=>SC_MODIFY_CREATE.LS_MODIFY-ROOT_KEY = <FS_LHTDW>-PARENT_KEY.LS_MODIFY-SOURCE_KEY = <FS_LHTDW>-PARENT_KEY.LS_MODIFY-SOURCE_NODE = ZRRE_IF_PROJ_CONSTANTS=>SC_NODE-ROOT.LS_MODIFY-ASSOCIATION = ZRRE_IF_PROJ_CONSTANTS=>SC_ASSOCIATION-ROOT-GCLX_LHTDW.LS_MODIFY-DATA = LR_LHTDW.APPEND LS_MODIFY TO LT_MODIFY.CLEAR LS_MODIFY.ENDLOOP.CALL METHOD LO_SRV_MGR->MODIFYEXPORTINGIT_MODIFICATION = LT_MODIFYIMPORTINGEO_MESSAGE      = LO_MESSAGEEO_CHANGE       = LO_CHANGE.IF LO_MESSAGE->CHECK( ) = ABAP_TRUE.LO_MESSAGE->GET_MESSAGES( IMPORTING ET_MESSAGE = LT_MESSAGE ).LOOP AT LT_MESSAGE INTO LS_MESSAGE.LO_FPM->MO_MESSAGE_MANAGER->REPORT_OBJECT_MESSAGE(EXPORTINGIR_MESSAGE_OBJECT = LS_MESSAGE-MESSAGEIO_COMPONENT = LO_FPM->MO_MESSAGE_MANAGER).ENDLOOP.ELSE.MO_CONTROLLER->POST_SYNCUP_DATA( IV_BO_KEY  = ZRRE_IF_PROJ_CONSTANTS=>SC_BO_KEY IO_CHANGE  = LO_CHANGE ).ENDIF.ENDIF.ENDIF.ENDCASE."因为BOPF的Determination 数据重更新,此处对<FT_DATA> 做去重处理LT_SORT = VALUE #(( NAME = 'KEY' DESCENDING = '' ) ).SORT <FT_DATA> BY (LT_SORT)."动态内表按指定字段排序"删除连续重复项DELETE ADJACENT DUPLICATES FROM <FT_DATA>.UPDATE_FIELD_STATUS( EXPORTING IV_EDIT_MODE = IV_EDIT_MODECHANGING CT_DATA  = CT_DATACT_FIELD_USAGE = CT_FIELD_USAGECT_ACTION_USAGE = CT_ACTION_USAGE ).*---Shared dictionary---------------------------------------------DATA: LV_CONFIG_ID TYPE        WDY_CONFIG_ID,LO_DIC       TYPE REF TO /RER/CL_SHARED_DIC.IF LO_FPM IS INITIAL.LO_FPM ?= CL_FPM_FACTORY=>GET_INSTANCE( ).ENDIF.IF LO_FPM IS NOT INITIAL.CALL METHOD LO_FPM->MO_APP_PARAMETER->GET_VALUEEXPORTINGIV_KEY   = /RER/IF_CCM_CONSTANTS=>GC_WD_CONFIGID  "'SAP-WD-CONFIGID'IMPORTINGEV_VALUE = LV_CONFIG_ID.CREATE OBJECT LO_DIC EXPORTING IV_CONFIG_ID = LV_CONFIG_ID .IF LO_DIC IS NOT INITIAL.CALL METHOD LO_DIC->CHG_USGIMPORTINGEV_FIELD_USAGE_CHANGED  = EV_FIELD_USAGE_CHANGEDEV_ACTION_USAGE_CHANGED = EV_ACTION_USAGE_CHANGEDCHANGINGCT_ACTION_USAGE         = CT_ACTION_USAGE
*           ct_row_act              =CT_FIELD_USAGE          = CT_FIELD_USAGE.ENDIF.ENDIF.
*-----------------------------------------------------------EV_DATA_CHANGED = ABAP_TRUE.EV_FIELD_USAGE_CHANGED = ABAP_TRUE.EV_ACTION_USAGE_CHANGED = ABAP_TRUE.ENDMETHOD.

4)IF_FPM_GUIBB_LIST~GET_DEFINITION:此方法针对字段属性进行控制,例如必输、只读、隐藏、搜索帮助等设置。

  METHOD IF_FPM_GUIBB_LIST~GET_DEFINITION.DATA: LV_CONFIG_ID TYPE        WDY_CONFIG_ID,LO_DIC       TYPE REF TO /RER/CL_SHARED_DIC.DATA: LO_FPM TYPE REF TO IF_FPM.DATA: LS_ACTION_DEF   TYPE FPMGB_S_ACTIONDEF.CALL METHOD SUPER->IF_FPM_GUIBB_LIST~GET_DEFINITIONIMPORTINGEO_FIELD_CATALOG         = EO_FIELD_CATALOGET_FIELD_DESCRIPTION     = ET_FIELD_DESCRIPTIONET_ACTION_DEFINITION     = ET_ACTION_DEFINITIONET_SPECIAL_GROUPS        = ET_SPECIAL_GROUPSES_MESSAGE               = ES_MESSAGEEV_ADDITIONAL_ERROR_INFO = EV_ADDITIONAL_ERROR_INFOET_DND_DEFINITION        = ET_DND_DEFINITIONET_ROW_ACTIONS           = ET_ROW_ACTIONSES_OPTIONS               = ES_OPTIONS.*    CLEAR LS_ACTION_DEF.
*    LS_ACTION_DEF-ID = GC_LIFNR_ENTERED. "'LIFNR_ENTERED'.
*    LS_ACTION_DEF-ACTION_TYPE = IF_FPM_CONSTANTS=>GC_ACTION_TYPE-VALIDATION_INDEPENDENT.
*    LS_ACTION_DEF-ENABLED = ABAP_TRUE.
*    LS_ACTION_DEF-IS_IMPLICIT_EDIT = ABAP_TRUE.
*    INSERT LS_ACTION_DEF INTO TABLE ET_ACTION_DEFINITION.IF LO_FPM IS INITIAL.LO_FPM ?= CL_FPM_FACTORY=>GET_INSTANCE( ).ENDIF.IF LO_FPM IS NOT INITIAL.CALL METHOD LO_FPM->MO_APP_PARAMETER->GET_VALUEEXPORTINGIV_KEY   = /RER/IF_CCM_CONSTANTS=>GC_WD_CONFIGID  "'SAP-WD-CONFIGID'IMPORTINGEV_VALUE = LV_CONFIG_ID.CREATE OBJECT LO_DIC EXPORTING IV_CONFIG_ID = LV_CONFIG_ID.IF LO_DIC IS NOT INITIAL.CALL METHOD LO_DIC->CHG_DEFCHANGINGCT_ACT      = ET_ACTION_DEFINITIONCT_LIST_FLD = ET_FIELD_DESCRIPTION.ENDIF.ENDIF.ENDMETHOD.

此处例子是增强实施实现字段的搜索帮助:

  METHOD IPO_ZRRE_EHI_GCLX_LHTDW~GET_DEFINITION.
*"------------------------------------------------------------------------*
*" Declaration of POST-method, do not insert any comments here please!
*"
*"methods GET_DEFINITION
*"  changing
*"    value(EO_FIELD_CATALOG) type ref to CL_ABAP_TABLEDESCR
*"    !ET_FIELD_DESCRIPTION type FPMGB_T_LISTFIELD_DESCR
*"    !ET_ACTION_DEFINITION type FPMGB_T_ACTIONDEF
*"    !ET_SPECIAL_GROUPS type FPMGB_T_SPECIAL_GROUPS
*"    !ES_MESSAGE type FPMGB_S_T100_MESSAGE
*"    !EV_ADDITIONAL_ERROR_INFO type DOKU_OBJ
*"    !ET_DND_DEFINITION type FPMGB_T_DND_DEFINITION
*"    !ET_ROW_ACTIONS type FPMGB_T_ROW_ACTION
*"    !ES_OPTIONS type FPMGB_S_LIST_OPTIONS .
*"------------------------------------------------------------------------*READ TABLE ET_FIELD_DESCRIPTION ASSIGNING FIELD-SYMBOL(<FS_FIELD_DESC>) WITH KEY NAME = 'ZLHTDW_ID'.IF SY-SUBRC = 0.<FS_FIELD_DESC>-DDIC_SHLP_NAME = 'ZRRE_H_VEND_04'.ENDIF.ENDMETHOD.

5)UPDATE_FIELD_STATUS:该方法为自定义方法,只要实现根据字段值实现对字段的属性控制,一般在get_data方法中调用。

  METHOD IOW_ZRRE_EHI_GCLX_LHTDW~UPDATE_FIELD_STATUS.
*"------------------------------------------------------------------------*
*" Declaration of Overwrite-method, do not insert any comments here please!
*"
*"methods UPDATE_FIELD_STATUS
*"  importing
*"    !IV_EDIT_MODE type FPM_EDIT_MODE optional
*"  changing
*"    !CT_ACTION_USAGE type FPMGB_T_ACTIONUSAGE optional
*"    !CT_DATA type DATA optional
*"    !CT_FIELD_USAGE type FPMGB_T_FIELDUSAGE optional .
*"------------------------------------------------------------------------*FIELD-SYMBOLS <FS_FIELD> TYPE FPMGB_S_FIELDUSAGE.FIELD-SYMBOLS: <FT_DATA> TYPE STANDARD TABLE,<FS_DATA> TYPE ANY.FIELD-SYMBOLS: <FS_FIELD_DESC>   TYPE FPMGB_S_TREEFIELD_DESCR,<FS_ACTION_USAGE> TYPE FPMGB_S_ACTIONUSAGE.FIELD-SYMBOLS:<FV_FIELD>    TYPE ANY,<FV_VALUE>    TYPE ANY,<FV_TAX_TYPE> TYPE ANY.DATA: LS_ROOT TYPE ZRRE_S_XMTT.MOVE-CORRESPONDING ZRRE_CL_FD_PROJ_GCLX=>MS_ROOT TO LS_ROOT.ASSIGN CT_DATA TO <FT_DATA>.IF IV_EDIT_MODE = 'E'. "AND LS_ROOT-XMJD <> '05'."工程立项-调整 不允许编辑联合体单位明细LOOP AT <FT_DATA> ASSIGNING <FS_DATA>.LOOP AT CT_FIELD_USAGE ASSIGNING <FS_FIELD>.     "#EC CI_NESTEDCASE <FS_FIELD>-NAME .WHEN  'ZLHTDW_NAME'.READ TABLE CORE_OBJECT->MT_FIELD_DESCRIPTION ASSIGNING <FS_FIELD_DESC> WITH KEY NAME = <FS_FIELD>-NAME.IF SY-SUBRC = 0.ASSIGN COMPONENT 'READ_ONLY_REF' OF STRUCTURE <FS_FIELD_DESC> TO <FV_FIELD>.ASSIGN COMPONENT <FV_FIELD> OF STRUCTURE <FS_DATA> TO <FV_VALUE>.<FV_VALUE> = ABAP_FALSE.ENDIF.ENDCASE.ENDLOOP.ENDLOOP.LOOP AT CT_ACTION_USAGE ASSIGNING <FS_ACTION_USAGE> WHERE ID = /RER/IF_CCM_CONSTANTS=>GC_EVENT-FBI_CREATE "'FBI_CREATE'OR ID = /RER/IF_CCM_CONSTANTS=>GC_EVENT-FBI_DELETE. "'FBI_DELETE' .<FS_ACTION_USAGE>-ENABLED = ABAP_TRUE.ENDLOOP.ELSE.LOOP AT <FT_DATA> ASSIGNING <FS_DATA>.LOOP AT CT_FIELD_USAGE ASSIGNING <FS_FIELD>.     "#EC CI_NESTEDREAD TABLE CORE_OBJECT->MT_FIELD_DESCRIPTION ASSIGNING <FS_FIELD_DESC> WITH KEY NAME = <FS_FIELD>-NAME.IF SY-SUBRC = 0.ASSIGN COMPONENT 'READ_ONLY_REF' OF STRUCTURE <FS_FIELD_DESC> TO <FV_FIELD>.ASSIGN COMPONENT <FV_FIELD> OF STRUCTURE <FS_DATA> TO <FV_VALUE>.<FV_VALUE> = ABAP_TRUE.ENDIF.ENDLOOP.ENDLOOP.LOOP AT CT_ACTION_USAGE ASSIGNING <FS_ACTION_USAGE> WHERE ID = /RER/IF_CCM_CONSTANTS=>GC_EVENT-FBI_CREATE "'FBI_CREATE'OR ID = /RER/IF_CCM_CONSTANTS=>GC_EVENT-FBI_DELETE. "'FBI_DELETE'.<FS_ACTION_USAGE>-ENABLED = ABAP_FALSE.ENDLOOP.ENDIF.ENDMETHOD.

2、bopf后端对应的Determination的类:ZRRE_EHI_LHTDW_PSTDET,此处主要实现页面修改过程中对数据的处理,例如:创建人、创建日期等字段的赋值,同时更新数据同步到前端页面,保证前后端数据的一致性。
1)类的参考:
在这里插入图片描述2)继承的接口:
在这里插入图片描述3)继承的方法:
在这里插入图片描述4)重写方法AFTER_MODIFICATION:保证修改页面过程中数据的同步更新。

  METHOD AFTER_MODIFICATION.
**TRY.
*CALL METHOD SUPER->AFTER_MODIFICATION
*  EXPORTING
*    IS_CTX        = IS_CTX
*    IT_KEY        = IT_KEY
*    IO_READ       = IO_READ
*    IO_MODIFY     = IO_MODIFY
**  IMPORTING
**    ET_FAILED_KEY = ET_FAILED_KEY
*    .
**  CATCH /RER/CX_FATAL.
**ENDTRY.SET_VALUE(EXPORTINGIS_CTX        = IS_CTXIT_KEY        = IT_KEYIO_READ       = IO_READIO_MODIFY     = IO_MODIFYIMPORTINGET_FAILED_KEY = ET_FAILED_KEY).ENDMETHOD.

5)自定义方法SET_VALUE的实现:

  METHOD SET_VALUE.DATA: LV_ALAND TYPE ALAND,LV_WAERS TYPE WAERS,LT_KEY   TYPE /BOBF/T_FRW_KEY,LS_KEY   TYPE /BOBF/S_FRW_KEY,LR_DATA  TYPE REF TO DATA,LR_ROOT  TYPE REF TO DATA,LV_COUNT TYPE I,LT_LHTDW TYPE ZRRE_T_GCLX_LHTDW,LT_ROOT  TYPE ZRRE_T_XMTT,LS_ROOT  TYPE ZRRE_S_XMTT.FIELD-SYMBOLS: <FS_LHTDW> TYPE ZRRE_S_GCLX_LHTDW,<FS_ROOT>  TYPE ZRRE_S_XMTT,<FV_FIELD> TYPE ANY,<FS_DATA>  TYPE ANY.CHECK IT_KEY IS NOT INITIAL.CALL METHOD IO_READ->RETRIEVEEXPORTINGIV_NODE       = IS_CTX-NODE_KEYIT_KEY        = IT_KEYIV_FILL_DATA  = ABAP_TRUEIMPORTINGET_DATA       = LT_LHTDWET_FAILED_KEY = ET_FAILED_KEY.CLEAR LT_KEY.LOOP AT LT_LHTDW ASSIGNING <FS_LHTDW>.LS_KEY-KEY = <FS_LHTDW>-PARENT_KEY.APPEND LS_KEY TO LT_KEY.ENDLOOP.SORT LT_KEY BY KEY.DELETE ADJACENT DUPLICATES FROM LT_KEY COMPARING KEY.IO_READ->RETRIEVE(EXPORTINGIV_NODE                 =  ZRRE_IF_PROJ_CONSTANTS=>SC_NODE-ROOTIT_KEY                  =  LT_KEYIV_FILL_DATA           = ABAP_TRUEIMPORTINGET_DATA                =  LT_ROOT).READ TABLE LT_ROOT ASSIGNING <FS_ROOT> INDEX 1."Calculate tax amountLOOP AT LT_LHTDW ASSIGNING <FS_LHTDW> .IF <FS_LHTDW>-ZLHTDW_ID IS NOT INITIAL.SELECT SINGLE BPNAMFROM ZRRE_D_BPINTO <FS_LHTDW>-ZLHTDW_NAMEWHERE BPTYP = '04'AND APPSTATUS = '40'AND ZXZT = '01'AND BPNUM =  <FS_LHTDW>-ZLHTDW_IDAND DELFLAG = ''.ENDIF.IF <FS_LHTDW>-CREA_UNAME IS INITIAL .<FS_LHTDW>-CREA_UNAME = SY-UNAME.ENDIF.IF <FS_LHTDW>-CREA_DATE IS INITIAL .<FS_LHTDW>-CREA_DATE = SY-DATUM.ENDIF.IF <FS_LHTDW>-CREA_TIME IS INITIAL .<FS_LHTDW>-CREA_TIME = SY-UZEIT.ENDIF.<FS_LHTDW>-UPDATE_UNAME = SY-UNAME.<FS_LHTDW>-UPDATE_DATE = SY-DATUM.<FS_LHTDW>-UPDATE_TIME = SY-UZEIT.GET REFERENCE OF <FS_LHTDW> INTO LR_DATA.IO_MODIFY->UPDATE( EXPORTING IV_NODE = IS_CTX-NODE_KEY IV_KEY = <FS_LHTDW>-KEY  IS_DATA = LR_DATA ).ENDLOOP.ENDMETHOD.

6)配置触发的Determination Configuration:由于前面是进行了AFTER_MODIFICATION方法的重写,此处需要配置对应的触发配置。
在这里插入图片描述

这篇关于RERCS系统-WDA+BOPF框架实战例子 PART 3-Feeder Class 方法处理与解释的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1027690

相关文章

如何使用celery进行异步处理和定时任务(django)

《如何使用celery进行异步处理和定时任务(django)》文章介绍了Celery的基本概念、安装方法、如何使用Celery进行异步任务处理以及如何设置定时任务,通过Celery,可以在Web应用中... 目录一、celery的作用二、安装celery三、使用celery 异步执行任务四、使用celery

JAVA中整型数组、字符串数组、整型数和字符串 的创建与转换的方法

《JAVA中整型数组、字符串数组、整型数和字符串的创建与转换的方法》本文介绍了Java中字符串、字符数组和整型数组的创建方法,以及它们之间的转换方法,还详细讲解了字符串中的一些常用方法,如index... 目录一、字符串、字符数组和整型数组的创建1、字符串的创建方法1.1 通过引用字符数组来创建字符串1.2

Java调用Python代码的几种方法小结

《Java调用Python代码的几种方法小结》Python语言有丰富的系统管理、数据处理、统计类软件包,因此从java应用中调用Python代码的需求很常见、实用,本文介绍几种方法从java调用Pyt... 目录引言Java core使用ProcessBuilder使用Java脚本引擎总结引言python

SpringBoot操作spark处理hdfs文件的操作方法

《SpringBoot操作spark处理hdfs文件的操作方法》本文介绍了如何使用SpringBoot操作Spark处理HDFS文件,包括导入依赖、配置Spark信息、编写Controller和Ser... 目录SpringBoot操作spark处理hdfs文件1、导入依赖2、配置spark信息3、cont

Apache Tomcat服务器版本号隐藏的几种方法

《ApacheTomcat服务器版本号隐藏的几种方法》本文主要介绍了ApacheTomcat服务器版本号隐藏的几种方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需... 目录1. 隐藏HTTP响应头中的Server信息编辑 server.XML 文件2. 修China编程改错误

Java中switch-case结构的使用方法举例详解

《Java中switch-case结构的使用方法举例详解》:本文主要介绍Java中switch-case结构使用的相关资料,switch-case结构是Java中处理多个分支条件的一种有效方式,它... 目录前言一、switch-case结构的基本语法二、使用示例三、注意事项四、总结前言对于Java初学者

Golang使用minio替代文件系统的实战教程

《Golang使用minio替代文件系统的实战教程》本文讨论项目开发中直接文件系统的限制或不足,接着介绍Minio对象存储的优势,同时给出Golang的实际示例代码,包括初始化客户端、读取minio对... 目录文件系统 vs Minio文件系统不足:对象存储:miniogolang连接Minio配置Min

使用Python实现大文件切片上传及断点续传的方法

《使用Python实现大文件切片上传及断点续传的方法》本文介绍了使用Python实现大文件切片上传及断点续传的方法,包括功能模块划分(获取上传文件接口状态、临时文件夹状态信息、切片上传、切片合并)、整... 目录概要整体架构流程技术细节获取上传文件状态接口获取临时文件夹状态信息接口切片上传功能文件合并功能小

Oracle Expdp按条件导出指定表数据的方法实例

《OracleExpdp按条件导出指定表数据的方法实例》:本文主要介绍Oracle的expdp数据泵方式导出特定机构和时间范围的数据,并通过parfile文件进行条件限制和配置,文中通过代码介绍... 目录1.场景描述 2.方案分析3.实验验证 3.1 parfile文件3.2 expdp命令导出4.总结

Node.js 中 http 模块的深度剖析与实战应用小结

《Node.js中http模块的深度剖析与实战应用小结》本文详细介绍了Node.js中的http模块,从创建HTTP服务器、处理请求与响应,到获取请求参数,每个环节都通过代码示例进行解析,旨在帮... 目录Node.js 中 http 模块的深度剖析与实战应用一、引言二、创建 HTTP 服务器:基石搭建(一