Provenance and social science data Nicholas Car - Intro to PROV
METHOD if Ehfnd Fw Ads Data Prov~Get Data
-
Upload
vignesh-pitchai -
Category
Documents
-
view
236 -
download
0
Transcript of METHOD if Ehfnd Fw Ads Data Prov~Get Data
7/27/2019 METHOD if Ehfnd Fw Ads Data Prov~Get Data
http://slidepdf.com/reader/full/method-if-ehfnd-fw-ads-data-provget-data 1/3
METHOD if_ehfnd_fw_ads_data_prov~get_data.
************************************************************************* define data************************************************************************DATA:
lo_root TYPE REF TO cl_ehfnd_ena_node,lo_basic_info_all TYPE REF TO cl_ehfnd_ena_node,
lr_s_root TYPE REF TO ehhsss_inc_root,lr_s_basic_info_all TYPE REF TO ehhsss_inc_basic_info_all,lr_t_person_inj TYPE REF TO ehhsst_aif_inc_inj_pers_wo_inc,lr_t_witnesses TYPE REF TO ehhsst_aif_inc_witness_wo_inc,
lr_t_att_document TYPE REF TO ehhsst_inc_att_document,
lv_context_ddic_name TYPE string,ls_interface TYPE ehhsss_aif_inc_interf_act_ev,
lx_root TYPE REF TO cx_root,lx_aif_common TYPE REF TO cx_ehhss_aif_comn_exception,ls_msg TYPE bal_s_msg,lv_orign_langu TYPE langu.
************************************************************************* functional body************************************************************************
* check the context structureIF iv_context IS INITIAL.
* this data provider needs a context. Raise exceptionRAISE EXCEPTION TYPE cx_ehfnd_fw_ads_framework_excEXPORTING
textid = cx_ehfnd_fw_ads_framework_exc=>no_context_in_dprovdata_provider = is_form-data_provider.
ELSE.* describe the context structure
cl_ehfnd_fw_ads_helper=>get_ddic_object_name( EXPORTING i_ddic_object = iv_context
IMPORTING ev_object_name = lv_ context_ddic_name ).
* check if the correct context is provided in the interface parameterIF NOT lv_context_ddic_name = cl_ehhss_aif_inc_constants=>gv_context_struct_
name.* it is the wrong context structure. raise exception
RAISE EXCEPTION TYPE cx_ehfnd_fw_ads_framework_exc
EXPORTINGtextid = cx_ehfnd_fw_ads_framework_exc=>context_structure_d
oes_not_fitaif_class_name = is_form-data_providercontext_structure = lv_context_ddic_name.
ENDIF.ENDIF.
* save the original language
7/27/2019 METHOD if Ehfnd Fw Ads Data Prov~Get Data
http://slidepdf.com/reader/full/method-if-ehfnd-fw-ads-data-provget-data 2/3
7/27/2019 METHOD if Ehfnd Fw Ads Data Prov~Get Data
http://slidepdf.com/reader/full/method-if-ehfnd-fw-ads-data-provget-data 3/3
io_root = lo_rootIMPORTINGet_equipment = ls_interface-incident-involved_assets-equipmentset_vehicle = ls_interface-incident-involved_assets-vehicleset_property = ls_interface-incident-involved_assets-properties
).
lr_t_att_document = me->mo_bo_acc->get_attachments_table( lo_root ).
CATCH cx_ehhss_aif_comn_exception INTO lx_aif_common.
ls_msg-msgid = lx_aif_common->if_t100_message~t100key-msgid.ls_msg-msgno = lx_aif_common->if_t100_message~t100key-msgno.ls_msg-probclass = 'CL_EHHSS_AIF_INC_BO_ACCESSOR'.APPEND ls_msg TO et_messages.
RETURN.CATCH cx_root INTO lx_root .
* re-set the languageSET LOCALE LANGUAGE lv_orign_langu.
RAISE EXCEPTION TYPE cx_ehfnd_fw_ads_framework_excEXPORTINGtextid = cx_ehfnd_fw_ads_framework_exc=>other_problem
aif_class_name = is_form-data_providercontext_structure = lv_context_ddic_nameprevious = lx_root.
ENDTRY.
* Incident Idls_interface-incident-incident_header-id = lr_s_root->id.
* Set Fatalityls_interface-incident-incident_header-fatality_ts = lr_s_root->fatality_ts.
* fill basic info allMOVE-CORRESPONDING lr_s_basic_info_all->* TO ls_interface-incident-basic_infor
mation.
* Attachment documentsIF lr_t_att_document IS NOT INITIAL.
ls_interface-incident-attachments = lr_t_att_document->*.ENDIF.
* sort the personslr_t_person_inj = cl_ehhss_aif_inc_bo_accessor=>sort_inj_persons( it_persons =
ls_interface-incident-inv_pers-inj_per ).ls_interface-incident-inv_pers-inj_per = lr_t_person_inj->*.lr_t_witnesses = cl_ehhss_aif_inc_bo_accessor=>sort_witnesses( it_persons = ls
_interface-incident-inv_pers-witnesses ).
ls_interface-incident-inv_pers-witnesses = lr_t_witnesses->*.
ev_interface_structure = ls_interface.
* re-set the languageSET LOCALE LANGUAGE lv_orign_langu.
ENDMETHOD.