Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ABAP 51.28 KB | None | 0 0
  1. class ZCL_ZGW_CUST_360_AB_DPC definition
  2.   public
  3.   inheriting from /IWBEP/CL_MGW_PUSH_ABS_DATA
  4.   abstract
  5.   create public .
  6.  
  7. public section.
  8.  
  9.   interfaces /IWBEP/IF_SB_DPC_COMM_SERVICES .
  10.   interfaces /IWBEP/IF_SB_GEN_DPC_INJECTION .
  11.  
  12.   methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET
  13.     redefinition .
  14.   methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY
  15.     redefinition .
  16.   methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~UPDATE_ENTITY
  17.     redefinition .
  18.   methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_ENTITY
  19.     redefinition .
  20.   methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~DELETE_ENTITY
  21.     redefinition .
  22. protected section.
  23.  
  24.   data mo_injection type ref to /IWBEP/IF_SB_GEN_DPC_INJECTION .
  25.  
  26.   methods FLIGHTSET_CREATE_ENTITY
  27.     importing
  28.       !IV_ENTITY_NAME type STRING
  29.       !IV_ENTITY_SET_NAME type STRING
  30.       !IV_SOURCE_NAME type STRING
  31.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  32.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_C optional
  33.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  34.       !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional
  35.     exporting
  36.       !ER_ENTITY type ZCL_ZGW_CUST_360_AB_MPC=>TS_FLIGHT
  37.     raising
  38.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  39.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  40.   methods FLIGHTSET_DELETE_ENTITY
  41.     importing
  42.       !IV_ENTITY_NAME type STRING
  43.       !IV_ENTITY_SET_NAME type STRING
  44.       !IV_SOURCE_NAME type STRING
  45.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  46.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_D optional
  47.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  48.     raising
  49.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  50.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  51.   methods FLIGHTSET_GET_ENTITY
  52.     importing
  53.       !IV_ENTITY_NAME type STRING
  54.       !IV_ENTITY_SET_NAME type STRING
  55.       !IV_SOURCE_NAME type STRING
  56.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  57.       !IO_REQUEST_OBJECT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional
  58.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional
  59.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  60.     exporting
  61.       !ER_ENTITY type ZCL_ZGW_CUST_360_AB_MPC=>TS_FLIGHT
  62.       !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_ENTITY_CNTXT
  63.     raising
  64.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  65.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  66.   methods FLIGHTSET_GET_ENTITYSET
  67.     importing
  68.       !IV_ENTITY_NAME type STRING
  69.       !IV_ENTITY_SET_NAME type STRING
  70.       !IV_SOURCE_NAME type STRING
  71.       !IT_FILTER_SELECT_OPTIONS type /IWBEP/T_MGW_SELECT_OPTION
  72.       !IS_PAGING type /IWBEP/S_MGW_PAGING
  73.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  74.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  75.       !IT_ORDER type /IWBEP/T_MGW_SORTING_ORDER
  76.       !IV_FILTER_STRING type STRING
  77.       !IV_SEARCH_STRING type STRING
  78.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITYSET optional
  79.     exporting
  80.       !ET_ENTITYSET type ZCL_ZGW_CUST_360_AB_MPC=>TT_FLIGHT
  81.       !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_CONTEXT
  82.     raising
  83.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  84.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  85.   methods FLIGHTSET_UPDATE_ENTITY
  86.     importing
  87.       !IV_ENTITY_NAME type STRING
  88.       !IV_ENTITY_SET_NAME type STRING
  89.       !IV_SOURCE_NAME type STRING
  90.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  91.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_U optional
  92.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  93.       !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional
  94.     exporting
  95.       !ER_ENTITY type ZCL_ZGW_CUST_360_AB_MPC=>TS_FLIGHT
  96.     raising
  97.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  98.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  99.   methods MATERIALSET_CREATE_ENTITY
  100.     importing
  101.       !IV_ENTITY_NAME type STRING
  102.       !IV_ENTITY_SET_NAME type STRING
  103.       !IV_SOURCE_NAME type STRING
  104.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  105.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_C optional
  106.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  107.       !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional
  108.     exporting
  109.       !ER_ENTITY type ZCL_ZGW_CUST_360_AB_MPC=>TS_MATERIAL
  110.     raising
  111.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  112.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  113.   methods MATERIALSET_DELETE_ENTITY
  114.     importing
  115.       !IV_ENTITY_NAME type STRING
  116.       !IV_ENTITY_SET_NAME type STRING
  117.       !IV_SOURCE_NAME type STRING
  118.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  119.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_D optional
  120.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  121.     raising
  122.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  123.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  124.   methods MATERIALSET_GET_ENTITY
  125.     importing
  126.       !IV_ENTITY_NAME type STRING
  127.       !IV_ENTITY_SET_NAME type STRING
  128.       !IV_SOURCE_NAME type STRING
  129.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  130.       !IO_REQUEST_OBJECT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional
  131.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional
  132.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  133.     exporting
  134.       !ER_ENTITY type ZCL_ZGW_CUST_360_AB_MPC=>TS_MATERIAL
  135.       !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_ENTITY_CNTXT
  136.     raising
  137.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  138.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  139.   methods MATERIALSET_GET_ENTITYSET
  140.     importing
  141.       !IV_ENTITY_NAME type STRING
  142.       !IV_ENTITY_SET_NAME type STRING
  143.       !IV_SOURCE_NAME type STRING
  144.       !IT_FILTER_SELECT_OPTIONS type /IWBEP/T_MGW_SELECT_OPTION
  145.       !IS_PAGING type /IWBEP/S_MGW_PAGING
  146.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  147.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  148.       !IT_ORDER type /IWBEP/T_MGW_SORTING_ORDER
  149.       !IV_FILTER_STRING type STRING
  150.       !IV_SEARCH_STRING type STRING
  151.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITYSET optional
  152.     exporting
  153.       !ET_ENTITYSET type ZCL_ZGW_CUST_360_AB_MPC=>TT_MATERIAL
  154.       !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_CONTEXT
  155.     raising
  156.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  157.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  158.   methods MATERIALSET_UPDATE_ENTITY
  159.     importing
  160.       !IV_ENTITY_NAME type STRING
  161.       !IV_ENTITY_SET_NAME type STRING
  162.       !IV_SOURCE_NAME type STRING
  163.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  164.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_U optional
  165.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  166.       !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional
  167.     exporting
  168.       !ER_ENTITY type ZCL_ZGW_CUST_360_AB_MPC=>TS_MATERIAL
  169.     raising
  170.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  171.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  172.   methods SALESORGANISATIO_CREATE_ENTITY
  173.     importing
  174.       !IV_ENTITY_NAME type STRING
  175.       !IV_ENTITY_SET_NAME type STRING
  176.       !IV_SOURCE_NAME type STRING
  177.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  178.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_C optional
  179.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  180.       !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional
  181.     exporting
  182.       !ER_ENTITY type ZCL_ZGW_CUST_360_AB_MPC=>TS_SALESORGANISATION
  183.     raising
  184.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  185.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  186.   methods SALESORGANISATIO_DELETE_ENTITY
  187.     importing
  188.       !IV_ENTITY_NAME type STRING
  189.       !IV_ENTITY_SET_NAME type STRING
  190.       !IV_SOURCE_NAME type STRING
  191.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  192.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_D optional
  193.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  194.     raising
  195.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  196.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  197.   methods SALESORGANISATIO_GET_ENTITY
  198.     importing
  199.       !IV_ENTITY_NAME type STRING
  200.       !IV_ENTITY_SET_NAME type STRING
  201.       !IV_SOURCE_NAME type STRING
  202.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  203.       !IO_REQUEST_OBJECT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional
  204.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional
  205.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  206.     exporting
  207.       !ER_ENTITY type ZCL_ZGW_CUST_360_AB_MPC=>TS_SALESORGANISATION
  208.       !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_ENTITY_CNTXT
  209.     raising
  210.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  211.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  212.   methods SALESORGANISATIO_GET_ENTITYSET
  213.     importing
  214.       !IV_ENTITY_NAME type STRING
  215.       !IV_ENTITY_SET_NAME type STRING
  216.       !IV_SOURCE_NAME type STRING
  217.       !IT_FILTER_SELECT_OPTIONS type /IWBEP/T_MGW_SELECT_OPTION
  218.       !IS_PAGING type /IWBEP/S_MGW_PAGING
  219.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  220.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  221.       !IT_ORDER type /IWBEP/T_MGW_SORTING_ORDER
  222.       !IV_FILTER_STRING type STRING
  223.       !IV_SEARCH_STRING type STRING
  224.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITYSET optional
  225.     exporting
  226.       !ET_ENTITYSET type ZCL_ZGW_CUST_360_AB_MPC=>TT_SALESORGANISATION
  227.       !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_CONTEXT
  228.     raising
  229.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  230.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  231.   methods SALESORGANISATIO_UPDATE_ENTITY
  232.     importing
  233.       !IV_ENTITY_NAME type STRING
  234.       !IV_ENTITY_SET_NAME type STRING
  235.       !IV_SOURCE_NAME type STRING
  236.       !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR
  237.       !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_U optional
  238.       !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH
  239.       !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional
  240.     exporting
  241.       !ER_ENTITY type ZCL_ZGW_CUST_360_AB_MPC=>TS_SALESORGANISATION
  242.     raising
  243.       /IWBEP/CX_MGW_BUSI_EXCEPTION
  244.       /IWBEP/CX_MGW_TECH_EXCEPTION .
  245.  
  246.   methods CHECK_SUBSCRIPTION_AUTHORITY
  247.     redefinition .
  248. private section.
  249. ENDCLASS.
  250.  
  251.  
  252.  
  253. CLASS ZCL_ZGW_CUST_360_AB_DPC IMPLEMENTATION.
  254.  
  255.  
  256.   method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_ENTITY.
  257. *&----------------------------------------------------------------------------------------------*
  258. *&  Include           /IWBEP/DPC_TEMP_CRT_ENTITY_BASE
  259. *&* This class has been generated on 19.09.2018 15:28:28 in client 400
  260. *&*
  261. *&*       WARNING--> NEVER MODIFY THIS CLASS <--WARNING
  262. *&*   If you want to change the DPC implementation, use the
  263. *&*   generated methods inside the DPC provider subclass - ZCL_ZGW_CUST_360_AB_DPC_EXT
  264. *&-----------------------------------------------------------------------------------------------*
  265.  
  266.  DATA materialset_create_entity TYPE zcl_zgw_cust_360_ab_mpc=>ts_material.
  267.  DATA flightset_create_entity TYPE zcl_zgw_cust_360_ab_mpc=>ts_flight.
  268.  DATA salesorganisatio_create_entity TYPE zcl_zgw_cust_360_ab_mpc=>ts_salesorganisation.
  269.  DATA lv_entityset_name TYPE string.
  270.  
  271. lv_entityset_name = io_tech_request_context->get_entity_set_name( ).
  272.  
  273. CASE lv_entityset_name.
  274. *-------------------------------------------------------------------------*
  275. *             EntitySet -  MaterialSet
  276. *-------------------------------------------------------------------------*
  277.      WHEN 'MaterialSet'.
  278. *     Call the entity set generated method
  279.     materialset_create_entity(
  280.          EXPORTING iv_entity_name     = iv_entity_name
  281.                    iv_entity_set_name = iv_entity_set_name
  282.                    iv_source_name     = iv_source_name
  283.                    io_data_provider   = io_data_provider
  284.                    it_key_tab         = it_key_tab
  285.                    it_navigation_path = it_navigation_path
  286.                    io_tech_request_context = io_tech_request_context
  287.          IMPORTING er_entity          = materialset_create_entity
  288.     ).
  289. *     Send specific entity data to the caller interfaces
  290.     copy_data_to_ref(
  291.       EXPORTING
  292.         is_data = materialset_create_entity
  293.       CHANGING
  294.         cr_data = er_entity
  295.    ).
  296.  
  297. *-------------------------------------------------------------------------*
  298. *             EntitySet -  FlightSet
  299. *-------------------------------------------------------------------------*
  300.      WHEN 'FlightSet'.
  301. *     Call the entity set generated method
  302.     flightset_create_entity(
  303.          EXPORTING iv_entity_name     = iv_entity_name
  304.                    iv_entity_set_name = iv_entity_set_name
  305.                    iv_source_name     = iv_source_name
  306.                    io_data_provider   = io_data_provider
  307.                    it_key_tab         = it_key_tab
  308.                    it_navigation_path = it_navigation_path
  309.                    io_tech_request_context = io_tech_request_context
  310.          IMPORTING er_entity          = flightset_create_entity
  311.     ).
  312. *     Send specific entity data to the caller interfaces
  313.     copy_data_to_ref(
  314.       EXPORTING
  315.         is_data = flightset_create_entity
  316.       CHANGING
  317.         cr_data = er_entity
  318.    ).
  319.  
  320. *-------------------------------------------------------------------------*
  321. *             EntitySet -  SalesOrganisationSet
  322. *-------------------------------------------------------------------------*
  323.      WHEN 'SalesOrganisationSet'.
  324. *     Call the entity set generated method
  325.     salesorganisatio_create_entity(
  326.          EXPORTING iv_entity_name     = iv_entity_name
  327.                    iv_entity_set_name = iv_entity_set_name
  328.                    iv_source_name     = iv_source_name
  329.                    io_data_provider   = io_data_provider
  330.                    it_key_tab         = it_key_tab
  331.                    it_navigation_path = it_navigation_path
  332.                    io_tech_request_context = io_tech_request_context
  333.          IMPORTING er_entity          = salesorganisatio_create_entity
  334.     ).
  335. *     Send specific entity data to the caller interfaces
  336.     copy_data_to_ref(
  337.       EXPORTING
  338.         is_data = salesorganisatio_create_entity
  339.       CHANGING
  340.         cr_data = er_entity
  341.    ).
  342.  
  343.   when others.
  344.     super->/iwbep/if_mgw_appl_srv_runtime~create_entity(
  345.        EXPORTING
  346.          iv_entity_name = iv_entity_name
  347.          iv_entity_set_name = iv_entity_set_name
  348.          iv_source_name = iv_source_name
  349.          io_data_provider   = io_data_provider
  350.          it_key_tab = it_key_tab
  351.          it_navigation_path = it_navigation_path
  352.       IMPORTING
  353.         er_entity = er_entity
  354.   ).
  355. ENDCASE.
  356.   endmethod.
  357.  
  358.  
  359.   method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~DELETE_ENTITY.
  360. *&----------------------------------------------------------------------------------------------*
  361. *&  Include           /IWBEP/DPC_TEMP_DEL_ENTITY_BASE
  362. *&* This class has been generated on 19.09.2018 15:28:28 in client 400
  363. *&*
  364. *&*       WARNING--> NEVER MODIFY THIS CLASS <--WARNING
  365. *&*   If you want to change the DPC implementation, use the
  366. *&*   generated methods inside the DPC provider subclass - ZCL_ZGW_CUST_360_AB_DPC_EXT
  367. *&-----------------------------------------------------------------------------------------------*
  368.  
  369.  DATA lv_entityset_name TYPE string.
  370.  
  371. lv_entityset_name = io_tech_request_context->get_entity_set_name( ).
  372.  
  373. CASE lv_entityset_name.
  374. *-------------------------------------------------------------------------*
  375. *             EntitySet -  MaterialSet
  376. *-------------------------------------------------------------------------*
  377.       when 'MaterialSet'.
  378. *     Call the entity set generated method
  379.      materialset_delete_entity(
  380.           EXPORTING iv_entity_name     = iv_entity_name
  381.                     iv_entity_set_name = iv_entity_set_name
  382.                     iv_source_name     = iv_source_name
  383.                     it_key_tab         = it_key_tab
  384.                     it_navigation_path = it_navigation_path
  385.                     io_tech_request_context = io_tech_request_context
  386.      ).
  387.  
  388. *-------------------------------------------------------------------------*
  389. *             EntitySet -  FlightSet
  390. *-------------------------------------------------------------------------*
  391.       when 'FlightSet'.
  392. *     Call the entity set generated method
  393.      flightset_delete_entity(
  394.           EXPORTING iv_entity_name     = iv_entity_name
  395.                     iv_entity_set_name = iv_entity_set_name
  396.                     iv_source_name     = iv_source_name
  397.                     it_key_tab         = it_key_tab
  398.                     it_navigation_path = it_navigation_path
  399.                     io_tech_request_context = io_tech_request_context
  400.      ).
  401.  
  402. *-------------------------------------------------------------------------*
  403. *             EntitySet -  SalesOrganisationSet
  404. *-------------------------------------------------------------------------*
  405.       when 'SalesOrganisationSet'.
  406. *     Call the entity set generated method
  407.      salesorganisatio_delete_entity(
  408.           EXPORTING iv_entity_name     = iv_entity_name
  409.                     iv_entity_set_name = iv_entity_set_name
  410.                     iv_source_name     = iv_source_name
  411.                     it_key_tab         = it_key_tab
  412.                     it_navigation_path = it_navigation_path
  413.                     io_tech_request_context = io_tech_request_context
  414.      ).
  415.  
  416.    when others.
  417.      super->/iwbep/if_mgw_appl_srv_runtime~delete_entity(
  418.         EXPORTING
  419.           iv_entity_name = iv_entity_name
  420.           iv_entity_set_name = iv_entity_set_name
  421.           iv_source_name = iv_source_name
  422.           it_key_tab = it_key_tab
  423.           it_navigation_path = it_navigation_path
  424.  ).
  425.  ENDCASE.
  426.   endmethod.
  427.  
  428.  
  429.   method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY.
  430. *&-----------------------------------------------------------------------------------------------*
  431. *&  Include           /IWBEP/DPC_TEMP_GETENTITY_BASE
  432. *&* This class has been generated  on 19.09.2018 15:28:28 in client 400
  433. *&*
  434. *&*       WARNING--> NEVER MODIFY THIS CLASS <--WARNING
  435. *&*   If you want to change the DPC implementation, use the
  436. *&*   generated methods inside the DPC provider subclass - ZCL_ZGW_CUST_360_AB_DPC_EXT
  437. *&-----------------------------------------------------------------------------------------------*
  438.  
  439.  DATA materialset_get_entity TYPE zcl_zgw_cust_360_ab_mpc=>ts_material.
  440.  DATA flightset_get_entity TYPE zcl_zgw_cust_360_ab_mpc=>ts_flight.
  441.  DATA salesorganisatio_get_entity TYPE zcl_zgw_cust_360_ab_mpc=>ts_salesorganisation.
  442.  DATA lv_entityset_name TYPE string.
  443.  DATA lr_entity TYPE REF TO data.       "#EC NEEDED
  444.  
  445. lv_entityset_name = io_tech_request_context->get_entity_set_name( ).
  446.  
  447. CASE lv_entityset_name.
  448. *-------------------------------------------------------------------------*
  449. *             EntitySet -  MaterialSet
  450. *-------------------------------------------------------------------------*
  451.       WHEN 'MaterialSet'.
  452. *     Call the entity set generated method
  453.           materialset_get_entity(
  454.                EXPORTING iv_entity_name     = iv_entity_name
  455.                          iv_entity_set_name = iv_entity_set_name
  456.                          iv_source_name     = iv_source_name
  457.                          it_key_tab         = it_key_tab
  458.                          it_navigation_path = it_navigation_path
  459.                          io_tech_request_context = io_tech_request_context
  460.                  IMPORTING er_entity          = materialset_get_entity
  461.                          es_response_context = es_response_context
  462.           ).
  463.  
  464.         IF materialset_get_entity IS NOT INITIAL.
  465. *     Send specific entity data to the caller interface
  466.           copy_data_to_ref(
  467.             EXPORTING
  468.               is_data = materialset_get_entity
  469.             CHANGING
  470.               cr_data = er_entity
  471.           ).
  472.         ELSE.
  473. *         In case of initial values - unbind the entity reference
  474.           er_entity = lr_entity.
  475.         ENDIF.
  476. *-------------------------------------------------------------------------*
  477. *             EntitySet -  FlightSet
  478. *-------------------------------------------------------------------------*
  479.       WHEN 'FlightSet'.
  480. *     Call the entity set generated method
  481.           flightset_get_entity(
  482.                EXPORTING iv_entity_name     = iv_entity_name
  483.                          iv_entity_set_name = iv_entity_set_name
  484.                          iv_source_name     = iv_source_name
  485.                          it_key_tab         = it_key_tab
  486.                          it_navigation_path = it_navigation_path
  487.                          io_tech_request_context = io_tech_request_context
  488.                  IMPORTING er_entity          = flightset_get_entity
  489.                          es_response_context = es_response_context
  490.           ).
  491.  
  492.         IF flightset_get_entity IS NOT INITIAL.
  493. *     Send specific entity data to the caller interface
  494.           copy_data_to_ref(
  495.             EXPORTING
  496.               is_data = flightset_get_entity
  497.             CHANGING
  498.               cr_data = er_entity
  499.           ).
  500.         ELSE.
  501. *         In case of initial values - unbind the entity reference
  502.           er_entity = lr_entity.
  503.         ENDIF.
  504. *-------------------------------------------------------------------------*
  505. *             EntitySet -  SalesOrganisationSet
  506. *-------------------------------------------------------------------------*
  507.       WHEN 'SalesOrganisationSet'.
  508. *     Call the entity set generated method
  509.           salesorganisatio_get_entity(
  510.                EXPORTING iv_entity_name     = iv_entity_name
  511.                          iv_entity_set_name = iv_entity_set_name
  512.                          iv_source_name     = iv_source_name
  513.                          it_key_tab         = it_key_tab
  514.                          it_navigation_path = it_navigation_path
  515.                          io_tech_request_context = io_tech_request_context
  516.                  IMPORTING er_entity          = salesorganisatio_get_entity
  517.                          es_response_context = es_response_context
  518.           ).
  519.  
  520.         IF salesorganisatio_get_entity IS NOT INITIAL.
  521. *     Send specific entity data to the caller interface
  522.           copy_data_to_ref(
  523.             EXPORTING
  524.               is_data = salesorganisatio_get_entity
  525.             CHANGING
  526.               cr_data = er_entity
  527.           ).
  528.         ELSE.
  529. *         In case of initial values - unbind the entity reference
  530.           er_entity = lr_entity.
  531.         ENDIF.
  532.  
  533.       WHEN OTHERS.
  534.         super->/iwbep/if_mgw_appl_srv_runtime~get_entity(
  535.            EXPORTING
  536.              iv_entity_name = iv_entity_name
  537.              iv_entity_set_name = iv_entity_set_name
  538.              iv_source_name = iv_source_name
  539.              it_key_tab = it_key_tab
  540.              it_navigation_path = it_navigation_path
  541.           IMPORTING
  542.             er_entity = er_entity
  543.     ).
  544.  ENDCASE.
  545.   endmethod.
  546.  
  547.  
  548.   method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET.
  549. *&----------------------------------------------------------------------------------------------*
  550. *&  Include           /IWBEP/DPC_TMP_ENTITYSET_BASE
  551. *&* This class has been generated on 19.09.2018 15:28:28 in client 400
  552. *&*
  553. *&*       WARNING--> NEVER MODIFY THIS CLASS <--WARNING
  554. *&*   If you want to change the DPC implementation, use the
  555. *&*   generated methods inside the DPC provider subclass - ZCL_ZGW_CUST_360_AB_DPC_EXT
  556. *&-----------------------------------------------------------------------------------------------*
  557.  DATA materialset_get_entityset TYPE zcl_zgw_cust_360_ab_mpc=>tt_material.
  558.  DATA flightset_get_entityset TYPE zcl_zgw_cust_360_ab_mpc=>tt_flight.
  559.  DATA salesorganisatio_get_entityset TYPE zcl_zgw_cust_360_ab_mpc=>tt_salesorganisation.
  560.  DATA lv_entityset_name TYPE string.
  561.  
  562. lv_entityset_name = io_tech_request_context->get_entity_set_name( ).
  563.  
  564. CASE lv_entityset_name.
  565. *-------------------------------------------------------------------------*
  566. *             EntitySet -  MaterialSet
  567. *-------------------------------------------------------------------------*
  568.    WHEN 'MaterialSet'.
  569. *     Call the entity set generated method
  570.       materialset_get_entityset(
  571.         EXPORTING
  572.          iv_entity_name = iv_entity_name
  573.          iv_entity_set_name = iv_entity_set_name
  574.          iv_source_name = iv_source_name
  575.          it_filter_select_options = it_filter_select_options
  576.          it_order = it_order
  577.          is_paging = is_paging
  578.          it_navigation_path = it_navigation_path
  579.          it_key_tab = it_key_tab
  580.          iv_filter_string = iv_filter_string
  581.          iv_search_string = iv_search_string
  582.          io_tech_request_context = io_tech_request_context
  583.        IMPORTING
  584.          et_entityset = materialset_get_entityset
  585.          es_response_context = es_response_context
  586.        ).
  587. *     Send specific entity data to the caller interface
  588.       copy_data_to_ref(
  589.         EXPORTING
  590.           is_data = materialset_get_entityset
  591.         CHANGING
  592.           cr_data = er_entityset
  593.       ).
  594.  
  595. *-------------------------------------------------------------------------*
  596. *             EntitySet -  FlightSet
  597. *-------------------------------------------------------------------------*
  598.    WHEN 'FlightSet'.
  599. *     Call the entity set generated method
  600.       flightset_get_entityset(
  601.         EXPORTING
  602.          iv_entity_name = iv_entity_name
  603.          iv_entity_set_name = iv_entity_set_name
  604.          iv_source_name = iv_source_name
  605.          it_filter_select_options = it_filter_select_options
  606.          it_order = it_order
  607.          is_paging = is_paging
  608.          it_navigation_path = it_navigation_path
  609.          it_key_tab = it_key_tab
  610.          iv_filter_string = iv_filter_string
  611.          iv_search_string = iv_search_string
  612.          io_tech_request_context = io_tech_request_context
  613.        IMPORTING
  614.          et_entityset = flightset_get_entityset
  615.          es_response_context = es_response_context
  616.        ).
  617. *     Send specific entity data to the caller interface
  618.       copy_data_to_ref(
  619.         EXPORTING
  620.           is_data = flightset_get_entityset
  621.         CHANGING
  622.           cr_data = er_entityset
  623.       ).
  624.  
  625. *-------------------------------------------------------------------------*
  626. *             EntitySet -  SalesOrganisationSet
  627. *-------------------------------------------------------------------------*
  628.    WHEN 'SalesOrganisationSet'.
  629. *     Call the entity set generated method
  630.       salesorganisatio_get_entityset(
  631.         EXPORTING
  632.          iv_entity_name = iv_entity_name
  633.          iv_entity_set_name = iv_entity_set_name
  634.          iv_source_name = iv_source_name
  635.          it_filter_select_options = it_filter_select_options
  636.          it_order = it_order
  637.          is_paging = is_paging
  638.          it_navigation_path = it_navigation_path
  639.          it_key_tab = it_key_tab
  640.          iv_filter_string = iv_filter_string
  641.          iv_search_string = iv_search_string
  642.          io_tech_request_context = io_tech_request_context
  643.        IMPORTING
  644.          et_entityset = salesorganisatio_get_entityset
  645.          es_response_context = es_response_context
  646.        ).
  647. *     Send specific entity data to the caller interface
  648.       copy_data_to_ref(
  649.         EXPORTING
  650.           is_data = salesorganisatio_get_entityset
  651.         CHANGING
  652.           cr_data = er_entityset
  653.       ).
  654.  
  655.     WHEN OTHERS.
  656.       super->/iwbep/if_mgw_appl_srv_runtime~get_entityset(
  657.         EXPORTING
  658.           iv_entity_name = iv_entity_name
  659.           iv_entity_set_name = iv_entity_set_name
  660.           iv_source_name = iv_source_name
  661.           it_filter_select_options = it_filter_select_options
  662.           it_order = it_order
  663.           is_paging = is_paging
  664.           it_navigation_path = it_navigation_path
  665.           it_key_tab = it_key_tab
  666.           iv_filter_string = iv_filter_string
  667.           iv_search_string = iv_search_string
  668.           io_tech_request_context = io_tech_request_context
  669.        IMPORTING
  670.          er_entityset = er_entityset ).
  671.  ENDCASE.
  672.   endmethod.
  673.  
  674.  
  675.   method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~UPDATE_ENTITY.
  676. *&----------------------------------------------------------------------------------------------*
  677. *&  Include           /IWBEP/DPC_TEMP_UPD_ENTITY_BASE
  678. *&* This class has been generated on 19.09.2018 15:28:28 in client 400
  679. *&*
  680. *&*       WARNING--> NEVER MODIFY THIS CLASS <--WARNING
  681. *&*   If you want to change the DPC implementation, use the
  682. *&*   generated methods inside the DPC provider subclass - ZCL_ZGW_CUST_360_AB_DPC_EXT
  683. *&-----------------------------------------------------------------------------------------------*
  684.  
  685.  DATA materialset_update_entity TYPE zcl_zgw_cust_360_ab_mpc=>ts_material.
  686.  DATA flightset_update_entity TYPE zcl_zgw_cust_360_ab_mpc=>ts_flight.
  687.  DATA salesorganisatio_update_entity TYPE zcl_zgw_cust_360_ab_mpc=>ts_salesorganisation.
  688.  DATA lv_entityset_name TYPE string.
  689.  DATA lr_entity TYPE REF TO data. "#EC NEEDED
  690.  
  691. lv_entityset_name = io_tech_request_context->get_entity_set_name( ).
  692.  
  693. CASE lv_entityset_name.
  694. *-------------------------------------------------------------------------*
  695. *             EntitySet -  MaterialSet
  696. *-------------------------------------------------------------------------*
  697.       WHEN 'MaterialSet'.
  698. *     Call the entity set generated method
  699.           materialset_update_entity(
  700.                EXPORTING iv_entity_name     = iv_entity_name
  701.                          iv_entity_set_name = iv_entity_set_name
  702.                          iv_source_name     = iv_source_name
  703.                          io_data_provider   = io_data_provider
  704.                          it_key_tab         = it_key_tab
  705.                          it_navigation_path = it_navigation_path
  706.                          io_tech_request_context = io_tech_request_context
  707.                  IMPORTING er_entity          = materialset_update_entity
  708.           ).
  709.        IF materialset_update_entity IS NOT INITIAL.
  710. *     Send specific entity data to the caller interface
  711.           copy_data_to_ref(
  712.             EXPORTING
  713.               is_data = materialset_update_entity
  714.             CHANGING
  715.               cr_data = er_entity
  716.           ).
  717.         ELSE.
  718. *         In case of initial values - unbind the entity reference
  719.           er_entity = lr_entity.
  720.         ENDIF.
  721. *-------------------------------------------------------------------------*
  722. *             EntitySet -  FlightSet
  723. *-------------------------------------------------------------------------*
  724.       WHEN 'FlightSet'.
  725. *     Call the entity set generated method
  726.           flightset_update_entity(
  727.                EXPORTING iv_entity_name     = iv_entity_name
  728.                          iv_entity_set_name = iv_entity_set_name
  729.                          iv_source_name     = iv_source_name
  730.                          io_data_provider   = io_data_provider
  731.                          it_key_tab         = it_key_tab
  732.                          it_navigation_path = it_navigation_path
  733.                          io_tech_request_context = io_tech_request_context
  734.                  IMPORTING er_entity          = flightset_update_entity
  735.           ).
  736.        IF flightset_update_entity IS NOT INITIAL.
  737. *     Send specific entity data to the caller interface
  738.           copy_data_to_ref(
  739.             EXPORTING
  740.               is_data = flightset_update_entity
  741.             CHANGING
  742.               cr_data = er_entity
  743.           ).
  744.         ELSE.
  745. *         In case of initial values - unbind the entity reference
  746.           er_entity = lr_entity.
  747.         ENDIF.
  748. *-------------------------------------------------------------------------*
  749. *             EntitySet -  SalesOrganisationSet
  750. *-------------------------------------------------------------------------*
  751.       WHEN 'SalesOrganisationSet'.
  752. *     Call the entity set generated method
  753.           salesorganisatio_update_entity(
  754.                EXPORTING iv_entity_name     = iv_entity_name
  755.                          iv_entity_set_name = iv_entity_set_name
  756.                          iv_source_name     = iv_source_name
  757.                          io_data_provider   = io_data_provider
  758.                          it_key_tab         = it_key_tab
  759.                          it_navigation_path = it_navigation_path
  760.                          io_tech_request_context = io_tech_request_context
  761.                  IMPORTING er_entity          = salesorganisatio_update_entity
  762.           ).
  763.        IF salesorganisatio_update_entity IS NOT INITIAL.
  764. *     Send specific entity data to the caller interface
  765.           copy_data_to_ref(
  766.             EXPORTING
  767.               is_data = salesorganisatio_update_entity
  768.             CHANGING
  769.               cr_data = er_entity
  770.           ).
  771.         ELSE.
  772. *         In case of initial values - unbind the entity reference
  773.           er_entity = lr_entity.
  774.         ENDIF.
  775.       WHEN OTHERS.
  776.         super->/iwbep/if_mgw_appl_srv_runtime~update_entity(
  777.            EXPORTING
  778.              iv_entity_name = iv_entity_name
  779.              iv_entity_set_name = iv_entity_set_name
  780.              iv_source_name = iv_source_name
  781.              io_data_provider   = io_data_provider
  782.              it_key_tab = it_key_tab
  783.              it_navigation_path = it_navigation_path
  784.           IMPORTING
  785.             er_entity = er_entity
  786.     ).
  787.  ENDCASE.
  788.   endmethod.
  789.  
  790.  
  791.   method /IWBEP/IF_SB_DPC_COMM_SERVICES~COMMIT_WORK.
  792. * Call RFC commit work functionality
  793. DATA lt_message      TYPE bapiret2. "#EC NEEDED
  794. DATA lv_message_text TYPE BAPI_MSG.
  795. DATA lo_logger       TYPE REF TO /iwbep/cl_cos_logger.
  796. DATA lv_subrc        TYPE syst-subrc.
  797.  
  798. lo_logger = /iwbep/if_mgw_conv_srv_runtime~get_logger( ).
  799.  
  800.   IF iv_rfc_dest IS INITIAL OR iv_rfc_dest EQ 'NONE'.
  801.     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  802.       EXPORTING
  803.       wait   = abap_true
  804.     IMPORTING
  805.       return = lt_message.
  806.   ELSE.
  807.     CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  808.       DESTINATION iv_rfc_dest
  809.     EXPORTING
  810.       wait                  = abap_true
  811.     IMPORTING
  812.       return                = lt_message
  813.     EXCEPTIONS
  814.       communication_failure = 1000 MESSAGE lv_message_text
  815.       system_failure        = 1001 MESSAGE lv_message_text
  816.       OTHERS                = 1002.
  817.  
  818.   IF sy-subrc <> 0.
  819.     lv_subrc = sy-subrc.
  820.     /iwbep/cl_sb_gen_dpc_rt_util=>rfc_exception_handling(
  821.         EXPORTING
  822.           iv_subrc            = lv_subrc
  823.           iv_exp_message_text = lv_message_text
  824.           io_logger           = lo_logger ).
  825.   ENDIF.
  826.   ENDIF.
  827.   endmethod.
  828.  
  829.  
  830.   method /IWBEP/IF_SB_DPC_COMM_SERVICES~GET_GENERATION_STRATEGY.
  831. * Get generation strategy
  832.   rv_generation_strategy = '1'.
  833.   endmethod.
  834.  
  835.  
  836.   method /IWBEP/IF_SB_DPC_COMM_SERVICES~LOG_MESSAGE.
  837. * Log message in the application log
  838. DATA lo_logger TYPE REF TO /iwbep/cl_cos_logger.
  839. DATA lv_text TYPE /iwbep/sup_msg_longtext.
  840.  
  841.   MESSAGE ID iv_msg_id TYPE iv_msg_type NUMBER iv_msg_number
  842.     WITH iv_msg_v1 iv_msg_v2 iv_msg_v3 iv_msg_v4 INTO lv_text.
  843.  
  844.   lo_logger = mo_context->get_logger( ).
  845.   lo_logger->log_message(
  846.     EXPORTING
  847.      iv_msg_type   = iv_msg_type
  848.      iv_msg_id     = iv_msg_id
  849.      iv_msg_number = iv_msg_number
  850.      iv_msg_text   = lv_text
  851.      iv_msg_v1     = iv_msg_v1
  852.      iv_msg_v2     = iv_msg_v2
  853.      iv_msg_v3     = iv_msg_v3
  854.      iv_msg_v4     = iv_msg_v4
  855.      iv_agent      = 'DPC' ).
  856.   endmethod.
  857.  
  858.  
  859.   method /IWBEP/IF_SB_DPC_COMM_SERVICES~RFC_EXCEPTION_HANDLING.
  860. * RFC call exception handling
  861. DATA lo_logger  TYPE REF TO /iwbep/cl_cos_logger.
  862.  
  863. lo_logger = /iwbep/if_mgw_conv_srv_runtime~get_logger( ).
  864.  
  865. /iwbep/cl_sb_gen_dpc_rt_util=>rfc_exception_handling(
  866.   EXPORTING
  867.     iv_subrc            = iv_subrc
  868.     iv_exp_message_text = iv_exp_message_text
  869.     io_logger           = lo_logger ).
  870.   endmethod.
  871.  
  872.  
  873.   method /IWBEP/IF_SB_DPC_COMM_SERVICES~RFC_SAVE_LOG.
  874.   DATA lo_logger  TYPE REF TO /iwbep/cl_cos_logger.
  875.   DATA lo_message_container TYPE REF TO /iwbep/if_message_container.
  876.  
  877.   lo_logger = /iwbep/if_mgw_conv_srv_runtime~get_logger( ).
  878.   lo_message_container = /iwbep/if_mgw_conv_srv_runtime~get_message_container( ).
  879.  
  880.   " Save the RFC call log in the application log
  881.   /iwbep/cl_sb_gen_dpc_rt_util=>rfc_save_log(
  882.     EXPORTING
  883.       is_return            = is_return
  884.       iv_entity_type       = iv_entity_type
  885.       it_return            = it_return
  886.       it_key_tab           = it_key_tab
  887.       io_logger            = lo_logger
  888.       io_message_container = lo_message_container ).
  889.   endmethod.
  890.  
  891.  
  892.   method /IWBEP/IF_SB_DPC_COMM_SERVICES~SET_INJECTION.
  893. * Unit test injection
  894.   IF io_unit IS BOUND.
  895.     mo_injection = io_unit.
  896.   ELSE.
  897.     mo_injection = me.
  898.   ENDIF.
  899.   endmethod.
  900.  
  901.  
  902.   method CHECK_SUBSCRIPTION_AUTHORITY.
  903.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  904.     EXPORTING
  905.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  906.       method = 'CHECK_SUBSCRIPTION_AUTHORITY'.
  907.   endmethod.
  908.  
  909.  
  910.   method FLIGHTSET_CREATE_ENTITY.
  911.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  912.     EXPORTING
  913.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  914.       method = 'FLIGHTSET_CREATE_ENTITY'.
  915.   endmethod.
  916.  
  917.  
  918.   method FLIGHTSET_DELETE_ENTITY.
  919.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  920.     EXPORTING
  921.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  922.       method = 'FLIGHTSET_DELETE_ENTITY'.
  923.   endmethod.
  924.  
  925.  
  926.   method FLIGHTSET_GET_ENTITY.
  927.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  928.     EXPORTING
  929.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  930.       method = 'FLIGHTSET_GET_ENTITY'.
  931.   endmethod.
  932.  
  933.  
  934.   method FLIGHTSET_GET_ENTITYSET.
  935.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  936.     EXPORTING
  937.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  938.       method = 'FLIGHTSET_GET_ENTITYSET'.
  939.   endmethod.
  940.  
  941.  
  942.   method FLIGHTSET_UPDATE_ENTITY.
  943.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  944.     EXPORTING
  945.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  946.       method = 'FLIGHTSET_UPDATE_ENTITY'.
  947.   endmethod.
  948.  
  949.  
  950.   method MATERIALSET_CREATE_ENTITY.
  951.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  952.     EXPORTING
  953.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  954.       method = 'MATERIALSET_CREATE_ENTITY'.
  955.   endmethod.
  956.  
  957.  
  958.   method MATERIALSET_DELETE_ENTITY.
  959.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  960.     EXPORTING
  961.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  962.       method = 'MATERIALSET_DELETE_ENTITY'.
  963.   endmethod.
  964.  
  965.  
  966.   method MATERIALSET_GET_ENTITY.
  967.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  968.     EXPORTING
  969.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  970.       method = 'MATERIALSET_GET_ENTITY'.
  971.   endmethod.
  972.  
  973.  
  974.   method MATERIALSET_GET_ENTITYSET.
  975.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  976.     EXPORTING
  977.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  978.       method = 'MATERIALSET_GET_ENTITYSET'.
  979.   endmethod.
  980.  
  981.  
  982.   method MATERIALSET_UPDATE_ENTITY.
  983.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  984.     EXPORTING
  985.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  986.       method = 'MATERIALSET_UPDATE_ENTITY'.
  987.   endmethod.
  988.  
  989.  
  990.   method SALESORGANISATIO_CREATE_ENTITY.
  991.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  992.     EXPORTING
  993.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  994.       method = 'SALESORGANISATIO_CREATE_ENTITY'.
  995.   endmethod.
  996.  
  997.  
  998.   method SALESORGANISATIO_DELETE_ENTITY.
  999.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  1000.     EXPORTING
  1001.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  1002.       method = 'SALESORGANISATIO_DELETE_ENTITY'.
  1003.   endmethod.
  1004.  
  1005.  
  1006.   method SALESORGANISATIO_GET_ENTITY.
  1007. *-------------------------------------------------------------
  1008. *  Data declaration
  1009. *-------------------------------------------------------------
  1010.  DATA iv_sales_org TYPE zif_zt18_fm_get_sales_org_na11=>vkorg.
  1011.  DATA et_sales_org_desc  TYPE zif_zt18_fm_get_sales_org_na11=>zt18tt_sales_organisation.
  1012.  DATA ls_et_sales_org_desc  TYPE LINE OF zif_zt18_fm_get_sales_org_na11=>zt18tt_sales_organisation.
  1013.  DATA lv_rfc_name TYPE tfdir-funcname.
  1014.  DATA lv_destination TYPE rfcdest.
  1015.  DATA lv_subrc TYPE syst-subrc.
  1016.  DATA lv_exc_msg TYPE /iwbep/mgw_bop_rfc_excep_text.
  1017.  DATA lx_root TYPE REF TO cx_root.
  1018.  DATA ls_converted_keys LIKE er_entity.
  1019.  DATA lv_source_entity_set_name TYPE string.
  1020.  DATA lo_dp_facade TYPE REF TO /iwbep/if_mgw_dp_facade.
  1021.  
  1022. *-------------------------------------------------------------
  1023. *  Map the runtime request to the RFC - Only mapped attributes
  1024. *-------------------------------------------------------------
  1025. * Get all input information from the technical request context object
  1026. * Since DPC works with internal property names and runtime API interface holds external property names
  1027. * the process needs to get the all needed input information from the technical request context object
  1028. * Get key table information - for direct call
  1029.  io_tech_request_context->get_converted_keys(
  1030.    IMPORTING
  1031.      es_key_values = ls_converted_keys ).
  1032.  
  1033. * Maps key fields to function module parameters
  1034.  
  1035.  lv_source_entity_set_name = io_tech_request_context->get_source_entity_set_name( ).
  1036.  
  1037.  IF lv_source_entity_set_name = 'SalesOrganisationSet' AND
  1038.     lv_source_entity_set_name NE io_tech_request_context->get_entity_set_name( ).
  1039.  
  1040.    io_tech_request_context->get_converted_source_keys(
  1041.    IMPORTING es_key_values = ls_converted_keys ).
  1042.  
  1043.  ENDIF.
  1044.  
  1045.  iv_sales_org = ls_converted_keys-sales_org.
  1046. * Get RFC destination
  1047.  lo_dp_facade = /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).
  1048.  lv_destination = /iwbep/cl_sb_gen_dpc_rt_util=>get_rfc_destination( io_dp_facade = lo_dp_facade ).
  1049.  
  1050. *-------------------------------------------------------------
  1051. *  Call RFC function module
  1052. *-------------------------------------------------------------
  1053.  lv_rfc_name = 'ZT18_FM_GET_SALES_ORG_NAME'.
  1054.  
  1055.  IF lv_destination IS INITIAL OR lv_destination EQ 'NONE'.
  1056.  
  1057.    TRY.
  1058.        CALL FUNCTION lv_rfc_name
  1059.          EXPORTING
  1060.            iv_sales_org      = iv_sales_org
  1061.          IMPORTING
  1062.            et_sales_org_desc = et_sales_org_desc
  1063.          EXCEPTIONS
  1064.            no_sales_org      = 1
  1065.            no_sales_org_desc = 2
  1066.            system_failure    = 1000 message lv_exc_msg
  1067.            OTHERS            = 1002.
  1068.  
  1069.        lv_subrc = sy-subrc.
  1070. *in case of co-deployment the exception is raised and needs to be caught
  1071.      CATCH cx_root INTO lx_root.
  1072.        lv_subrc = 1001.
  1073.        lv_exc_msg = lx_root->if_message~get_text( ).
  1074.    ENDTRY.
  1075.  
  1076.  ELSE.
  1077.  
  1078.    CALL FUNCTION lv_rfc_name DESTINATION lv_destination
  1079.      EXPORTING
  1080.        iv_sales_org          = iv_sales_org
  1081.      IMPORTING
  1082.        et_sales_org_desc     = et_sales_org_desc
  1083.      EXCEPTIONS
  1084.        no_sales_org          = 1
  1085.        no_sales_org_desc     = 2
  1086.        system_failure        = 1000 MESSAGE lv_exc_msg
  1087.        communication_failure = 1001 MESSAGE lv_exc_msg
  1088.        OTHERS                = 1002.
  1089.  
  1090.    lv_subrc = sy-subrc.
  1091.  
  1092.  ENDIF.
  1093.  
  1094. *-------------------------------------------------------------
  1095. *  Map the RFC response to the caller interface - Only mapped attributes
  1096. *-------------------------------------------------------------
  1097. *-------------------------------------------------------------
  1098. * Error and exception handling
  1099. *-------------------------------------------------------------
  1100.  IF lv_subrc <> 0.
  1101. * Execute the RFC exception handling process
  1102.    me->/iwbep/if_sb_dpc_comm_services~rfc_exception_handling(
  1103.      EXPORTING
  1104.        iv_subrc            = lv_subrc
  1105.        iv_exp_message_text = lv_exc_msg ).
  1106.  ENDIF.
  1107.  
  1108. *-------------------------------------------------------------------------*
  1109. *             - Post Backend Call -
  1110. *-------------------------------------------------------------------------*
  1111. * Map properties from the backend to the Gateway output response structure
  1112.  
  1113.  
  1114. * In GetEntity operation we support only read for the first entry in the response table
  1115.  
  1116.  READ TABLE et_sales_org_desc INTO ls_et_sales_org_desc INDEX 1.
  1117.  er_entity-sales_org_desc = ls_et_sales_org_desc-sales_org_desc.
  1118.  er_entity-sales_org = ls_et_sales_org_desc-sales_org.
  1119.   endmethod.
  1120.  
  1121.  
  1122.   method SALESORGANISATIO_GET_ENTITYSET.
  1123. *-------------------------------------------------------------
  1124. *  Data declaration
  1125. *-------------------------------------------------------------
  1126.  DATA iv_sales_org TYPE zif_zt18_fm_get_sales_org_na11=>vkorg.
  1127.  DATA et_sales_org_desc  TYPE zif_zt18_fm_get_sales_org_na11=>zt18tt_sales_organisation.
  1128.  DATA ls_et_sales_org_desc  TYPE LINE OF zif_zt18_fm_get_sales_org_na11=>zt18tt_sales_organisation.
  1129.  DATA lv_rfc_name TYPE tfdir-funcname.
  1130.  DATA lv_destination TYPE rfcdest.
  1131.  DATA lv_subrc TYPE syst-subrc.
  1132.  DATA lv_exc_msg TYPE /iwbep/mgw_bop_rfc_excep_text.
  1133.  DATA lx_root TYPE REF TO cx_root.
  1134.  DATA lo_filter TYPE  REF TO /iwbep/if_mgw_req_filter.
  1135.  DATA lt_filter_select_options TYPE /iwbep/t_mgw_select_option.
  1136.  DATA lv_filter_str TYPE string.
  1137.  DATA ls_paging TYPE /iwbep/s_mgw_paging.
  1138.  DATA ls_converted_keys LIKE LINE OF et_entityset.
  1139.  DATA ls_filter TYPE /iwbep/s_mgw_select_option.
  1140.  DATA ls_filter_range TYPE /iwbep/s_cod_select_option.
  1141.  DATA lr_sales_org LIKE RANGE OF ls_converted_keys-sales_org.
  1142.  DATA ls_sales_org LIKE LINE OF lr_sales_org.
  1143.  DATA lo_dp_facade TYPE REF TO /iwbep/if_mgw_dp_facade.
  1144.  DATA ls_gw_et_sales_org_desc LIKE LINE OF et_entityset.
  1145.  DATA lv_skip     TYPE int4.
  1146.  DATA lv_top      TYPE int4.
  1147.  
  1148. *-------------------------------------------------------------
  1149. *  Map the runtime request to the RFC - Only mapped attributes
  1150. *-------------------------------------------------------------
  1151. * Get all input information from the technical request context object
  1152. * Since DPC works with internal property names and runtime API interface holds external property names
  1153. * the process needs to get the all needed input information from the technical request context object
  1154. * Get filter or select option information
  1155.  lo_filter = io_tech_request_context->get_filter( ).
  1156.  lt_filter_select_options = lo_filter->get_filter_select_options( ).
  1157.  lv_filter_str = lo_filter->get_filter_string( ).
  1158.  
  1159. * Check if the supplied filter is supported by standard gateway runtime process
  1160.  IF  lv_filter_str            IS NOT INITIAL
  1161.  AND lt_filter_select_options IS INITIAL.
  1162.    " If the string of the Filter System Query Option is not automatically converted into
  1163.    " filter option table (lt_filter_select_options), then the filtering combination is not supported
  1164.    " Log message in the application log
  1165.    me->/iwbep/if_sb_dpc_comm_services~log_message(
  1166.      EXPORTING
  1167.        iv_msg_type   = 'E'
  1168.        iv_msg_id     = '/IWBEP/MC_SB_DPC_ADM'
  1169.        iv_msg_number = 025 ).
  1170.    " Raise Exception
  1171.    RAISE EXCEPTION TYPE /iwbep/cx_mgw_tech_exception
  1172.      EXPORTING
  1173.        textid = /iwbep/cx_mgw_tech_exception=>internal_error.
  1174.  ENDIF.
  1175.  
  1176. * Get key table information
  1177.  io_tech_request_context->get_converted_source_keys(
  1178.    IMPORTING
  1179.      es_key_values  = ls_converted_keys ).
  1180.  
  1181.  ls_paging-top = io_tech_request_context->get_top( ).
  1182.  ls_paging-skip = io_tech_request_context->get_skip( ).
  1183.  
  1184. * Maps filter table lines to function module parameters
  1185.  LOOP AT lt_filter_select_options INTO ls_filter.
  1186.  
  1187.    LOOP AT ls_filter-select_options INTO ls_filter_range.
  1188.      CASE ls_filter-property.
  1189.        WHEN 'SALES_ORG'.
  1190.          lo_filter->convert_select_option(
  1191.            EXPORTING
  1192.              is_select_option = ls_filter
  1193.            IMPORTING
  1194.              et_select_option = lr_sales_org ).
  1195.  
  1196.          READ TABLE lr_sales_org INTO ls_sales_org INDEX 1.
  1197.          IF sy-subrc = 0.
  1198.            iv_sales_org = ls_sales_org-low.
  1199.          ENDIF.
  1200.        WHEN OTHERS.
  1201.          " Log message in the application log
  1202.          me->/iwbep/if_sb_dpc_comm_services~log_message(
  1203.            EXPORTING
  1204.              iv_msg_type   = 'E'
  1205.              iv_msg_id     = '/IWBEP/MC_SB_DPC_ADM'
  1206.              iv_msg_number = 020
  1207.              iv_msg_v1     = ls_filter-property ).
  1208.          " Raise Exception
  1209.          RAISE EXCEPTION TYPE /iwbep/cx_mgw_tech_exception
  1210.            EXPORTING
  1211.              textid = /iwbep/cx_mgw_tech_exception=>internal_error.
  1212.      ENDCASE.
  1213.    ENDLOOP.
  1214.  
  1215.  ENDLOOP.
  1216.  
  1217. * Get RFC destination
  1218.  lo_dp_facade = /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).
  1219.  lv_destination = /iwbep/cl_sb_gen_dpc_rt_util=>get_rfc_destination( io_dp_facade = lo_dp_facade ).
  1220.  
  1221. *-------------------------------------------------------------
  1222. *  Call RFC function module
  1223. *-------------------------------------------------------------
  1224.  lv_rfc_name = 'ZT18_FM_GET_SALES_ORG_NAME'.
  1225.  
  1226.  IF lv_destination IS INITIAL OR lv_destination EQ 'NONE'.
  1227.  
  1228.    TRY.
  1229.        CALL FUNCTION lv_rfc_name
  1230.          EXPORTING
  1231.            iv_sales_org      = iv_sales_org
  1232.          IMPORTING
  1233.            et_sales_org_desc = et_sales_org_desc
  1234.          EXCEPTIONS
  1235.            no_sales_org      = 1
  1236.            no_sales_org_desc = 2
  1237.            system_failure    = 1000 message lv_exc_msg
  1238.            OTHERS            = 1002.
  1239.  
  1240.        lv_subrc = sy-subrc.
  1241. *in case of co-deployment the exception is raised and needs to be caught
  1242.      CATCH cx_root INTO lx_root.
  1243.        lv_subrc = 1001.
  1244.        lv_exc_msg = lx_root->if_message~get_text( ).
  1245.    ENDTRY.
  1246.  
  1247.  ELSE.
  1248.  
  1249.    CALL FUNCTION lv_rfc_name DESTINATION lv_destination
  1250.      EXPORTING
  1251.        iv_sales_org          = iv_sales_org
  1252.      IMPORTING
  1253.        et_sales_org_desc     = et_sales_org_desc
  1254.      EXCEPTIONS
  1255.        no_sales_org          = 1
  1256.        no_sales_org_desc     = 2
  1257.        system_failure        = 1000 MESSAGE lv_exc_msg
  1258.        communication_failure = 1001 MESSAGE lv_exc_msg
  1259.        OTHERS                = 1002.
  1260.  
  1261.    lv_subrc = sy-subrc.
  1262.  
  1263.  ENDIF.
  1264.  
  1265. *-------------------------------------------------------------
  1266. *  Map the RFC response to the caller interface - Only mapped attributes
  1267. *-------------------------------------------------------------
  1268. *-------------------------------------------------------------
  1269. * Error and exception handling
  1270. *-------------------------------------------------------------
  1271.  IF lv_subrc <> 0.
  1272. * Execute the RFC exception handling process
  1273.    me->/iwbep/if_sb_dpc_comm_services~rfc_exception_handling(
  1274.      EXPORTING
  1275.        iv_subrc            = lv_subrc
  1276.        iv_exp_message_text = lv_exc_msg ).
  1277.  ENDIF.
  1278.  
  1279. *-------------------------------------------------------------------------*
  1280. *             - Post Backend Call -
  1281. *-------------------------------------------------------------------------*
  1282.  IF ls_paging-skip IS NOT INITIAL.
  1283. *  If the Skip value was requested at runtime
  1284. *  the response table will provide backend entries from skip + 1, meaning start from skip +1
  1285. *  for example: skip=5 means to start get results from the 6th row
  1286.    lv_skip = ls_paging-skip + 1.
  1287.  ENDIF.
  1288. *  The Top value was requested at runtime but was not handled as part of the function interface
  1289.  IF  ls_paging-top <> 0
  1290.  AND lv_skip IS NOT INITIAL.
  1291. *  if lv_skip > 0 retrieve the entries from lv_skip + Top - 1
  1292. *  for example: skip=5 and top=2 means to start get results from the 6th row and end in row number 7
  1293.    lv_top = ls_paging-top + lv_skip - 1.
  1294.  ELSEIF ls_paging-top <> 0
  1295.  AND    lv_skip IS INITIAL.
  1296.    lv_top = ls_paging-top.
  1297.  ELSE.
  1298.    lv_top = lines( et_sales_org_desc ).
  1299.  ENDIF.
  1300.  
  1301. *  - Map properties from the backend to the Gateway output response table -
  1302.  
  1303.  LOOP AT et_sales_org_desc INTO ls_et_sales_org_desc
  1304. *  Provide the response entries according to the Top and Skip parameters that were provided at runtime
  1305.       FROM lv_skip TO lv_top.
  1306. *  Only fields that were mapped will be delivered to the response table
  1307.    ls_gw_et_sales_org_desc-sales_org_desc = ls_et_sales_org_desc-sales_org_desc.
  1308.    ls_gw_et_sales_org_desc-sales_org = ls_et_sales_org_desc-sales_org.
  1309.    APPEND ls_gw_et_sales_org_desc TO et_entityset.
  1310.    CLEAR ls_gw_et_sales_org_desc.
  1311.  ENDLOOP.
  1312.  
  1313.   endmethod.
  1314.  
  1315.  
  1316.   method SALESORGANISATIO_UPDATE_ENTITY.
  1317.   RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
  1318.     EXPORTING
  1319.       textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
  1320.       method = 'SALESORGANISATIO_UPDATE_ENTITY'.
  1321.   endmethod.
  1322. ENDCLASS.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement