cancel
Showing results for 
Search instead for 
Did you mean: 

After Extending Standard Odata Service strings are missing in Annotation meta data

0 Kudos

Hi All,

I have extended a standard Odata service (TRV_MTR_SRV).

When I run the metadata.xml, some strings are empty in annotation files.

One of the examples is as follows.

Standard Service

Extended Service

I tried to run /n/iwfnd/cache_cleanup and /n/iwbep/cache_cleanup in backend and frontend systems.

But, they're still empty.

How can I fix this issue ?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Issue solved.

Odata Annotations Updated for the service.

Answers (3)

Answers (3)

robinthakral
Advisor
Advisor
0 Kudos

I have found the good solution to this as this will assign the annotation model for orginal service to the redefined ones as explained in this blog

How to redefine a CDS based Odata Service with Ann... - SAP Community

It describes how to get back metadata.

andrassoos
Explorer
0 Kudos

Hi Robinthakral,

 

Unfortunately, we didn't have the entry in /IWFND/I_MED_VAA, probably because the service registation happened before the assignment. I didn't try it the other way around.

Thanks for the blog.

 

br,

Andras

andrassoos
Explorer
0 Kudos

To anyone who struggles with this:

Implement the method get_vocan_provider_texts in the MPC_EXT class of the extension service in the same way as it is written in the MPC_EXT class of the original service. The issue was that the method is not called in the parent service, so if you want to get all the labels, it cannot be simply defined as empty, as it is written here: https://me.sap.com/notes/0002544555 .

Br,

Andras

robinthakral
Advisor
Advisor
0 Kudos

Hi Andras @andrassoos,

So is there any solution how to handle this value help issue.. I have tried note manual resolution steps, but still the issue persists.

robinthakral
Advisor
Advisor
0 Kudos
Hi Andras,
robinthakral
Advisor
Advisor
0 Kudos
Hi Andras, So is there any solution how to handle this value help issue.. I have tried note manual resolution steps, but still the issue persists.
andrassoos
Explorer
0 Kudos

 

Hi @robinthakral,

you can try to implement the following in the mpc_ext:

DATA:lo_model TYPE REF TO /iwbep/cl_mgw_odata_model,
lo_vocan_model TYPE REF TO /iwbep/cl_mgw_vocan_model.

super->define( ).

lo_model ?= model.
lo_vocan_model = lo_model->get_vocan_model( ).
lo_vocan_model->get_model_data( IMPORTING es_model_data = DATA(ls_model_data) ).
ls_model_data-header-has_vocan_texts = abap_true.
lo_vocan_model->set_model_data( EXPORTING is_model_data = ls_model_data ).

For this you  need to enhance /IWBEP/CL_MGW_VOCAN_MODEL:

  METHOD set_model_data.

    ms_model_data = is_model_data. " All data of the vocabulary annotation model

  ENDMETHOD.

parameter: IS_MODEL_DATA importing /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_S_VOCAN_MODEL

and 

  METHOD GET_MODEL_DATA.

    es_model_data = ms_model_data. " All data of the vocabulary annotation model

  ENDMETHOD.

ES_MODEL_DATA exporting /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_S_VOCAN_MODEL

 

Also, in the MPC_EXT:

METHOD get_vocan_provider_texts.
TRY.
CALL METHOD cl_fis_shlp_annotation=>get_vocan_provider_texts
EXPORTING
iv_language = iv_language
it_vocan_text_keys = it_vocan_text_keys
CHANGING
ct_vocan_texts_obj = ct_vocan_texts_obj.
CATCH cx_fis_error INTO DATA(lx_fis_error).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_med_exception
EXPORTING
previous = lx_fis_error.
ENDTRY.
ENDMETHOD.
ENDCLASS.

 

br,

Andras

 

robinthakral
Advisor
Advisor
0 Kudos

Hi Andras @andrassoos,

METHOD set_model_data. is not available in the given class/interface. So, how are we supposed to change the HAS_VOCAN_TEXTS = 'X'.

robinthakral_0-1707830550621.png

I have checked the field getting populated in ADD_TEXT_KEY_SIMP_VAL method but it is validating text id, elements prior; which seem irrelevant for our case.

So, any other way around, Please??

andrassoos
Explorer

Hi @robinthakral,

You can enhance it, or you can raise an OSS incident with this, and SAP will provide you with an SAP Note to implement that will extend the class with these required methods. br,

br,

Andras

andrassoos
Explorer
0 Kudos

Hi Noc Monitoring,

Could you please help me, how did you update the odata annotations for the service?

I've extended FAR_CUSTOMER_LINE_ITEMS and now all the strings are missing from labels in the metadata:
<PropertyValue Property="Label" String=""/>

Out of 1264 strings at labels, only 1 is there: <PropertyValue Property="Label" String="Help View for Countries/Regions"/>, that is strange.
This is also causing an issue with the value helps in this service, as they are showing blank options.

It is happening probably since the regeneration of the extended OData, but not sure.

Thanks in advance.