Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all 2823 articles
Browse latest View live

How to provide ODATA service for sth like Select Option in a Web application?

$
0
0

Hi Experts,

 

Scenaio:

In UI5 application, We want to create something like search help for a single field. For exmaple, A button next to field SalesOrder ID triggers a search help with search criterias Sales Group, Sales Offices and so on. This is just like the classic ABAP dynpro field.

 

Need suggestion in SAP GW service generation:

  • For the GW, how can I create a service which provide enough information to outside world?
  • Is Annotation related in this scenario?
  • Is there any document or step by step about this?

 

Thanks in advance.

 

 

Cain Sun


Limitations or Redundancy in SAP Gateway Product

$
0
0

I have been using SAP Gateway from one month and feel that there is too much of redundancy and Limitations. Let me brief in points :

 

1) Entity Relationship

ODATA  has an obligatory requirement for a Primary Key Relation between in the input and output parameters of the FM......For instance, if there is a INITILIZATION web service created that calls an FM to export 5 tables in the response , the GET ENTITY SET Query executes the FM as many as 5 times to the get the details which could be done with single execution of FM Here each table is addressed as an Entity which is not apt is what I feel...


I had to use ASSOCIATION to get 5 tables and why would anyone do that !

 

2)Custom Code in the Methods

When it comes to flexibility and altering a code , the custom code written in the methods ( GET , CREATE , DELETE , UPDATE , GET ENTITY SET ) is erased when the user hits a GENERATE button....

 

3)Redundant Data Returned

There is a set of redundant data that could effect the JSON response size unnecessarily for instance below....why is the metadata is in reponse....can that be avoided.....


"__metadata": {

                    "id": "/sap/opu/odata/sap/ywebservice/initAhsWebservice('RETURNLINK')",

                    "uri": "/sap/opu/odata/sap/ywebservice/initAhsWebservice('RETURNLINK')",

                    "type": "ywebservice.initAhsWebservice"

 

4)CREATE calls

The POST/CREATE web service does a GET method that calls the FM once more with the same data. This redundant code can be commented out but then the regeneration of the code would get that working again !!!

 

I want know if am following the right standards or am having half baked knowledge in SAP GATEWAY SERVICES !!!

Please let me know if am going in wrong way all together....

Fiori Add on installation

$
0
0

Hi all

 

Component Version                                                      Support Package Level

 

 

SAP NETWEAVER GATEWAY 2.0 — GATEWAY BEP                       7
SRA004 1.02
SRA008 1.02
SRA009 1.02

 

 

 

Got the requirement to install the above ,

my system is ECC 6 ,  with SAP BASIS  :  SAPKB70216

 

 

 

Please suggest from where to start

 

Regards

HTTPIO_ERROR_CREATE_MYSAPSSO error message while sending data

$
0
0

Hi All,

 

I am Getting the error ( HTTP Send failed: HTTPIO_ERROR_CREATE_MYSAPSSO error message while sending data. ) while executing the service from Tcode: /IWFND/GW_CLIENT.

 

Please find the screen shot attached.

How to access request object in Model Provider Class

$
0
0

Dear specialists,

 

I want to define the data model of my OData service dynamically depending on an URI paramter of my HTTP request. But so far I did not find any possibility to access the request object in the model provider class.

 

Does anybody has a hint for me?

 

Many thanks in advance.

 

Best regards,

Juergen

Authentication issue in SMP from Windows AD (Active Directory)

$
0
0

Hello Gurus,

 

Current we are implementing SMP platform Native mobile app. I required your advise and suggestions for below scenario :

Current design :

Have ECC (Installed in different box) and NW (installed in different box) trusted RFC connection maintained between ECC & NW to consume ODATA services.

 

1) Our mobile app will authenticate through windows AD server. (user maintained / created as "MobileUser1" in AD and ECC server) *User id is same in both the servers

2) Is it mandatory to maintain the same user "MobileUser1"  in (NW server) ? to access for creating the orders, pull / sync the data

3) If we maintain "Mobileuser1" in NW server then how can we handle if AD user password changes then it's mandatory to change and create the same password in NW & ECC??

 

Any Help will Appreciated.

Thanks in Advance.

 

Regards

PavanG

Offline Delta and Syclo Framework

$
0
0

Greetings fellow SAP people, I come here with a few doubts regarding Syclo framework in order to use Delta Query and Tracking.

 

I'm using this guide: #3 - How To Implement Lightening Fast OData Services with Exchange Table

 

As far as my understanding goes, Syclo Framework helps implementing the tracking table and the delta object and then with the binding of elements.

I'm implementing the example as it is in the H2G but I'm also trying to understand the underlying concept that goes with it.

I've got the following questions and suppositions of what happends when the EFI is triggered.

 

  • The Delta Table will keep track of every CUD operation that takes place in the APP side
  • If the APP goes offline, once it goes back online, the Delta Tracking side will trigger the Delta Query to obtain the partial data using the Delta Table in order to just make updates based on the portion of the content created while it was offline.

 

As far as I understood, that's all on the SAP side. However I'm curious about the next:

 

I was told that, in order to perform the update for the Delta History, it was necesary to implement ETags. Is this true?

The Delta side is only responsible for updates of the information, the offline side of the businessu operations should be handled by the SMP side to send the request once the APP is back online, is this assumption true?

 

