on 08-21-2015 12:53 AM
Hi,
Am new to Odata world and i have following scenario and would like to know how to achieve it.
Structure-1 - ProductionOperationConfirmation
Structure-2 - GoodsMovement
Create below objects and their Associations as well..
Entity Type-1- ProductionOperationConfirmation
Entity Type-2- GoodsMovement
Entity Set-1- ProductionOperationConfirmations
Entity Set-2- GoodsMovements
By standard definition following URI works fine:
/sap/opu/odata/sap/ZPP_PRODOPS_CONFIRM_SRV/ProductionOperationConfirmations('0000000357')/GoodsMovements
It retrives me the list of components, for the given Confirmation# - this is for 2 separate views on UI (standard app)
But my intention is to get detail for a given Confirmation# along with table of all Components assigned to it in one go:
the simple reason being i would like to see both these data on a single view for my UI design.
/sap/opu/odata/sap/ZPP_PRODOPS_CONFIRM_SRV/ProductionOperationConfirmations('0000000357')?$expand=GoodsMovements
Reading through several blogs here, i started by using METHOD /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY
I could populate the Confirmation and the said components list here but upon final output on the gatewayclient all i see is the ProductionOperationConfirmation alone without any GoodsMovements data (attachment ouptut.txt).
Is my scenario even valid or where am i going wrong in the approach ?
Appreciate all help...
Thanks,
Ram
In your response I can see an an empty inline feed. This can be achieved by two ways
Option 1: Do not implement method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY( ). Id you have correctly implemented a read for 'ProductionOperationConfirmations' and a query for 'GoodsMovements', framework will call the methods and will return you the data.
Option 2: If you have explicitly implemented IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY( ) then you need to write custom logic o populate the data in nested structure. The nested structure will be having all the properties from entity 'ProductionOperationConfirmations' with an extra field called 'GoodsMovements'(navigation property name), the type of field GoodsMovements would be an internal table of 'GoodsMovements'.
Next you have to pass the NavigationPropertyName to parameter 'ET_EXPANDED_TECH_CLAUSES' to tell the framework that you have done the expand on your own and no framework attention needed.
I would say debug the method and check if you are sending the correct data in correct format .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atanu,
You are right, I have done the same on method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY and yet not getting the table in the final output (same attachment).
In debug mode i could see the table populated with 6 entries but on the output as you see the table is not even displayed. The URI goes like this -- /sap/opu/odata/sap/ZPP_PRODOPS_CONFIRM_SRV/ProductionOperationConfirmations('0000000357')?$expand=GoodsMovements
And also can i achieve the expected result directly for my URI: /sap/opu/odata/sap/ZPP_PRODOPS_CONFIRM_SRV/ProductionOperationConfirmations('0000000357')?????
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.