DATA: lo_ann_target TYPE REF TO /iwbep/if_mgw_vocan_ann_target. " Vocabulary Annotation Target
DATA: lo_ann_target2 TYPE REF TO /iwbep/if_mgw_vocan_ann_target. " Vocabulary Annotation Target
DATA: lo_annotation TYPE REF TO /iwbep/if_mgw_vocan_annotation. " Vocabulary Annotation
DATA: lo_collection TYPE REF TO /iwbep/if_mgw_vocan_collection. " Vocabulary Annotation Collection
DATA: lo_function TYPE REF TO /iwbep/if_mgw_vocan_function. " Vocabulary Annotation Function
DATA: lo_fun_param TYPE REF TO /iwbep/if_mgw_vocan_fun_param. " Vocabulary Annotation Function Parameter
DATA: lo_property TYPE REF TO /iwbep/if_mgw_vocan_property. " Vocabulary Annotation Property
DATA: lo_record TYPE REF TO /iwbep/if_mgw_vocan_record. " Vocabulary Annotation Record
DATA: lo_simp_value TYPE REF TO /iwbep/if_mgw_vocan_simple_val. " Vocabulary Annotation Simple Value
DATA: lo_url TYPE REF TO /iwbep/if_mgw_vocan_url. " Vocabulary Annotation URL
DATA: lo_label_elem TYPE REF TO /iwbep/if_mgw_vocan_label_elem. " Vocabulary Annotation Labeled Element
DATA: lo_reference TYPE REF TO /iwbep/if_mgw_vocan_reference. " Vocabulary Annotation Reference
lo_reference = vocab_anno_model->create_vocabulary_reference( iv_vocab_id = '/IWBEP/VOC_UI' iv_vocab_version = '0001').
lo_reference->create_include( iv_namespace = 'com.sap.vocabularies.UI.v1' iv_alias = 'UI' ).
"annotations for entity type Sales Order
lo_ann_target = vocab_anno_model->create_annotations_target( 'SalesOrder' ).
lo_ann_target->set_namespace_qualifier( 'ZE2E100_XX_3_SRV' ). "change the namespace to the SRV namespace
" Header Info
lo_annotation = lo_ann_target->create_annotation( iv_term = 'UI.HeaderInfo' ).
lo_record = lo_annotation->create_record( ).
lo_record->create_property( 'TypeName' )->create_simple_value( )->set_string('SalesOrder').
lo_record->create_property( 'TypeNamePlural' )->create_simple_value( )->set_string( 'SalesOrders').
" Columns to be displayed by default
lo_annotation = lo_ann_target->create_annotation( iv_term = 'UI.LineItem' ).
lo_collection = lo_annotation->create_collection( ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Salesorder' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Salesorder' ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Customer' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Customer' ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Gross amount' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Grossamountintransaccurrency' ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Currency' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Transactioncurrency' ).
" Columns to be displayed in the object page
lo_annotation = lo_ann_target->create_annotation(
EXPORTING
iv_term = 'UI.Identification' ).
lo_collection = lo_annotation->create_collection( ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Salesorder' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Salesorder' ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Customer' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Customer' ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Lifecycle status' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Salesorderlifecyclestatus' ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Last changed at' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Lastchangeddatetime' ).
" Gross amount to be displayed as a data point
lo_annotation = lo_ann_target->create_annotation(
EXPORTING
iv_term = 'UI.DataPoint'
iv_qualifier = 'Grossamountintransaccurrency' ).
lo_record = lo_annotation->create_record( iv_record_type = 'UI.DataField' ).
lo_record->create_property( 'Value' )->create_simple_value( )->set_path('Grossamountintransaccurrency').
lo_record->create_property( 'Title' )->create_simple_value( )->set_string( 'Gross amount' ).
"Header Facets
lo_collection = lo_ann_target->create_annotation( iv_term = 'UI.HeaderFacets' )->create_collection( ).
"Facet for Sales Order Header Details on object page
lo_record = lo_collection->create_record( iv_record_type = 'UI.ReferenceFacet' ).
lo_record->create_property( 'ID' )->create_simple_value( )->set_string( 'GeneralInformation' ).
lo_record->create_property( 'Label' )->create_simple_value( )->set_string( 'General Information' ).
lo_record->create_property( 'Target')->create_simple_value( )->set_annotation_path( '@UI.Identification' ).
"Facet for Gross amount
lo_record = lo_collection->create_record( iv_record_type = 'UI.ReferenceFacet' ).
lo_record->create_property( 'ID' )->create_simple_value( )->set_string( 'GrossAmount' ).
lo_record->create_property( 'Label' )->create_simple_value( )->set_string( 'Gross amount' ).
lo_record->create_property( 'Target')->create_simple_value( )->set_annotation_path( '@UI.DataPoint#Grossamountintransaccurrency' ).
"Facet for Sales Order Header Details on object page
lo_collection = lo_ann_target->create_annotation( iv_term = 'UI.Facets' )->create_collection( ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.ReferenceFacet' ).
lo_record->create_property( 'ID' )->create_simple_value( )->set_string( 'ItemList' ).
lo_record->create_property( 'Label' )->create_simple_value( )->set_string( 'Item List' ).
lo_record->create_property( 'Target')->create_simple_value( )->set_annotation_path( 'ToItems/@UI.LineItem' ).
"add annotations for sales order line items
lo_ann_target2 = vocab_anno_model->create_annotations_target( 'SalesOrderItem' ).
lo_ann_target2->set_namespace_qualifier( 'ZE2E100_XX_3_SRV' ). "change the namespace to the SRV namespace
" Columns to be displayed by default
lo_annotation = lo_ann_target2->create_annotation( iv_term = 'UI.LineItem' ).
lo_collection = lo_annotation->create_collection( ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Salesorder' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Salesorder' ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Item' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Salesorderitem' ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Gross amount' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Grossamountintransaccurrency' ).
lo_record = lo_collection->create_record( iv_record_type = 'UI.DataField' ).
lo_property = lo_record->create_property( 'Label' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_string( 'Currency' ).
lo_property = lo_record->create_property( 'Value' ).
lo_simp_value = lo_property->create_simple_value( ).
lo_simp_value->set_path( 'Transactioncurrency' ).
<Annotations Target="ZE2E100_XX_3_SRV.SalesOrder" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<Annotation Term="UI.HeaderInfo">
<Record>
<PropertyValue Property="TypeName" String="SalesOrder" />
<PropertyValue Property="TypeNamePlural" String="SalesOrders" />
</Record>
</Annotation>
<Annotation Term="UI.LineItem">
<Collection>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Salesorder" />
<PropertyValue Property="Value" Path="Salesorder" />
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Customer" />
<PropertyValue Property="Value" Path="Customer" />
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Gross amount" />
<PropertyValue Property="Value" Path="Grossamountintransaccurrency" />
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Currency" />
<PropertyValue Property="Value" Path="Transactioncurrency" />
</Record>
</Collection>
</Annotation>
<Annotation Term="UI.Identification">
<Collection>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Salesorder" />
<PropertyValue Property="Value" Path="Salesorder" />
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Customer" />
<PropertyValue Property="Value" Path="Customer" />
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Lifecycle status" />
<PropertyValue Property="Value" Path="Salesorderlifecyclestatus" />
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Last changed at" />
<PropertyValue Property="Value" Path="Lastchangeddatetime" />
</Record>
</Collection>
</Annotation>
<Annotation Term="UI.DataPoint" Qualifier="Grossamountintransaccurrency">
<Record Type="UI.DataField">
<PropertyValue Property="Value" Path="Grossamountintransaccurrency" />
<PropertyValue Property="Title" String="Gross amount" />
</Record>
</Annotation>
<Annotation Term="UI.HeaderFacets">
<Collection>
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="ID" String="GeneralInformation" />
<PropertyValue Property="Label" String="General Information" />
<PropertyValue Property="Target" AnnotationPath="@UI.Identification" />
</Record>
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="ID" String="GrossAmount" />
<PropertyValue Property="Label" String="Gross amount" />
<PropertyValue Property="Target" AnnotationPath="@UI.DataPoint#Grossamountintransaccurrency" />
</Record>
</Collection>
</Annotation>
<Annotation Term="UI.Facets">
<Collection>
<Record Type="UI.ReferenceFacet">
<PropertyValue Property="ID" String="ItemList" />
<PropertyValue Property="Label" String="Item List" />
<PropertyValue Property="Target" AnnotationPath="ToItems/@UI.LineItem" />
</Record>
</Collection>
</Annotation>
</Annotations>
<Annotations Target="ZE2E100_XX_3_SRV.SalesOrderItem" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<Annotation Term="UI.LineItem">
<Collection>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Salesorder" />
<PropertyValue Property="Value" Path="Salesorder" />
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Item" />
<PropertyValue Property="Value" Path="Salesorderitem" />
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Gross amount" />
<PropertyValue Property="Value" Path="Grossamountintransaccurrency" />
</Record>
<Record Type="UI.DataField">
<PropertyValue Property="Label" String="Currency" />
<PropertyValue Property="Value" Path="Transactioncurrency" />
</Record>
</Collection>
</Annotation>
</Annotations>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
21 | |
19 | |
13 | |
10 | |
9 | |
8 | |
8 | |
7 | |
7 |