WIth no further ado, I thank you all for your comments and your interest, perhaps if these questions are common knowdledge then I apologize, and if you guys could point me to any useful documentation to handle this case, i'd be greatly thankful.

 

Best regards.

NW Gateway Client Problem

$
0
0

Hi experts,

 

I have a problem when executing my web service. it gave me the following Error.

 

HTTP Send failed: HTTPIO_ERROR_CUSTOM_MYSAPSSO-Fehlermeldung beim Senden der Daten.

Message no. /IWFND/COS_SUTIL100

 

I can access my service through REST client in chrome.

 

Please help me on what I should do on this.

and let me know if you need more information.

 

Thank you so much.

-Martin-


Step-by-Step Add a New Entity with Association and Implement it

$
0
0

Knowledge prepare:

Topic:Expand in Framework and Data Provider

URI:    Expand in Framework and Data Provider - SAP NetWeaver Gateway - SAP Library


A request with a $expand query option enables the reading of entries of an entity together with an associated entity.


Below is some blogs posted in SCN about expand, I would like to show my respect to them here.

Step-by-step guide to build an OData Service based on RFCs – Part 3

 

 

Ok, now let us start.

 

1. Create a Entity Name: ApplicationLog

                 Entity Set Name: ApplicationLogCollection

 

Image.png

 

2. Set ABAP structure and Properties for Entity Name: ApplicationLog.

 

Image.png

 

 

Image.png

 

3. Create Association Name: Task_To_M_ApplicationLog.

 

Image.png

 

click [Next], fill in Referential Constraints

Image.png

 

click [Next]-->click [finish].

 

 

 

4.Click [Generate Runtime Object ] and make sure the message with "Runtime Objects for project 'xxxx' generated".


Image.png

 

5. Test metadata

 

6.Create class: CL_CRM_ODATA_RT_ApplicationLog  (Runtime Class for ApplicationLog)

Code Snippet:

Class:CL_CRM_ODATA_RT_ApplicationLog

Method: /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET

 

DATA: applicationlog_get_entityset TYPE cl_crm_odata_mpc=>tt_applicationlog.

 

" EntitySet -ApplicationLogCollection

     IF iv_entity_set_name = gc_application_log_collection.

       applicationlog_get_entityset(

         EXPORTING

          iv_entity_name = iv_entity_name

          iv_entity_set_name = iv_entity_set_name

          iv_source_name = iv_source_name

          it_filter_select_options = it_filter_select_options

          it_order = it_order

          is_paging = is_paging

          it_navigation_path = it_navigation_path

          it_key_tab = it_key_tab

          iv_filter_string = iv_filter_string

          iv_search_string = iv_search_string

          io_tech_request_context = io_tech_request_context

        IMPORTING

          et_entityset = applicationlog_get_entityset

          es_response_context = es_response_context

        ).

*     Send specific entity data to the caller interface

       copy_data_to_ref(

         EXPORTING

           is_data = applicationlog_get_entityset

         CHANGING

           cr_data = er_entityset

       ).


Class:CL_CRM_ODATA_RT_ApplicationLog

Method: /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_EXPANDED_ENTITY


DATA: lr_bupa_provider TYPE REF TO cl_crm_bp_odata_data_provider,

             lv_bupa_supports TYPE abap_bool.

 

       CREATE OBJECT lr_bupa_provider.

       lv_bupa_supports = lr_bupa_provider->supports_entity( EXPORTING iv_entity_name = iv_entity_name ).

 

       IF iv_entity_name = GC_TASK.

         IF go_task_impl IS NOT BOUND.

           CREATE OBJECT go_task_impl

             EXPORTING

               ir_context = mo_context.

         ENDIF.

 

         go_task_impl->get_task_expanded_entity(

           EXPORTING

             iv_entity_name               = iv_entity_name

             iv_entity_set_name           = iv_entity_set_name

             iv_source_name               = iv_source_name

             it_key_tab                   = it_key_tab

             it_navigation_path           = it_navigation_path

             io_expand                    = io_expand

             io_tech_request_context      = io_tech_request_context

           IMPORTING

             er_entity                    = er_entity

             et_expanded_clauses          = et_expanded_clauses    " Table of Strings

             et_expanded_tech_clauses     = et_expanded_tech_clauses    " Table of Strings

         ).

 

       ELSEIF lv_bupa_supports = 'X'.

         CALL METHOD lr_bupa_provider->/iwbep/if_mgw_core_srv_runtime~set_context

           EXPORTING

             io_context = mo_context.

 

         CALL METHOD lr_bupa_provider->/iwbep/if_mgw_appl_srv_runtime~get_expanded_entity

           EXPORTING

             iv_entity_name           = iv_entity_name

             iv_entity_set_name       = iv_entity_set_name

             iv_source_name           = iv_source_name

             it_key_tab               = it_key_tab

             it_navigation_path       = it_navigation_path

             io_expand                = io_expand

             io_tech_request_context  = io_tech_request_context

           IMPORTING

             er_entity                = er_entity

             et_expanded_clauses      = et_expanded_clauses

             et_expanded_tech_clauses = et_expanded_tech_clauses.

       ENDIF.


Class:CL_CRM_ODATA_RT_ApplicationLog

Method: APPLICATIONLOG_GET_ENTITYSET


