on 08-15-2018 7:53 PM
Hi,
I have a main CDS view that selects all the fields I may need at some point. I also have another (subsequent) CDS view selecting just some fields from the main view.
Main view:
Subsequent View:
Now I'm trying to create an AMDP based on the second view. The problem is that I get a "return type mismatch" error as the compiler seems to get the returning structure from the main, not from the subsequent view.
All comments are welcome.
Thanks, Marcos.
The error message should be quite clear, or not? The result structure prepared by your select/apply_filter does match the required type defined by the type of your AMDP exporting parameter ET_RESERVATIONS with type ZTTMM_ODATA_HEADER. The pepared result needs to have the same structure (same field names, same types). Either you remove the fields for which no value is provided in the result or you adjust your result to match the expected export structure.
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Florian.
The main view has an additional field, ResNum, which isn't present in the subsequent view. Nevertheless, the structure of the subsequent view and the structure of ZTTMM_ODATA_HEADER is exactly the same.
And every time I add a field to the main view and try to activate the AMDP, the added field is displayed in the error log. It seems to me that the AMDP is comparing the structure of main view to ET_RESERVATIONS, instead of comparing the subsequent view to ET_RESERVATIONS.
It doesn't make sense as I am not selecting from the main view directly, does it?
Thanks, Marcos.
Thank you, Florian. You found the issue.
I was sure the table type was pointing to a local structure but it was actually pointing to the main view. I must have changed it at some point in time and forgot about it. That explains why adding new fields caused the problem.
Now the table type is pointing to a correct structure and problem is gone.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.