Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to save data in localized field through POST call

rohit_dwivedi1
Discoverer
0 Kudos

Hi Team,

We are trying to use localized field as mentioned in below doc
https://cap.cloud.sap/docs/guides/localized-data

As mentioned in doc, we have just created a localized field similar to Books

Actual one is below
entity QuickLinks {

key QUICKLINK_ID : UUID;
quickLink_name : localized String not null;}

And exposed a service which has projection on Quicklinks entity
using {sap.acs.app as acs} from '../../db/';
service QuickLinksService @(requires: 'ESC_ServicePlanner'){

entity quickLink as projection on acs.QuickLinks;
};

Our understanding after reading doc is that we don't have to do anything else if we just want to support POST and GET on this entity.
But when i am trying to do a Post call , data is not inserting in the _Text table for German language .
It always goes in QuickLinks table instead of going to QuickLinks_text table

below is the rest call

### German Create Link

POST http://localhost:8080/api/QuickLinksService/quickLink?&sap-language:de HTTP/1.1
Authorization: Basic admin admin
Content-Type : application/json
Accept-Language: "de


Can you please help us to know if we need to do some custom logic in handlers or if there is something wrong in our understanding

Regards
Rohit

  • SAP Managed Tags:
1 REPLY 1

rohit_dwivedi1
Discoverer
0 Kudos

I analyzed it further.
Seems, insert has to be taken care explicitly. Either through CSV or through persistence service in handlers we need to insert data.

Get is taken care implicitly by CAP.

  • SAP Managed Tags: