on 05-18-2015 11:54 AM
Hi all
I have created 3 entities: Message, Client and Author. Message is associated with both, Client and Author as 1:1.
The navigation to Author is done by custom code within the method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITYSET of *DPC_EXT class. At the end of the code the corresponding clause 'AuthorExp' (in upper case) is added to et_expanded_tech_clauses table.
Both single $expand requests to Author and Client are processed properly. The difference is that the expand to Author is done once within GET_EXPANDED_ENTITYSET method and the expand to Client - by calling CLIENTSET_GET_ENTITY as much times as there are records received for Message entity set.
The problem starts if I use both expands in one request, i.e. $expand=AuthorExp,ClientExp.
Within /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITYSET method er_entityset is filled by the data for Message and Author. et_expanded_tech_clauses table is filled by 'AUTHOREXP'. Then the process goes back to /IWBEP/CL_MGW_ABS_DATA -> READ_EXPANDED_ENTITYSET and via the method EXPAND_ENTITY calls READ_EXPANDED_ENTITY for every child (expand). And there is a check here:
IF io_expand_node->is_expanded( ) NE abap_true.
which unexpectedly gives us abap_false, instead of abap_true and the AUTHORSET_GET_ENTITY is called. So the question is why, although this clause is reported as already expanded?
Hi Folks,
is there any new insight on this?
I experience a similar problem, but in my case I just use one simple expand attribute (not a list).
I face two problems here
ls_expanded_clause = 'TOCHARACTERISTICS'.
append ls_expanded_clause to et_expanded_tech_clauses.
But still the GET_ENTITYSET Method for the Characterisitcs entitiy is called.
Both notes (2001852 and 2163713) are already installed without any affect.
Has anybody raised a ticket so far about this issue?`
Cheers
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Short update:
using the obsolete method and tables works:
lv_compare_result_cfg_chars = io_expand->compare_to( 'ToCharacteristics' ). ' returns 'E'
...
ls_expanded_clause = 'ToCharacteristics'.
append ls_expanded_clause to et_expanded_clauses. n
-> not CHARACTERISTIC_GET_ENTITYSET is called
Cheers
Sebastian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please check notes http://service.sap.com/sap/support/notes/2001852 and http://service.sap.com/sap/support/notes/2163713
These notes might solve the problem.
Regards,
Chandra
Thank you, Chandrashekhar, I'll apply and check the situation.
I'm afraid that both notes don't change the result of the check within MARK_AS_EXPANDED_TECH_NAMES:
IF LINES( mt_children ) EQ LINES( lt_foreign_children ).
In my case, mt_chidren contains both AUTHOREXP and CLIENTEXP, but lt_foreign_children - AUTHOREXP only (according to /IWBEP/IF_MGW_ODATA_EXPAND - SAP NetWeaver Gateway - SAP Library). So the check simply throws us out of the method not setting that the expand is already handled.
Applied and everything goes as I predicted:
if ET_EXPANDED_TECH_CLAUSES contains AUTHOREXP only - both AUTHORSET_GET_ENTITY and CLIENTSET_GET_ENTITY are called and exception is raised.
if ET_EXPANDED_TECH_CLAUSES contains both AUTHOREXP and CLIENTEXP - no one *GET_ENTITY is called and ClientExp is empty in the output.
Hello Andrei,
When you fire as &$expand=AuthorExp,ClientExp,
You need to append both the Navigation Properties AUTHOREXP and CLIENTEXP to et_expanded_tech_clauses.
Please check the above once.
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I remove the referential constrain nothing is passed to CLIENTSET_GET_ENTITY.
Just for the interest I've made an experiment - ClientExp is empty.
The point is that Author entity is filled by the code of /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITYSET, but Client - by its common CLIENTSET_GET_ENTITY. If both expand clauses are passed to ET_EXPANDED_TECH_CLAUSES, then CLIENTSET_GET_ENTITY is not called at all. If just AUTHOREXP - SAP calls both CLIENTSET_GET_ENTITY and AUTHORSET_GET_ENTITY, which gives an error as there is just RAISE EXCEPTION within AUTHORSET_GET_ENTITY.
After you handle expand, this time you need to have two entries in the et_expanded_tech_clauses . Do you have it?
This link will be useful.
/IWBEP/IF_MGW_ODATA_EXPAND - SAP NetWeaver Gateway - SAP Library
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've read it carefully before:
It returns MATCH_SUBSET if you call COMPARE_TO_TECH_NAME( IV_EXPAND = 'PRODUCTS' ) - which is the indicator that you can return a table of categories in which every category entry has a 'PRODUCTS table component. The Supplier relation is in this case further expanded generically by the framework. Exporting parameter ET_EXPANDED_TECH_CLAUSES of GET_EXPANDED_ENTITY / GET_EXPANDED_ENTITYSET needs then to contain one entry 'PRODUCTS' to tell the framework that this expression has already been handled by the application.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.