-
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathExpand
More file actions
39 lines (33 loc) · 2.11 KB
/
Copy pathExpand
File metadata and controls
39 lines (33 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
*===================data declarations for the expand strucutre===================================================
TYPES: BEGIN OF lty_s_workorder.
INCLUDE TYPE zcl_zworkorder_mpc=>ts_workorderdetail.
TYPES: components TYPE STANDARD TABLE OF zcl_zworkorder_mpc=>ts_component WITH DEFAULT KEY,
operations TYPE STANDARD TABLE OF zcl_zworkorder_mpc=>ts_operation WITH DEFAULT KEY,
damagecodegroups TYPE STANDARD TABLE OF zcl_zworkorder_mpc=>ts_damagecodegroup WITH DEFAULT KEY,
notificationunits TYPE STANDARD TABLE OF zcl_zworkorder_mpc=>ts_unit WITH DEFAULT KEY.
TYPES: END OF lty_s_workorder.
*=======Getting key for GET_EXPANDED_ENTITY======================================================================
DATA: lt_keys TYPE /iwbep/t_mgw_tech_pairs,
ls_key TYPE /iwbep/s_mgw_tech_pair,
lv_entity_name TYPE /iwbep/mgw_tech_name.
* Get entityset name
lv_entity_name = io_tech_request_context->get_entity_type_name( ).
lt_keys = io_tech_request_context->get_keys( ).
READ TABLE lt_keys INTO ls_key WITH KEY name = 'ORDERNUMBER'.
CHECK sy-subrc EQ 0.
*============Send Data back======================================================================================
copy_data_to_ref(
EXPORTING
is_data = laborentries_get_entity
CHANGING
cr_data = er_entity
).
*============"Tell the framework that all required fecthing is done and not to do generic expand. ===============
DATA: lo_request TYPE REF TO /iwbep/cl_mgw_request.
lo_request ?= io_tech_request_context.
DATA(lv_expand) = lo_request->/iwbep/if_mgw_req_entityset~get_expand( ).
TRANSLATE lv_expand TO UPPER CASE.
SPLIT lv_expand AT ',' INTO TABLE et_expanded_tech_clauses.
//Note: For the above code to work, "ABAP Field Name"of the Navigation properties have to be same (Uppercase)
//as the navigation property name (in SEGW).
*=================================================================================================================