TRY.

         DATA: lv_obj_guid TYPE crmt_object_guid.

 

         FIELD-SYMBOLS <fs_key_set_option> TYPE /iwbep/s_mgw_name_value_pair.

 

         READ TABLE it_key_tab ASSIGNING <fs_key_set_option> WITH KEY name = GC_GUID.

         IF <fs_key_set_option> IS ASSIGNED AND <fs_key_set_option>-value IS NOT INITIAL.

           lv_obj_guid = <fs_key_set_option>-value.

           CALL METHOD gr_task_rt->get_log_data

             EXPORTING

               iv_object_guid = lv_obj_guid

             IMPORTING

               et_log         = et_entityset.

         ENDIF.

       CATCH /iwbep/cx_mgw_busi_exception .

       CATCH /iwbep/cx_mgw_tech_exception .

     ENDTRY.

 

7. Then you can test for the entity by below 2 kinds of URIs.

      (1)/sap/opu/odata/sap/CRM_ODATA/TaskCollection(guid'xxxxx')/ApplicationLogs

      (2)/sap/opu/odata/sap/CRM_ODATA/TaskCollection(guid'xxxxx')/?$expand=ApplicationLogs

 

8.Finished.

Can not fully edit Gateway project of other developer.

$
0
0

I work in a shared team on multiple Gateway projects. So, we might have to edit each others projects depending on individual availability. However, I can not fully edit another developers Gateway project. The most noteable restrition is the disablity to reimport entities (see attachment).

 

He is the creator of project. We have the same developer permissions. The project itself has not been transported yet. Editing his project created a new transport.

 

Can you help me?

 

Thank you.

Implementing security in gateway services

$
0
0

What is the best practice to implement security for o-data services ? I want some users to have access to GET Entity / Entity Set but no access to CREATE / DELETE /UPDATE. For other set of users, I want them access to CREATE & UPDATE but no DELETE for the same entity.

 

What is the best practice to implement security at service level ?

Custom Task Providers for the SAP NW GW Task Gateway : who's doing it ?

$
0
0

There is a single post available today explaining what is involved in writing a custom task provider for the Task Gateway.

 

I was wondering whether there are already people who have tried to implement such a custom provider. A quick search through the SAP Store learns that at least within the SAP partner eco-system, there has so far been 0 attempts to create a commercial task provider implementation for the Task Gateway.

 

As we are currently considering such an implementation for a non-SAP workflow system, it would be great to hear from others about their experiences.

 

There is another confusing piece in the SAP Help Portal regarding custom task providers. It is a section in the documentation not for the Task Gateway, BUT the Workflow Services. Up until SAP NW Gateway SP06, there was this chapter, entitled "Task Provider Framework Capabilities", which appears to provide yet another set of APIs to build a custom task provider, with the added capability so it seems to also support push notificatoins. This raises the question : is this API no longer supported in later versions of the gateway and how does this framework relate to the Task Gateway APIs available to build a custom task provider.

 

 


 

Tags edited by: Jitendra Kansal (Moderator)

How to delete a GW service on GATEWAY hub?

$
0
0

hi experts,

 

In the /FIND/MAINT_SERVICE, how to delete a existing service? Each time I tried this, I will get some error like:

Delete Definition Assignment(s) first

and others.

So what is the correct way/steps to delete a existing service?

 

Thanks.

Fiori Add on installation

$
0
0

Hi all

 

Component Version                                                      Support Package Level

 

 

SAP NETWEAVER GATEWAY 2.0 — GATEWAY BEP                       7
SRA004 1.02
SRA008 1.02
SRA009 1.02

 

 

 

Got the requirement to install the above ,

my system is ECC 6 ,  with SAP BASIS  :  SAPKB70216

 

 

 

Please suggest from where to start

 

Regards

Download Functionality in get_stream

$
0
0

Hi

 

I am displaying multiple invoice numbers like

 

CheckBox         Inv no        quantity ..................................

X                         1               10.00

X                         2               20.00

X                         3               3.00

                            4              40.00

X                         5               50.00

 

in this case i need to download all invoice forms based on NAST configuration.

 

Is it possible through get_stream method? is there any other solution?

 

Please suggest


Batch Process Vs Create Deep Entity

$
0
0

Hello Experts

 

I need to Create\update couple of hundred records in my custom table from my UI through gateway in backend and only possible means available are batch or deep insert. I am not sure if deep insert can help me as i do not have any parent/child association possible and only way which i could think of leveraging deep insert is to define a dummy parent to carry out this operation. Other option looks like $Batch process to group these request and then carry out update in backend.

 

Which method is better in terms of performance for large data chunks? or is there any other better approach to accomplish this task?

How to save data and file in one shot?

$
0
0

Hi,

I have a requirement that user enters some data and attaches his file. I want to store file and other text data at one time.How to achieve it?

Thanks.

Error: Invalid or no assignment to system datatype found

$
0
0

Hi All,

 

I am trying to get some data from the back-end with SAP Gateway. I have created a data model, generated and implemented the get_entityset for my entity. When i call the service, the output data is filled correctly after the get_entityset is executed.

The problem appears when the Gateway tries to convert the data into JSON format. An exception is thrown and an error appears in the Gateway log too, which states that there is an invalid or no assignment to system datatype. I checked the data model in the Gateway, regenerated the runtime artifacts, but I still get the same error.

 

