cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP RAP - Service binding issue - no data when launching ADT preview for a node

8,978

Hello,

Hope someone can help me as I'm losing my mind trying to solve this. I go through the openSAP course about RAP and I'm stuck at week 2 unit 6.

Basically when I'm launching a preview for my service binding when I click the 'Go' button on the Fiori app screen I get no data in the Fiori app preview for the 'Travel' node no matter what. I open the browser console and I see the following errors (unable to paste screenshots here):

Assertion failed: PropertyType for property  of EntityType TravelType not found!

2021-10-31 19:17:24.037399 'HTTP request failed' while processing GET Travel?sap-client=100&$skip=0&$top=20&$orderby=%20desc&$select=TravelId%2cAgencyId%2cAgencyName%2cCustomerId%2cCustomerName%2cBeginDate%2cEndDate%2cBookingFee%2cCurrencyCode%2cTotalPrice%2cDescription%2cTravelStatus%2cTravelUuid&$inlinecount=allpages - {"statusCode":"400","statusText":"Bad Request","headers":{"Content-Type":"application/json","Content-Length":"580","DataServiceVersion":"1.0"},"body":"{\"error\":{\"code\":\"005056A509B11EE1B9A8FEA8DE87F78E\",\"message\":{\"lang\":\"en\",\"value\":\"Property desc not found in type TravelType\"},\"innererror\":{\"transactionid\":\"190D2E2495FD0050E00617E9E2D0195C\",\"timestamp\":\"20211031181723.3380670\",\"Error_Resolution\":{\"SAP_Transaction\":\"For backend administrators: use ADT feed reader \\\"SAP Gateway Error Log\\\" or run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details\",\"SAP_Note\":\"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)\"}}}}"} sap.ui.model.odata.v2.ODataModel

First of all I don't know what is TravelType mentioned in there. Such thing doesn't exist in any element I created starting from the DB table up to Metadata Extensions for CDS Projection views.

I see the data in ADT when I launch the related CDS view, so no issue here, but not in the UI.

What can I do to fix this? I checked all the objects source code, compared to the ones in github and everything's fine

Is there a way to debug this somehow?

How to analyze this in SAP BTP? I only have eclipse ADT and no SAP GUI access as otherwise I'd love to check some Gateway objects, but with ADT I'm walking in the dark having no clue how this whole thing works and where to look for errors.

Any help will be much appreciated. HELP!

