Skip to Content

OData Annotation - SmartTable Line Item

Nov 13, 2017 at 09:46 AM


avatar image

Hi Experts,

I have a requirement to extend one of the standard Fiori Applications without creating a new SEGW or UI projects. I have to add a custom field as a new column to the existing Line Item SmartTable .

I have added and made that field/column as default one as well using annotation and it is showing on the SmartTable. Even though I could see the value in the EntitySet payload, this field value is not displaying on my new column. Requesting your valuable suggestions.

Thanks in Advance,


10 |10000 characters needed characters left characters exceeded

Hi Glady,

could you share some screenshots or codes? It helps for investigating the problem.




Below is the code that I used to extend the model:

DATA: lo_entity      TYPE REF TO /iwbep/if_mgw_odata_entity_typ.

lo_entity = me->core_object->model->get_entity_type( 'Item' ).
lo_entity->create_property( iv_property_name ='Custome Field' iv_abap_fieldname = 'ZZCUSTOM' ).

DATA(lo_header_anno) = cl_fis_uibb_annotation=>create_line_item_annotation(

            io_odata_model     = me->core_object->model

            io_vocan_model     = me->core_object->vocab_anno_model

            iv_namespace       = 'FAC_FINANCIAL_DOCUMENT_SRV_01'

            iv_entity_type     = 'Item' ).

    lo_header_anno->add_line_item_record( EXPORTING iv_value_property  = 'CustomField'

                                                    iv_label_property  = 'Custom Field

                                                    iv_importance      = 'High' ).
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Cuong Cao Nov 13, 2017 at 01:20 PM

Hi Glady,

have you checked if the metadata of your service is already up-to-date and contains new line item?
You will find a node in the metadata looks something like below, this node will contains the new field you added.

<Annotations xmlns=" Target="YourEntity">
  <Annotation Term="">

If the new field is not there, maybe you have to clean the cache. Some useful transactions and reports for clearing caches:

Clear metadata cache

UI2 Cache:


Show 7 Share
10 |10000 characters needed characters left characters exceeded

Hi Cuong,

I have my new field in the metadata and the new column is displaying and I set it as default field. The issue is data is not displaying in that column though the data is in OData.


Could you show me the UI5 code for displaying the smart table?


That is standard Fiori Application code. We are not touching that part.

As I mentioned, this is a standard application. Both UI and backend are standard. We just want to bring one additional column to the existing SmartTable. Is it possible to do that without redefining the service or the UI code?


Hi Glady,

as i understand, you did extend the model without redefining the service.
Did you create a standalone annotation model and reference it to the standard service?


Cuong, I extended the standard model with a Post Exit in the existing model class and that's how I could bring the custom field as a new column to the existing SmartTable.


Hi Glady,

sorry I can not help further. From your comments, everything looks ok to me too.
What I can think of is trying to make sure you had cleaned all the caches (browser and abap system), this is often the cause of the all headaches.
And maybe you look again in the metadata and UI5 code to see if there is any annotation or property which prevents the rendering of displaying the field data. Or, you have to add any annotation or property to make that field data visible.

I hope you find a solution soon.



Thanks Cuong. I'll update if I get a solution for this. Appricieate your help.