This is my data model:

Capture.JPG

Capture.JPG

 

Any ideas what the problem might be?

 

Thanks,

Szilamér

SAP Annotations for OData Version 2.0

$
0
0

Introduction

OData services provide a uniform interface for interacting with their resources, and in addition are self-describing:
  • The service document (located at the service root) lists the available top-level resources, and
  • The service metadata document (located at the address $metadata relative to the service root) describes the structure of all resources in the service.
This structural metadata makes it easy to understand a service, and human-readable documentation can be directly embedded into the metadata document, helping developers consume an OData service.
This alone is a huge benefit, yet metadata can be taken one step further by embedding machine-readable additional metadata that can be leveraged by development tools, client libraries, and generic clients to better interact with the service.
One area are semantic annotations that tell which of the OData properties contain e.g. a phone number, a part of a name or address, or something related to a calendar event or an analytic query. This is important for apps running on mobile devices that want to seamlessly integrate into contacts, calendar, and telephony.
The next area are capability annotations that describe which of the possible interactions defined by OData's uniform interface are supported by which parts of a concrete service. These annotations will e.g. tell whether an entity set allows inserts, updates, or deletes, whether it requires a filter, and which properties can be used in filter expressions. They also advertise capabilities that go beyond the base set defined by OData, e.g. whether an entity set allows free-text search via an SAP-defined query option.

Contents

AtomPub Service Document

AtomPub allows extending the service document with elements and attributes from XML namespaces other than AtomPub. The following sections describe which elements of the service document (namespace prefix app) can be annotated with attributes and elements from the namespace http://www.sap.com/Protocols/SAPData (namespace prefix sap) and from the namespace http://www.w3.org/2005/Atom (namespace prefix atom), and what these annotations mean.

Element app:service

The app:service element can be annotated with two elements from the atom namespace:
  • <atom:link rel="self" href="..."/> contains the link to this service document, and
  • <atom:link rel="latest-version" href="..."/> contains the link to latest version of this service.
If the latest-version link deviates from the self link, a client may inspect the newer version of the service and decide (probably after asking its user) to switch over to the newer service version.

Element app:collection

The app:collection element can be annotated with three elements:

It can also contain the attribute sap:addressable with the same value as for the corresponding entity set in the metadata document.

 

Metadata Document

OData's Conceptual Schema Definition Language (CSDL) allows annotating most model elements with XML attributes or elements from foreign XML namespaces. The following sections describe which elements of the metadata document (namespace prefix edm) can be annotated with attributes and elements from the namespace http://www.sap.com/Protocols/SAPData (namespace prefix sap), and what these annotations mean. For binary attributes the meaning is desribed for the value "true".

Element edm:EntityContainer

Entity containers can be annotated with the following attributes. If not stated explicitly, consumers can assume them to have the default value listed in the second column. This default value reflects the "normal" behavior.

Attribute NameDefault ValueMeaning
supported-formatsatom json

A white-space separated list of format shortnames. Possible list items:

  • atom
  • json
  • xlsx

The default is sap:supported-formats="atom json".

use-batchfalse

Wrap all requests to resources of this service in batch requests; only the service document and the metadata document can be accessed unwrapped.This avoids exposing sensitive data in URLs (even with HTTPS URLs can be visible in log files)

 

Element edm:EntitySet

Entity sets can be annotated with the following attributes. If not stated explicitly, consumers can assume them to have the default value listed in the second column. This default value reflects the "normal" behavior that can be expected from any OData service.
Attribute NameDefault ValueMeaning
label-Description, will also be used as atom:title in the service document
creatabletrueNew entities can be created in this set
updatabletrueEntities in this set can be updated
updatable-path-Entities in this set can be updated or not depending on their state. The value of this attribute is a path expression that identifies a Boolean property in the context of the entity type of the entity set. The value of this property indicates whether the entity can be updated or not.
deletabletrueEntities can be deleted from this set
deletable-path-Entities in this set can be deleted or not depending on their state. The value of this attribute is a path expression that identifies a Boolean property in the context of the entity type of the entity set. The value of this property indicates whether the entity can be deleted or not.
searchablefalseSupports custom query option search
pageabletrueSupports system query options $top and $skip
topabletrueSupports system query option $top
countabletrueSupports system query option $inlinecount=allpages and path suffix /$count
addressabletrueUse “false” if this entity set can only be accessed within its containing entity, e.g. SalesOrderItems within SalesOrders through SalesOrders(4711)/Items. Direct access to non-addressable entity collections will result in a 404 response code. The set may however allow access to single entities identified by their key properties values, e.g. SalesOrderItems(OrderID=4711,ItemID=3)
requires-filterfalseUse “true” if this set cannot be queried without providing a $filter expression. If accessed without a filter expression, it will respond with a human-readable error message explaining which kinds of filter expressions are required as a minimum
change-trackingfalseChanges to entities of this set can be tracked. Consumers can subscribe by adding an HTTP Prefer header odata.track-changes to the request. The response will then include a delta link for requesting information about changes in the future.
maxpagesize-Maximum number of entities returned in an OData response. If more entities are included in the result of an OData request, the service applies server-driven paging.
delta-link-validity-The maximum duration in seconds a delta link in an OData response remains valid. Afterwards, resources associated with the change tracking subscription may be cleaned up and will be no longer available.
semantics-See table below