andre.fischer I saw you helped someone here regarding an issue with the flight app (https://answers.sap.com/questions/13504730/abap-rap-odata-v4-draft-flight-demo-test.html) - maybe you'll be able to help me as well. Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I'm gonna leave some answer here for the ones who seek solution to the same problem.

First of all - the problem seems to be browser-dependant. Apparently ADT Fiori app preview is not compatilble with MS Edge which I don't use, but it's launched by ADT, so I used it only for the preview function. I just learned this today. In Google Chrome everything is working fine.

NOTE to SAP: unbelievable that depending on a browser a user/developer may get such unexpected results. I was able first to overcome/workaround the issue by creating my own view variant in the UI with default sorting order as per CDS Metadata Extensions (/presentationVariant: [{ sortOrder:). This solved it for me. I was not able to get any data with the default STANDARD variant, but with my own I did get it. However this fix was working only util Week 3 Unit 3 of the openSAP course where the CDS behaviours were introduced. When I added all the behaviour definitions for the CDS Travel Entity and CDS Travel Consumption view - it got even worse. I did get the Create/Delete buttons on screen, but I could no longer see any data when I pressed the OK button. My variant also didn't help in this case. But it got even worse! When pressing the 'Go' button to read the Travel data - shortdumps were generated in the BTP backend! I felt it's hopeless and was extremly disappointed that I'm not even able to have such a basic app/scenario working and thus finish the openSAP course... I revoked the behavior definitions, previewed again, but surprisingly I was getting the same short dumps related to the behaviour and no data. Then I switched to Google Chrome and made a preview in there - and it instantly worked even withour my own variant! I readded the behavior definitions and made another preview and it worked - I got the data, the create button worked and everything else as well. I find it very weird and I think the whole SAP UI5 is prone to errors caused by ADT/BTP itself (the generated code that runs in the backend). And the worst thing is that the dev has no control or any way to analyze this properly (where's the good, old, debuggable ABAP dev gone...)

EDIT: it turned out to be related to browser-caching issue! It works even in Edge. I opened the preview in incognito/Inprivate mode in Edge, logged in and it all works fine! Unbelievable. Clear your browser cache when using ADT, people! Or use the InPrivate / incognito mode during the development process when something isn't working as otherwise you'll loose your mind, time...and hair (if you still have it 😉 )

Maybe it's obvious for all the modern react etc UI devs out there, but wasn't for me - an old school SAP NW backend ABAP dev.

Hopefully this will be helpful for somebody in the future.

0 Kudos

Hello,

Glad that you finally solved this for you. I followed your comment but for me didn't work. I tried every browser that I have installed, I cleared everything in the browser, but I still can't see any data. Like you I can see the data in the CDS but not the UI.

Looks like I'm having exactly the same issue you had, even the error message that you pasted is the same, but for me clearing browser cache didn't work.

Does anyone had this issue or has any idea how to solve this? I'm going mad that I can't follow one simple openSAP course.

Thanks in advance

@ Carlos - try my workaround with a custom variant. Maybe it will help.

To me this whole RAP concept is not fully well developed. Maybe it's just because it's in early stage and will improve. But currently it gives huge headaches sometimes. The old ABAP programming was easy to predict with regards to results. It either works or not. If it didn't it was rather easy to say why it didn't work.Here with RAP you can have all compiled, no warnings or errors and get dumps for no obvious reason. This is unacceptable to me. And it's very difficult to find out where the problem is.

From programmer point of view the RAP model is not friendly and not easy to use. And is very prone to errors.

0 Kudos

Thanks a lot @Grzegorz,

Using a custom variant solved that. I can finally see my data in the UI. I wonder how long did it take you to discover this.

It's very hard to don't have any errors in the code, no easy way to debug and still can't see the UI as we intended. I agree with you that RAP is only taking the first steps but it has a long way ahead if this is the future. I know I'm still in the beginning of learning RAP but for now, I don't find this neither easy or friendly.

0 Kudos

I can't remember exactly how did I discover the variant solution. It was already 1.5 months ago, but when I said I'm loosing my midn - I really meant it. I spent long hours trying to find what the problem is. I explored the error console in the browser as I was looking anything that coudl indicate what the problem is .I guess I discovered something about sorting,so I deleted the annotation about sorting in the CDS definition and I guess it did help. But I wanted to have the UI as in the training, so I came up with my variant and I set the sorting order as per the CDS view definition. But as I wrote - this solve my issue until Week3 Unit 3 and after I introduced the behaviour definition - nothing helped. I was close to give up on this as I spent long hours and found nothing pointing to the cause.

I was also frustrated that noone from SAP is monitoring the forum and there's nowhere to get help from. Fortunately I tried the different browser which sorted it for me.

I fully agree - RAP has a loooong way ahead to be fully developed and more intuitive. Generated code (RAP CDS definitions actually translate into generated ABAP objects) is good as long as it doesn't cause issues. This RAP framework must be easier to analyze and debug. The fact that I can debug doesn't help much as the RAP internal code is very complicated and it's realy hard to connect the dots and translate BDL, EML and other CDS *Ls to ABAP and understand the issue. The bad thing is that you may easily make a mistake e.g. in a BDL, it will compile, but you'll be getting dumps because something isn't 100% correctly definedas per RAP rules and ADT doesn't show any errors for this. Additionally there's a new layer ABAP developers didn't have to worry before - the browser client and its weaknesses.

Glad it solve it for you. Hopefully you won't have other issues of this kind going forward with the course. I'm already after week 4 and since week 3 I did not experience any additional issues. I've got the last course week in front of me. I guess week 3 is the worst one as it introduces a lot of new things and concepts into play.

Answers (2)

Answers (2)

kyo_choi2
Participant
0 Kudos

I had same issue and following your advice, I changed the sort by a random field and the issue disappeared.

Naveen13k
Newcomer

Hi,

If you're reading this, I faced the same issue as you, and it did work after commenting  "sort".

But I was curious why a function like sort would cause any issue. So, I re-checked my code (metadata extension) and found that in Sort I was giving Sort Order by TravelID, whereas the element name is TravelId (lowercase d). with this change I was able to fix the issue and the app is now running with sort. I recommend anyone facing the issue recheck the element names with the CDS fields.

Regards,

N'vn

berk_ozturk
Newcomer
0 Kudos
Hello Everyone, @Naveen13k like said .It's sort parameter problem if you change sort parameter or " presentationVariant: [{ sortOrder: [{ by: 'TravelId', direction: #ASC }] }] } " change parameter TravelID -> TravelId. You can solve like this.
piyush129
Newcomer
0 Kudos
It was travelId thing..no browser issue
RolandKramer
Active Contributor
0 Kudos

Hello

Please Note also, that with SAP GUI 7.70 and the latest Version of HANA Studio/ADT IE11 is not supported/recommended anymore.

See the Blog – SapMachine and SAP HANA Studio

Best Regards Roland

salahalhaddabi
Discoverer
0 Kudos
Really Weird guys. The variant also solved my issue.