例如: cds view i_respymgmtteamtypefinalattrib由两个cds view join构成
那么应该由cds view的上级cds view mock 数据。
private section. CLASS-DATA: go_osql_test_environment TYPE REF TO cl_osql_test_environment, go_cds_test_environment TYPE REF TO if_cds_test_environment. methods: deter_serv_team_use_proc_type for testing. endclass. "lcl_Determine_Service_Team class lcl_Determine_Service_Team implementation. METHOD setup. f_Cut = zcl_crms4_orgman_det_serv_team=>get_instance( ). go_osql_test_environment ?= cl_osql_test_environment=>create( i_dependency_list = VALUE #( ( 'crms4c_team_pfty' ) ( 'crmc_proc_type' ) ( 'crms4c_team_prof' ) ( 'crms4c_team_asas' ) ( 'crms4c_team_asa' ) ) ). "initial the osql test environment go_cds_test_environment ?= cl_cds_test_environment=>create_for_multiple_cds( i_for_entities = VALUE #( ( i_for_entity = 'i_respymgmtteamtypefinalattrib' ) "由下面两个view 构成。 ) ). ENDMETHOD. method deter_serv_team_use_proc_type. data: lt_team_pfty TYPE table of crms4c_team_pfty, lt_proc_type TYPE table of crmc_proc_type, lt_team_prof TYPE table of crms4c_team_prof, lt_team_asas TYPE table of crms4c_team_asas, lt_team_asa TYPE table of crms4c_team_asa, lt_P_RespyMgmtTeamType TYPE TABLE OF P_RespyMgmtTeamTypeAttribIntrm, lt_I_RespyMgmtAttribute TYPE TABLE OF I_RespyMgmtAttribute. lt_team_pfty = VALUE #( ( client = '500' profile = 'SRV_FS_P' team_type = 'SRV_FS' ) ). lt_proc_type = VALUE #( ( client = '500' process_type = 'SVO1' service_team_profile = 'SRV_FS_P' ) ). lt_team_prof = VALUE #( ( CLIENT = '500' profile = 'SRV_FS_P' DETERMINATION_RULE = 'ATTRIBUTE' AUTO_RE_DET = 'X' ACCESS_SEQUENCE = 'IHR' ) ). lt_team_asas = VALUE #( ( CLIENT = '500' ACCESS_SEQUENCE = 'IHR' ACCESS_NUMBER = '001' ACCESS_STEP = '001' ) ). lt_team_asa = VALUE #( ( CLIENT = '500' ACCESS_STEP = '001' ATTRIBUTE = 'COUNTRY' SOURCE = 'BP' PARTNER_FCT = '00000055' ) ). lt_P_RespyMgmtTeamType = VALUE #( ( TEAMTYPEINCL = 'SRV_FS' ATTRIBUTEINCL = 'COUNTRY' ) ). lt_I_RespyMgmtAttribute = VALUE #( ( RESPYMGMTATTRIBUTENAME = 'COUNTRY' RESPYMGMTATTRIBUTETYPE = 'SRV_FS' ) ). go_osql_test_environment->IF_OSQL_TEST_ENVIRONMENT~INSERT_TEST_DATA( i_data = lt_team_pfty ). go_osql_test_environment->IF_OSQL_TEST_ENVIRONMENT~INSERT_TEST_DATA( i_data = lt_proc_type ). go_osql_test_environment->IF_OSQL_TEST_ENVIRONMENT~INSERT_TEST_DATA( i_data = lt_team_prof ). go_osql_test_environment->IF_OSQL_TEST_ENVIRONMENT~INSERT_TEST_DATA( i_data = lt_team_asas ). go_osql_test_environment->IF_OSQL_TEST_ENVIRONMENT~INSERT_TEST_DATA( i_data = lt_team_asa ). go_cds_test_environment->insert_test_data( i_data = lt_P_RespyMgmtTeamType ). go_cds_test_environment->insert_test_data( i_data = lt_I_RespyMgmtAttribute ). endmethod. endclass.