Attribute sap:semantics

This attribute can take the following values in the context of  an entity type:

ValueMeaning
aggregateThe entities of this set are automatically aggregated if the query option $select is specified. Each property listed in $select is treated according to its aggregation role, see description of attribute sap:aggregation-role below
fixed-valuesThe entity set represents a list of fixed values, i.e. it is unlikely to change often, and the list is typically short

 

Element edm:EntityType

Entity types can be annotated with the following attributes:
Attribute NameMeaning

label

Description, will also be used as sap:member-title in the service document

semantics

See table below

 

Attribute sap:semantics

This attribute can take the following values in the context of  an entity type:
ValueMeaning
vcardEntities of this type contain contact information following the vCard standard, see values for sap:semantics on property level
veventEntities of this type contain event/appointment information following the iCalendar standard, see values for sap:semantics on property level

vtodo

Entities of this type contain todo/task information following the iCalendar standard, see values for sap:semantics on property level
parametersThis entity type represents parameters for an analytical query
aggregate
Entity sets with this type return result feeds with aggregated values for properties annotated with sap:aggregation-role="measure".
The aggregation takes into account the dimension properties specified in the $select system query option of the request. See also description of annotation sap:aggregation-role.
variantThis entity type represents query selection variants bundling parameter selections and filter expressions for obtaining specific query results

Element edm:Property

The annotation sap:labelis required for properties. All other annotations are optional.
Attribute NameDefault ValueMeaning
label-A short, human-readable text suitable for labels and captions in UIs
heading-A short, human-readable text suitable for column headings in UIs
quickinfo-A human-readable text suitable for tool tips in UIs
semantics-See table below
creatabletrueValues for this property can be chosen by client when creating an instance. “False” if value is always set by the server, e.g. document number from number range.
updatabletrueValues of this property can be changed. Must be “false” if it is “false” at entity set level. If updatability can change per entity or based on the entities' state, do not use this static annotation and use sap:field-control instead.
sortabletrueCan be used in $orderby system query option.
filterabletrueCan be used in $filter system query option.
required-in-filterfalseMust be used in $filter system query option.
filter-restriction-See table below
text-A path expression that identifies a property in the context of the entity type containing a human-readable text for the value of this property.
unit-A path expression that identifies a property in the context of the entity type containing the currency code or unit of measure for a numeric value.
precision-A path expression that identifies a property in the context of the entity type containing the number of significant decimal places for a numeric value.
visibletrueValues of this property are typically visible to end users. If visibility can change per entity or based on the entities' state, do not use this static annotation and use sap:field-control instead.
field-control3

A path expression that identifies a property containing a numeric value that controls visibility:

  • 0 = hidden,
  • 1 = read-only,
  • 3 = optional,
  • 7 = mandatory

See section below for details

validation-regexp-Values for this property have to match the specified regular expression. The regular expression is a JavaScript Regular Expression.
display-format-

There are currently three possible values:

  • “Date” indicates that only the date part of an Edm.DateTime value is relevant
  • "NonNegative" indicates that only non-negative numeric values are provided and persisted, other input will lead to errors
  • "UpperCase" indicates that uppercase values are provided and persisted, lowercase input will be converted
lower-boundary-
A property holding the upper boundary of a value range includes this attribute. The value of this attribute is always the name of another property in the same type.  It points to the property holding the related lower boundary.
upper-boundary-
A property holding the lower boundary of a value range includes this attribute. The value of this attribute is always the name of another property in the same type.  It points to the property holding the related upper boundary.
aggregation-role-See table below
super-ordinate-
If values of this property are meaningful (unique) only in the context provided by the value of another property, then this attribute holds the name of the context-providing property. The value of this attribute is always the name of another property in the same type.
attribute-for-
A property representing an attribute of another property includes this attribute. The value of this attribute is always the name of another property in the same type.  It points to the property for which this property is an attribute.
hierarchy-node-for-A property holding node IDs for a hierarchy structure of values of some other property includes this attribute.  The value of this attribute is always the name of another property in the same type. It points to the property for whose values the hierarchy is defined.
hierarchy-level-for-A property holding level numbers for a hierarchy structure of values of some other property includes this attribute. The value of this attribute is always the name of another property in the same type. It points to the related property holding the hierarchy node ID. A property holding level numbers has an integer data type. The root node of the hierarchy is at level 0.
hierarchy-parent-node-for-A property holding parent node IDs for a hierarchy structure of values of some other property includes this attribute. The value of this attribute is always the name of another property in the same type. It points to the related property holding the hierarchy node ID. For the root node of the hierarchy the parent node ID is null.
hierarchy-parent-navigation-for-A navigation property for accessing the parent entity of a node. It offers an alternative method for accessing the parent node ID, if the entity type does not have a dedicated property for that.
hierarchy-drill-state-for-
A property holding the drill state of a hierarchy node includes this attribute. The drill state is indicated by one of the following values: collapsed, expanded, leaf. The value of this attribute is always the name of another property in the same type. It points to the related property holding the hierarchy node ID. For a collapsed hierarchy node or a leaf, the hierarchy node ID of such an entity does not occur as parent node ID of any other entity in the set.
parameter-See table below
is-annotationfalseRepresents an instance annotation.
updatable-path-

