on 06-28-2022 3:03 PM
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 ?
Issue solved.
Odata Annotations Updated for the service.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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'.
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??
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.