Skip to Content
0

Implement READ value from backend and retreive it!

Oct 26, 2016 at 09:57 AM

71

avatar image
Former Member

Hi everyone,

I’m starting to feel a little discouraged. I’m trying to send some data to the backend, make a selection and send results back to SAPUI5. For that I’ve redefined methods in the backend to achieve this.

I’ve redefined method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY so I can call method HEADERPOINTS_GET_ANTITY. Everything seems to be fine since I’m able to debug my code and check my READ statement goes through both methods (selects all the data I need and puts it in ER_ENTITY) and go back to SAPUI5.

My problem comes at this point. There must be something wrong with my code since I cannot read any result. I’ve used basically the same code I used for a GET_ENTITYSET (which worked!) but something is not working properly in this GET_ENTITY case. Here’s a screenshot of my SAPUI5 routine:

Can anybody help me?

f6249dd.jpg (108.7 kB)
10 |10000 characters needed characters left characters exceeded

what you have in the odata in the success function callback?

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Ryan Crosby Oct 26, 2016 at 12:25 PM
0

Hi,

Have you tried setting debug points for the success and error functions? Would be curious to know what exists for either oData or oError depending on what happens with the service call. Also, instead of constructing the URL yourself you can set the base URL for the "/HeaderPointsSet" and then add filters for the other values.

Regards,

Ryan Crosby

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 26, 2016 at 03:31 PM
0

First of all, I'd like to thank you both for your help!

I've finally come out with “something” which works and retrieves my values. In fact, it does the same as before (runs through all methods in backend) but now when I go back to SAPUI5 I can see my values. Now I just need to show them in my controller view: one in a “Label” and the other in a “Text”. Let’s how I figure it out.

Thanks again for your patience!


316657ca.jpg (218.4 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi,

If you are now getting data back in your success callback then it's just a matter of how you are binding the data to the view. Looks like your label and your text simply need to be bound to "{/TEXTO}" and "{/VALOR}" (not sure which is which) and once the model is updated then it should reflect in the view.

Regards,

Ryan Crosby

0
Former Member
Ryan Crosby

I finally came out with this:

Make data available in view:

this.getView().setModel(oHeaderCheckboxModel, "HeaderCheckbox");

Show data in view:

text="{HeaderPoints>/TEXTO}"

text="{HeaderPoints>/VALOR}"

Many thanks for your help!

:-)

0