If a property can be updated or not depending on the state of its entity, it can be annotated with this attribute. The value of this attribute is always a path expression that identifies a Boolean property in the context of the entity type. This related property indicates whether the annotated property can be updated for the containing entity or not.

Note: if used in addition to the more expressive field-control annotation, the values of the two must be in sync.

preserve-flag-for-See below
filter-for-A property whose value is a $filter expression includes this attribute. The $filter expression must be valid for the entity type specified in this attribute.

 

Attributes sap:unit and sap:precision

Amounts in a currency or absolute measures MUST be represented as simple properties with an appropriate numeric Edm type, preferably Edm.Decimal. These numeric properties SHOULD refer to a string property containing the ISO currency or unit of measure with the sap:unit attribute. They MAY refer to a numeric property containing the (non-negative) number of decimal places to be used for displaying the amount or measure with the sap:precision attribute.

Example in metadata document:

 

<Property Name="OrderedQuantity" Type="Edm.Int16"
         
sap:unit="OrderedUnit" />
<Property Name="OrderedUnit" Type="Edm.String"

          sap:semantics="unit-of-measure" />

<Property Name="Price" Type="Edm.Decimal" Precision="10" Scale="3"
         
sap:unit="Currency" sap:precision="DisplayScale" />
<Property Name="DisplayScale" Type="Edm.Byte" />

<Property Name="Currency" Type="Edm.String"

          sap:semantics="currency-code" sap:text="CurrencyText" />

<Property Name="CurrencyText" Type="Edm.String" />

 

Example in Atom entry:

 

<d:OrderedQuantity>50</d:OrderedQuantity>
<d:OrderedUnit>KGM</d:OrderedUnit>
<d:Price>86.9</d:Price>

<d:DisplayScale>2</d:DisplayScale>

<d:Currency>EUR</d:Currency>
<d:CurrencyText>Euro</d:CurrencyText>

 

Using a reference attribute instead of predefined complex types like Measure or Money with amount and unit properties allows several amounts to share the same unit. Transporting the amounts as “raw” numeric values instead of preformatted strings allows clients to format them according to device-specific settings (that may well differ from the server-side user settings) or process them on the client (if e.g. the client is Excel).

Attribute sap:field-control

Whether a property can or must contain value may depend on the state of its entity, so it is impossible to express this up-front via metadata annotations. In these cases the "edit state" of the property can be expressed via a separate "field control" property, and the link between data properties and their field-control properties is expressed with the sap:field-control attribute.

Example in metadata document:

 

<Property Name="Street" Type="Edm.String"

          sap:field-control="UX_FC_Address" />

<Property Name="City" Type="Edm.String"

          sap:field-control="UX_FC_Address" />

<Property Name="UX_FC_Address" Type="Edm.Byte"/>


The field-control property can be in the same type as shown above, or it can be in a nested complex type, or in an entity type that is associated 1:1. This allows separating field-control data from "real" data. If for example the field-control property is contained in a complex property or navigation property named UX, the attribute value is contains a path relative to the parent of the annotated property, e.g. sap:field-control="UX/FC_Address".


The possible values for a field-control property are:

ValueMeaning
7Mandatory - property must contain a value
3Optional - property may contain a null value
1Read-only - property cannot be changed
0Hidden - property should not be visible on user interfaces

 

Attribute sap:semantics

The possible values in the context of a property are:

