on 08-24-2016 5:36 AM
Hi,
I want to pass the list of work orders on click of a button.
For example :
435435
545456
654454
656565
545454
656454
434354
435454
324343
As input, I want these values in the gateway service.
Is it possible?
Or the way to do it is use create_deep_entity?
Thanks and Regards,
Gopa
Hello Kumar,
Pass all those inputs as filter parameters as shown below in the URL.
You will receive all these as part of select options internal table.
Sample ->
/sap/opu/odata/sap/Z_SRV/WorkOrders?$filter=( OrderNumber eq '0001' or OrderNumber eq '0002' or OrderNumber eq '0003' or OrderNumber eq '0004' )&$expand=WorkOrderDetails
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Inside /iwbep/if_mgw_appl_srv_runtime~get_expanded_entityset , Navigation Property to be send back in Upper Case as below.
Example -> where WorkOrderDetails is your Navigation Property.
/sap/opu/odata/sap/Z_SRV/WorkOrders?$filter=( OrderNumber eq '0001' or OrderNumber eq '0002' or OrderNumber eq '0003' or OrderNumber eq '0004' )&$expand=WorkOrderDetails
INSERT 'WORKORDERDETAILS' INTO TABLE et_expanded_tech_clauses.
Check this please.
Hi,
The requirements for me changed though. I had to get it on the basis of organizational unit. So organizational unit is passed to the filter and the got the values instead of getting the work orders.
However, passing huge URI strings is not a good idea. We can implement it through POST and sending the work orders in a batch...
The service would look like.... sap/..../ServiceName/$batch....
For more information refer the link below...
Regards,
Gopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashwin,
Issue resolved.
The abap field name was incorrect in the navigation property as I earlier changed the relationship name and entity and entity set names.
So passing the values into the filter is an only option currently.
I wish we could pass an array or an object.
I will close the thread day after tomorrow.
Thank you for the suggestions.
Regards,
Gopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Model
Entity
1) WorkOrderHeader - WorkOrder
2) WorkOrderItem - WorkOrder, Operation1 , Operation2
EntitySets
1) WorkOrderHeaderSet
2) WorkOrderItemSet
Referential Constraints
Principal Entity = WorkOrderHeader
Principal Key = WorkOrder
Dependent Entity = WorkOrderItem
Dependent Property = WorkOrder
Association Name = WorkOrderHeaderToItem
Cardinality is 1:M
URL =
/sap/opu/odata/sap/ZWORK_ORDER_SRV/WorkOrderHeaderSet?$filter=(WorkOrder eq '820579' or WorkOrder eq '820578')&$expand=WorkOrderHeaderToItem&$format=json
Regards,
Gopa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.