on 12-30-2014 6:18 AM
Hi,
I am facing problem with filter criteria for child entity. Let me give you an example.
There are 2 entity types:
1. Order
2. OrderItem
I have created the association between these 2 entities. Order entity is parent entity and OrderItem is child entity.
I have implemented the GET_ENTITYSET for OrderItem entity.
I am trying to call the GET method with filter parameter.
For Example:
OrderCollection('100000008212')/OrderItemCollection?filter=Rate gt 100
Following is the default code in GET_ENTITYSET to convert the select option to internal table.
WHEN 'RATE'.
lo_filter->convert_select_option(
EXPORTING
is_select_option = ls_filter
IMPORTING
et_select_option = lr_rate ).
READ TABLE lr_rate INTO ls_rate INDEX 1.
IF sy-subrc = 0.
lv_rate = ls_rate-low.
ENDIF.
I am getting the "Rate" filter value in lo_filter variable but lo_filter->convert_select_option() is not returning the internal table. I have debugged the lo_filter->convert_select_option() method and found that it is checking properly 'Rate' with Order entity properties.
'Rate' property is only available in OrderItem Entity not in Order Entity so that why lo_filter->convert_select_option() not returning internal table.
I am just wondering why they are only comparing the filter property of child entity with parent entity properties. Any Idea??
Regards,
Vikram
Please refer to Note
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vikram,
Yes -Try to implement Atun mentioned above SAP Note.
Thanks,
Syam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As an alternative approach you can also use the following URI pattern
/OrderItemCollection?filter=Rate gt 100 & OrderId = '100000008212'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.