ValueMeaning
telTelephone number
tel;type=cell,workWork cellphone number; see explanation below table for more values
tel;type=faxFax number
emailEmail address
email;type=prefPreferred email address
urlWeb URL
nameFormatted text of the full name
givennameFirst name or given name of a person
middlenameMiddle name of a person
familynameLast name or family name of a person
nicknameDescriptive name given instead of or in addtion to the one marked as "name"
honorificTitle of a person (Ph.D., Dr., ...)
suffixSuffix to the name of a person
noteSupplemental information or a comment that is associated with the vCard
photoURL of a photo of a person
cityAddress: city
streetAddress: street
countryAddress: country
regionAddress: state or province
zip
Address: postal code
poboxAddress: post office box
orgOrganization name
org-unitOrganizational unit
org-roleOrganizational role
titleJob title
bdayBirth date
summaryCalendar: summary of a calendar component
descriptionCalendar: description of a calendar component, detailing the summary
categoriesCalendar: comma-separated list of categories for a calendar component
dtstartCalendar: the date and time that a calendar component starts
dtendCalendar: the date and time that a calendar component ends
durationCalendar: duration as an alternative to dtend, see xs:duration
dueCalendar: the date and time that a to-do is expected to be completed
completedCalendar: the date and time that a to-do was actually completed
priorityCalendar: the relative priority for a calendar component, 0 for undefined, 1 for highest, ... 9 for lowest
classCalendar: access classification for a calendar component
statusCalendar: overall status or confirmation for the calendar component
percent-completeCalendar: percent completion of a to-do., ranging from 0 to 100 (integer)
contactCalendar: contact information or alternatively a reference to contact information associated with the calendar component
locationCalendar: the intended venue for the activity defined by a calendar component
transpCalendar: defines whether or not an event is transparaent to busy time searches
fbtypeCalendar: free/busy time type, see [iCalendar, Section 3.2.9]
wholedayCalendar: "true" or "false, depending on whether an event is scheduled for an entire day
yearCalendar: year as string following the regex pattern (-?)YYYY(Y*) consisting of an optional minus sign for years B.C. followed by at least four digits
yearmonthCalendar: year and month as string following the regex pattern (-?)YYYY(Y*)MM consisting of an optional minus sign for years B.C. followed by at least six digits, the last two digits are a number between 01 and 12 representing the months January to December
yearmonthdayCalendar: year, month and day as string following the logical pattern (-?)YYYY(Y*)MMDD consisting of an optional minus sign for years B.C. followed by at least eight digits, where the last four digits represent the months January to December (MM) and the day of the month (DD). The string matches the regex pattern -?([1-9][0-9]{3,}|0[0-9]{3})(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01]) The regex pattern does not reflect the additional constraint for "Day-of-month Values": The day value must be no more than 30 if month is one of 04, 06, 09, or 11, no more than 28 if month is 02 and year is not divisible by 4, or is divisible by 100 but not by 400, and no more than 29 if month is 02 and year is divisible by 400, or by 4 but not by 100
fromMail: author of message, see [RFC5322, section 3.6.2]
senderMail: mailbox of agent responsible for actual transmission
toMai: comma-separated list of primary recipients, see [RFC5322, section 3.6.3]
ccMail: carbon copy, comma-separated
bccMail: blind carbon copy, comma-separated
subjectMail: topic of the message
bodyMail: message body
keywordsMail: comma-separated list of important words and phrases that might be useful for the recipient
receivedMail: DateTime the message was received
geo-lonGeolocation: longitude
geo-latGeolocation: latitude
currency-codeISO currency code
unit-of-measureUnit of measure, preferably ISO
countAggregation: the number of leaf entities that have been aggregated into the response entity (count(*) in SQL). Only valid for one property of an entity type that is annotated with sap:semantics="aggregate".
For “tel” the type values are (see [vCard, section 6.4.1]):
  • "home" to indicate a telephone number associated with a residence
  • "work" to indicate a telephone number associated with a place of work
  • “pref" to indicate a preferred-use telephone number
  • "text" to indicate a telephone number supporting text messages (SMS)
  • "voice" to indicate a voice telephone number
  • "fax" to indicate a facsimile telephone number
  • "cell" to indicate a cellular telephone number
  • "video" to indicate a video conferencing telephone number
  • "pager" to indicate a paging device telephone number
  • "textphone" to indicate a telecommunication device for people with hearing or speech difficulties
For “email” the type values are:
  • "home" to indicate an email address associated with a residence
  • "work" to indicate an email address associated with a place of work
  • “pref" to indicate a preferred-use email address
For “url” and constituents of an address the type values are:
  • "home" to indicate an address associated with a residence
  • "work" to indicate an address associated with a place of work
  • “org" to indicate an address associated with the organization
  • “pref” to indicate a preferred address “other” to indicate some other address
These type values can be specified as a value list (like "type=work,pref").

Attribute sap:filter-restriction

A property can be annotated with this attribute, if filter restrictions exist. The attribute can take the following values:
ValueMeaning
single-valueOnly a single “eq”clause is possible.
multi-valueSeveral  “eq” clauses, separated by or, are possible.
intervalAt most one “ge” and one “le” clause, separated by “and”, alternatively a single “eq” clause.

Attribute sap:aggregation-role

A property can be annotated with this attribute, if it has an aggregation role. The attribute can take the following values:
ValueMeaning
dimensionThe property represents the key of a dimension. Only valid for properties of an entity type that is annotated with sap:semantics=“aggregate“.
measureThe property represents a measure whose values will be aggregated according to the aggregating behavior of the containing entity type. Only valid for properties of an entity type that is annotated with sap:semantics=“aggregate“.
totaled-properties-listThe property value is a comma-separated list of totaled dimension property names.

Attribute sap:parameter

A property can be annotated with this attribute, if it represents a parameter. The attribute can take the following values:
ValueMeaning
mandatoryA value must be supplied for this parameter.
optional
A value for this parameter can be left out by specifying an empty string (applicable only for parameter properties of type Edm.String). A value for this parameter can be left out by specifying an empty string (applicable only for parameter properties of type Edm.String). For parameters of other types, the default value conveyed in the metadata should be assigned, if the parameter shall be omitted.

 

Attribute sap:preserve-flag-for

A property holding the preservation state for another property includes this attribute.
The preservation state is a Boolean flag indicating whether or not the value of a named entity property is protected against updates causedby side-effects of updates to the entity set.
Example:
Consider an entity set holding order items with unit price, quantity, and total amount. All three properties supports preservation, as shown here for the unit price:
<Property Name="UnitPrice" Type="Edm.Decimal"/>
<Property Name="UnitPricePreserveFlag" Type="Edm.Boolean"
          sap:preserve-flag-for="UnitPrice"/>
For a given order item, a consumer can set the preservation flag for the total amount and update the unit price. This would instruct the provider to recalculate the quantity instead of the total amount.

Element edm:NavigationProperty

Attribute NameDefault ValueMeaning
filterabletrueCan be used as a path segment for properties in $filter system query option

 

Element edm:FunctionImport

