on 07-01-2021 7:08 AM
how can we manuplate the column name in smart table which is coming from the odata service
I've generated the annotation in xtrnhfo 's answer above in ABAP , by redefining DEFINE method of model extension class belong to my service as below , it worked :
DATA lo_ann_target TYPE REF TO /iwbep/if_mgw_vocan_ann_target.
DATA lo_annotation TYPE REF TO /iwbep/if_mgw_vocan_annotation.
DATA lo_collection TYPE REF TO /iwbep/if_mgw_vocan_collection.
DATA lo_record TYPE REF TO /iwbep/if_mgw_vocan_record.
DATA lo_property_value TYPE REF TO /iwbep/if_mgw_vocan_property.
DATA lo_property_label TYPE REF TO /iwbep/if_mgw_vocan_property.
CALL METHOD super->define( ).
CALL METHOD model->get_schema_namespace
IMPORTING
ev_namespace = lv_schema_namespace.
lo_ann_target =
vocab_anno_model->create_annotations_target(
iv_target = lv_schema_namespace && '.' && 'myEntityTypeName' ).
lo_annotation =
lo_ann_target->create_annotation( iv_term = 'com.sap.vocabularies.UI.v1.LineItem' ).
lo_collection = lo_annotation->create_collection( ).
lo_record = lo_collection->create_record( iv_record_type = 'com.sap.vocabularies.UI.v1.DataField').
lo_property_value = lo_record->create_property( 'Value' ).
lo_property_value->create_simple_value( )->set_path( 'myFieldName' ).
lo_property_label = lo_record->create_property( 'Label' ).
lo_property_label->create_simple_value( )->set_string( 'Field Title To Show' ). "<< Field title to be shown
Thanks,
Bulent Balci
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
72 | |
8 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.