cancel
Showing results for 
Search instead for 
Did you mean: 

Missing new field in OData Parent Metadata from SEGW project redefine extension

katherine_fong
Explorer
0 Kudos

In SEGW, there is a pre-existing project redefined for HCM_TIMESHEET_APPROVE_SRV. A new field was previously added and is working. A second field was added to this redefined OData Service. The metadata is correct for the redefined service. The metadata for HCM_TIMESHEET_APPROVE_SRV does not include the second field defined, but does include the first new field.

The new second field is working correctly in the backend ABAP code, and the data for new second field is seen in the entityset.

But the front end does not show the new second field.

We tried /iwbep/cache_cleanup and /iwfnd/cache_cleanup. This did not refresh the parent metadata.

How can we refresh the parent service to show the new field?

Accepted Solutions (0)

Answers (4)

Answers (4)

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

@tswami67

When you add a field to your CDS view and right-click on the entity set and choose "import properties", add the mapping again and regenerate the runtime artifacts it should usually work.

If not, open a ticket.

Sorry that I can't do more.

Best Regards,

Andre

katherine_fong
Explorer
0 Kudos

As per Andre's response, I went into SAP Web IDE and added the OME - OData Model Editor from the Workspace Preferences --> Extensions. I turned "ON" OData Model Editor.

I went to File -> New -> OData Service.

Now under my pre-existing extension project, I have the folder - "model". In this folder, I see the metadata.xml

Can I edit this file to put in my second new field?

katherine_fong
Explorer
0 Kudos

Just to clarify, when we created the Extension Redefine in SEGW last year - we selected "Extend Current Model". We did not select "Overwrite Current Model".

We did select "Overwrite Base/Extended Service".

I expected the metadata for the parent service to be updated since the Z extension redefine metadata is referencing the new field.

How can I update the Parent metadata with the new field?

katherine_fong
Explorer
0 Kudos

Thank you Andre for your reply. My redefine extension project - ZHR_MSS_TIMESHEET_APPR_SRV was created last year for the first field. So do I have to go thru the steps to redefine again ( a second time) in this project "To Overwrite a model"?

I was hoping I could just add the 2nd field and regenerate.

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Katherine,

typically newly added fields will show up in the new service that probably has a name like ZHCM_MYSERVICE.

Only if you select the option to overwrite the option "To Overwrite a model” the new service will be called when the "old" URL is called.

https://help.sap.com/saphelp_gateway20sp12/helpdata/en/e3/cf9c0e0b234be08f0b4ae4a0af16f6/frameset.ht...

So probably you have chosen different approaches when using the redefine option?

I would not recommend to use the option "To Overwrite a model”.

Using SAP Web IDE it is better to create an extension project that will be used to consume the changed URL.

Best Regards,

Andre

tswami67
Explorer
0 Kudos

Dear Andre, I am also having the same issue. My requirement is to add a new field in CDS view and new field value can be seen in se11 ok. but when I add new field in segw gateway and added entity property and also mapping in service implementation for my entity set and save and add that new field with help of generate mapping and save and generate runtime objects. This action was done twice but still througing empty value when call odata of this below url.

sap/opu/odata/sap/Zxxxxx_MAINTAIN_SRV/InvoiceSet('1234567')?$format=json

response with status code 200

result. Only newly added field is empty in below json format

"invoiceReferenceDateFormatted" : "",

Please help which I step is missed when I add field in segw. Once fix then I will very happy and also further I need to add few more fields. thanks in advance.

Best regards

Swami