Attribute NameMeaning
action-forValue is the qualified name of an entity type in scope. Indicates that the function or action operates on instances of that entity type. The function import MUST have a required parameter for each key property of that entity type. Parameter name and type must be identical to the name and type of the corresponding key property.
applicable-pathValue is a path to a Boolean property in the entity type named in the action-for attribute. The property indicates whether the function import can be invoked for the entity. The path can be the name of a Boolean property, or the name of a complex property followed by a forward slash and the path to a Boolean property in the complex type.
labelDescription
planning-functionThis function processes or generates plan data that may be exposed by entity sets of aggregate entity types in the same service. Its logic may have side-effects on these entity sets.
Example: a function import that allows approving a leave request. The LeaveRequest entity type has a single key property ID and a complex property ControlData with a Boolean property NeedsApproval that controls the applicability of two alternative actions, approval and rejection:

    <FunctionImport Name="LeaveRequestApproval"

                    ReturnType="ThisModel.ApprovalResult"

                    m:HttpMethod="POST"
                   
sap:label="Approve"      
                    sap:action-for="ThisModel.LeaveRequest"
                    sap:applicable-path="ControlData/NeedsApproval"
>

      <Parameter Name="ID" Type="Edm.Guid" Mode="In" />

    </FunctionImport>


    <FunctionImport Name="LeaveRequestRejection"
                    ReturnType="ThisModel.ApprovalResult"

                    m:HttpMethod="POST"

                    sap:label="Reject"
                    sap:action-for="ThisModel.LeaveRequest"
                    sap:applicable-path="ControlData/NeedsApproval"
>

      <Parameter Name="ID" Type="Edm.Guid" Mode="In" />

      <Parameter Name="Reason" Type="Edm.String" Mode="In" />

    </FunctionImport>

A function import can optionally include an annotation with an sap:value-constraint element.

Element sap:value-constraint

This element describes a dependency of function import parameters to key properties of an entity set, comparable to a referential constraint.
Example: For a function import with two parameters for country and region, the possible arguments can be determined via some Regions entity set.

    <sap:value-constraint set="Regions">

          <sap:parameter-ref name="Country"/>

          <sap:parameter-ref name="Region"/>

    </sap:value-constraint>

 

It has a set attribute that identifies the entity set containing the list of allowed parameter value combinations.

 

Nested sap:parameter-ref elements link the function import parameters specified with the name attribute to a key property of the entity type of the specified entity set. The sequence of sap:parameter-ref elements matches the sequence of the edm:PropertyRef elements of the Key element.

 

Element edm:Parameter

Attribute NameMeaning
labelDescription

Element edm:AssociationSet

Attribute NameDefault ValueMeaning
creatabletrueRelations can be created
updatabletrueRelations can be changed
deletabletrueRelations can be deleted

Instance Annotations

An annotation of an element in the OData metadata document adds information at the structural level of the service. Sometimes extra pieces of information are needed in the OData response for individual entities and their properties. To distinguish these two cases the former are called metadata annotations, while annotations of the entities in the OData response are called instance annotations.
Metadata annotations add information to the model structure. They are fully described by adding the appropriate AnnotationElement or AnnotationAttribute to a model element.
For instance annotations, this is different, because it must be possible to add different annotation values for every entity or every entity property, respectively. Therefore, if instance annotations are relevant for instances of some entity type, the structure of the entity type gets extended by properties specifically added for the purpose of holding annotation values in the result entities. These extra properties are also annotated with sap:is-annotation=”true” to identify them as
annotation holders and separate them from the other properties of the entity type.
A single entity can have multiple instance annotations, for each of which an extra property gets added to the underlying type:
  • Zero or more for the entity itself.
  • Zero or more for every property contained in the entity.
Properties representing instance annotations are always introduced by AnnotationAttributes in the metadata document. The following sections describe the possible occurrences.
Example:
<Property Name="Street" Type="Edm.String" Nullable="true"
          sap:field-control="Address_FC"/>
<Property Name="City" Type="Edm.String" Nullable="true"
          sap:field-control="Address_FC"/>
<Property Name="Address_FC" Type="Edm.Byte" Nullable="true"
          sap:is-annotation="true"/>

Query Option search

Modern user interfaces typically feature a search box for entering a free-text search term, and how exactly this search term is used to find "matching" things is up to the application. The custom query option search is intended exactly for passing such a free-text search term to the backend and let the backend decide against which properties of each entity in the entity set the term is matched, and how. It may also be matched against properties of related entities, e.g.
    GET ~/Orders?search=blue
to find all orders with items that refer to a blue product. Service implementations using SAP NetWeaver Gateway OData Channel will receive the search term in the parameter IV_SEARCH_STRING of method GET_ENTITYSET, see http://help.sap.com/saphelp_gateway20sp06/helpdata/en/7b/7ea4676342455c99072ce8815f799d/frameset.htm for details.
Note that search works similar to $filter: it will return a subset of the entities that are returned when no search term is specified. And it combines with $filter, returning only entities that fulfill both conditions.

One entity for multiple dropdowns possible??

$
0
0

Hi Experts,

 

I have a requirement that in a page there are 10 dropdowns. I want to make only 1 service call and bind the respective dropdown.

But I am not getting how do I make 1 entity for 10 different data.

 

Please help!!

 

Thanks,

Mansi

Viewing all 2823 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>