Quantcast
Channel: SCN : Document List - All Communities
Viewing all 2380 articles
Browse latest View live

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.

Contabilizacion Inmediata Nota de Credito Devolucion

$
0
0

Hola:

 

Por medio de este documento les voy a explicar como se puede configurar que la nota de crédito se contabilice en el momento en que se genera.

 

Introducción:

 

Por defecto el tipo de factura de nota de crédito esta configurada para que no se contabilice de inmediato, dado que se asume que hasta que se revise el material que se recibió como devolución se pueda pasar a contabilidad. Pero puede ser que por requerimientos del negocio sea necesario que esta se contabilice de inmediato, ya que puede llegar a suceder que por descuido no se contabilice y este documento no se refleje en la contabilidad.

 

Desarrollo:

 

1. Desactivar Bloqueo de contabilización

 

Comercial --> Facturación --> Definir clase de factura --> Definir clase de factura:

 

Se des habilita el campo de "Bloqueo contabilización"

 

 

Captura1.JPG

 

Con esta configuración se contabiliza la factura en el momento en que se genera y se evita el tener que Autorizar a contabilidad el documento en la transacción VF02.

 

Espero les sea de utilidad


Saludos


Jose Antonio Martinez

Getting Started with Kapsel - Part 10 -- Offline OData (SP09+)

$
0
0

sap-logo.png

Offline OData

The Kapsel Offline OData plugin enables an OData version 2.0 based application that has its data proxied through an SMP server to be used when a device or emulator is offline by creating a store on the device.

store = sap.OData.createOfflineStore(properties);
store.open(openStoreSuccessCallback, errorCallback);

Once the store is open and the custom OData client is applied with the following call, all calls made using the datajs library that match the service root (connection name for the endpoint such as com.mycompany.offline) are routed to the offline store.

sap.OData.applyHttpClient();
//sap.OData.removeHttpClient();

A set of defining requests specify the data that will populate the offline store.

definingRequests : {  contacts     : "/ContactSet?$expand=ToContactDetails",  customers    : "/CustomerSet",  regions      : "/RegionSet",  departments  : "/DepartmentSet",  countries    : "/CountrySet",  jobfunctions : "/JobFunctionSet"
}

The data that will be updated when a device is offline should ideally be data that multiple offline users are not simultaneously updating.  If possible, partition the data to the subset required by each user.  The offline store has a 16 GB limit.  The initial download time, database size and refresh times can be affected by the amount of data being stored on the device.  Adding OData filters to the defining requests to limit the data on the device to the subset of data required is one technique to do this.

 

An offline store can only be used with one OData service.  For example, one offline store could be associated with one service such as http://services.odata.org/V2/OData/OData.svc/ or http://services.odata.org/V2/Northwind/Northwind.svc/ but not both.

 

Once the offline store has been created, local changes made to it can be sent out via a call to store.flush().  The offline store can update its copy of the data by calling store.refresh().

 

The offline store files can be seen at \data\data\com.mycompany.offline2\files when running in an Android emulator as shown below.
image9.PNG

 

OData function imports are not supported as the service metadata document does not describe what changes occur as a result of calling them.  See also Offline OData Version Support for further details on supported features.

 

For additional details on the Offline OData plugin see C:\SAP\MobileSDK3\KapselSDK\docs\api\sap.OData.html or Using the Offline OData Plugin.

 

The following samples will help demonstrate the Kapsel Offline OData plugin.

 

OData Based App
This is a simple OData based app that demonstrates how it cannot read data while the device is offline.

 

OData Based App with the Kapsel Offline OData Plugin
The Offline OData plugin is added to the project to enable the accessing of OData when device is offline.

 

Offline enabled App with Create, Update, Delete, Access to the Error Archive
Adds CUD operations (create, update, delete) and how to view failed updates in the ErrorArchive.

 

Offline and Online in One App
Demonstrates an app where a portion of the data is made available when offline.

 

Using More than one Offline Store
Demonstrates an app where multiple offline stores are opened.

 

Sample that Switches to Offline Usage once the Network is Unavailable
This sample shows how an application may switch to using an offline store automatically when network connectivity is lost.

 

Sample that Defines Relationships using $expand
How to use $expand to define relationships between entities when the OData service does not make use of referentialconstraint.

 

Additional Settings
Demonstrates encryption of the offline store, refreshing a subset of data and use of refresh interval.

 

Batch Operation
This example shows how to add a new product that references an existing category and supplier in one operation.

 

Deep Insert
This example shows how to add a category and a new product in one operation.  This feature was added in SP08 of the SDK.

 

Binary Data/Attachments
This section discusses offlining attachments.

 

Troubleshooting

 

Questions and Answers

OData Based App

The following steps will create a simple OData based app that does not use the Kapsel Offline OData plugin.

  • Create the project.
    cordova create C:\Kapsel_Projects\OfflineDemo com.mycompany.offline OfflineDemo 
    cd C:\Kapsel_Projects\OfflineDemo
    cordova platform add android
    
    cordova create ~/Documents/Kapsel_Projects/OfflineDemo com.mycompany.offline OfflineDemo
    cd ~/Documents/Kapsel_Projects/OfflineDemo
    cordova platform add ios
  • Replace C:\Kapsel_Projects\OfflineDemo\www\index.html with the sample code for products.html from the OData Appendix.
    Download the latest datajs file (datajs-1.1.2.min.js) from datajs and place it in the www folder.

  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios
    image1.PNG

    Notice that the application displays products data from the OData producer at http://services.odata.org/V2/OData/OData.svc/Products?$format=json.

    To see additional details of this service, examine the service metadata document at http://services.odata.org/V2/OData/OData.svc/$metadata.

    Now turn on Airplane mode, close the app and reopen it.
    After the default timeout period, an error will appear.
    image2.PNG

    Airplane mode can be turned on in the following manner.
    On Android choose Settings > More > Airplane mode.
    On an iOS device choose Settings > Airplane Mode.
    On an iOS simulator, unplug the Ethernet cable or turn off the WI-FI for the Mac hosting the simulator.

OData Based App with the Kapsel Offline OData Plugin

The following steps will enable the app to be used when the device or simulator is online or offline.

Note, the techniques used in this sample are for learning purposes only.  In a non-demo app, it is recommended that the offline store be used all the time to maintain consistency of the data.

  • Add the Cordova network information plugin and the Kapsel Offline OData plugin.
    cordova plugin add cordova-plugin-network-information
    
    cordova plugin add kapsel-plugin-odata --searchpath %KAPSEL_HOME%/plugins
    cordova plugin add kapsel-plugin-logon --searchpath %KAPSEL_HOME%/plugins
    or
    cordova plugin add kapsel-plugin-odata --searchpath $KAPSEL_HOME/plugins
    cordova plugin add kapsel-plugin-logon --searchpath $KAPSEL_HOME/plugins
    
  • The Offline OData plugin requires that the OData source is proxied through the SMP server.  If needed, review the steps shown in Configuring a Kapsel App in the Management Cockpit.
    Create an Application with the application ID of
    com.mycompany.offline
    Set the endpoint to be the following URL
    http://services.odata.org/V2/OData/OData.svc
    Check Allow anonymous access since this backend does not require a user name or password.
    Note, no SSO mechanism is needed.
    Ensure the rewrite mode is Rewrite URL in SMP.  For offline apps it is important that the URI's are routed through the SMP server.

    Under the Authentication tab choose the default profile which means that user name and password can be used on the registration screen.

  • Replace www/index.html with the contents of index1.html or index1UI5.html.

  • Modify the variable smpServerHost in index.html to point to your SMP server.

  • If you are not using SAPUI5, place a copy of datajs-1.1.2.min.js into the www folder.

  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios
    Note that the Offline OData plugin does not support Android Intel Atom (x86) emulators.  It may run on an Intel based device if that device has Intel to ARM translation software.  See also libhoudini.

    Turn off airplane mode and click on Register, Open Offline Store.
    Exit the app.
    Place the device back into airplane mode.
    Reopen the app and click on Open Store, and then Read.
    image3.PNGimage4.PNGimage4UI5.PNG

    Notice that the app now returns the results using the data retrieved from the local store and does so much quicker since a network request is not needed to retrieve the results.

Offline enabled App with Create, Update, Delete and Access to the Error Archive

The following steps will extend the app to enable create, update and delete operations and will also display the contents of the ErrorArchive which contains any error that occurred during a flush which attempts to send locally made changes on the device to the OData producer.

 

Note, the techniques used in this sample are for learning purposes only.  In a non-demo app, it is recommended that the offline store be used all the time to maintain consistency of the data.

 

Note, that this example uses a partial service endpoint in the management cockpit.  The endpoint specified is

http://services.odata.org

instead of

http://services.odata.org/V2/(S(readwrite))/OData/OData.svc/

  The full URL causes a redirect to a new URL that contains the URL with a session id in it.

Note, that the temporary OData session ID can be reset in this example by clicking on Clear Offline Store, Unregister, Register, and then Read or Open Store.

  • http://services.odata.org provides an updateable service. Enter the following URL into a browser to generate a temporary link to the updateable service.
        http://services.odata.org/V2/(S(readwrite))/OData/OData.svc/
        Notice that the resultant URL after a redirect has S(session_id) and it is V2 for OData version 2.0.

  • In the management cockpit create a new application with an ID of
    com.mycompany.offline2
    and an endpoint of
    http://services.odata.org
    Check Allow anonymous access since this backend does not require a user name or password.
    Note, no SSO mechanism is needed.
    Ensure the rewrite mode is Rewrite URL in SMP.  For offline apps it is important that the URI's are routed through the SMP server.
    Under the Authentication tab choose the default profile which means that user name and password can be used on the registration screen.

  • Create the project.
    cordova create C:\Kapsel_Projects\OfflineDemo2 com.mycompany.offline2 OfflineDemo2
    cd C:\Kapsel_Projects\OfflineDemo2
    cordova platform add android
    
    cordova create ~/Documents/Kapsel_Projects/OfflineDemo2 com.mycompany.offline2 OfflineDemo2
    cd ~/Documents/Kapsel_Projects/OfflineDemo2
    cordova platform add ios
  • Add the Cordova network information plugin and the Kapsel Offline OData plugin.
    cordova plugin add cordova-plugin-network-information
    
    cordova plugin add kapsel-plugin-odata --searchpath %KAPSEL_HOME%/plugins
    cordova plugin add kapsel-plugin-logon --searchpath %KAPSEL_HOME%/plugins
    or
    cordova plugin add kapsel-plugin-odata --searchpath $KAPSEL_HOME/plugins
    cordova plugin add kapsel-plugin-logon --searchpath $KAPSEL_HOME/plugins
  • Replace C:\Kapsel_Projects\OfflineDemo2\www\index.html with the contents of index2.html.

  • Place a copy of datajs-1.1.2.min.js into the www folder.

  • Modify the variable smpServerHost in index.html to point to your SMP server.

  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios
    Note that the Offline OData plugin does not support Android Intel Atom (x86) emulators.

    Press the Read button to get a new temporary URL for the OData service.
    Note products can now be added to the list, removed or modified.  This can occur when the device is online or if it is offline, then when the device is online and the Flush button is pressed, the changes are sent to the OData producer.
    image5.PNG

  • Details of any problems sending the changes made when the device was offline to the OData producer can be viewed in the ErrorArchive.  The following steps can be followed to introduce an error.
    With the offline store open, perform a read.  Update the price of bread from 2.50 to 2.99.
    Close the offline store.
    Perform a read and notice the price of bread is 2.50 since the change made with the store closed was not flushed.
    Delete bread from products.
    Open the offline store and perform a read.  Notice that bread appears in products and the price is 2.99.
    Flush the offline store which will cause an error as the previously deleted product bread cannot have it price updated.
    Click on Check Errors to view the contents of the ErrorArchive.  On this screen, the ability to remove the error is provided. 
    image6.PNG

    Additional functionality could be provided to modify the operation and retry it if the problem was an update issue such as one where two different users both modified the same record.
    Note that services.odata.org does not use ETags so the last update wins.  See also Offline OData Conflicts and Errors and ETag.

Offline and Online in One App

The service root for the offline and always online requests must be different.  In this sample requests that are made to

http://10.7.171.223:8080/com.mycompany.offline/Products?$orderby=Name%20desc

are redirected to the Offline Store when it is open and requests to

http://10.7.171.223:8080/com.mycompany.online/Products?$orderby=Name%20desc

are not redirected to the offline store.  The service root is specified when the store is initially opened.

    function openStore() {        ...        var properties = {            "name": "ProductsOfflineStore",            "host": applicationContext.registrationContext.serverHost,            "port": applicationContext.registrationContext.serverPort,            "https": applicationContext.registrationContext.https,            "serviceRoot" :  appId,                        "definingRequests" : {                "ProductsDR" : "/Products"            }        };        store = sap.OData.createOfflineStore(properties);        //var options = {};        store.open(openStoreSuccessCallback, errorCallback/*, options*/);    }

The following steps demonstrate this using the previous Offline project.
Note, the techniques used in this sample are for learning purposes only.  In a non-demo app, it is recommended that the offline store be used all the time to maintain consistency of the data.

  • Add a second back-end connection to the application com.mycompany.offline with a name of com.mycompany.online in the management cockpit that also points to http://services.odata.org/V2/OData/OData.svc.
    image12.PNG

  • Modify www/index.html and a second read button.
    <button id="read2" onclick="read2()">Read2</button><br>
  • Copy and paste the read method and rename the copied method to be read2

  • Modify the read2 method.  Change this line
    var sURL = applicationContext.applicationEndpointURL + "/Products?$orderby=Name desc";
    to
    var sURL = applicationContext.applicationEndpointURL.replace("offline", "online") + "/Products?$orderby=Name desc";
  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios
    Open the Offline store.  Press the Read button and notice the duration the read took.  Now press the Read2 method and notice that it takes longer as the read is not going to the back-end (services.odata.org) rather than being retrieved from the offline store.

Using More than one Offline Store

If the data being used in the app changes perhaps due to having the device being shared by multiple users or perhaps depending on the sales region the sales person is visiting on a particular day, it may make sense to have more than one offline store.  Each store will need to have a unique service root.

Note, that a maximum of 4 offline stores can be opened at the same time in SP09.

The following steps demonstrate this using the previous Offline project.
Note, the techniques used in this sample are for learning purposes only.  In a non-demo app, it is recommended that the offline store be used all the time to maintain consistency of the data.

  • Add three new back-end connections to the application com.mycompany.offline in the management cockpit that also points to http://services.odata.org/V2/OData/OData.svc.
    image13.PNG

  • Replace the www/index.html with index6.html

  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios
    image14.PNG

  • Select the Food button.  Press the Open Store button.  Once the store has opened, press the read button and notice that the results returned are only the entries that belong to the Food category.  Repeat for the other two categories.

  • At this point there are now three stores created and opened, one for each category of product.
    Examine the index.html file.
    Notice that the variable stores is an array that contains the list of opened stores.   
    Notice pressing a category button such as Food or Electronics sets the variables category and category_id equal to a string that represents the name of the category and the id of the category.  These variables are used by the openStore method to set the name, serviceRoot and a filter on the defining request.  They are also used by the read, closeStore and clearStore methods.
    In order to open multiple stores, each store must have a unique name and service root.  The read method must also use the appropriate service root so the request gets directed to the correct store.

Sample that Switches to Offline Usage once the Network is Unavailable

The following sample listens to online and offline notifications and sets a timer to call refresh after a set interval.  When the app starts the offline store is opened, and if the device is online the store is refreshed.  While the device is online, the offline store is not used.  When the device is offline, the OData requests are redirected to the open online store as the sap.OData.applyHttpClient() method is called when the device switches to offline.  When the device regains network connectivity, the method sap.OData.removeHttpClient() is called.

Note, the techniques used in this sample are for learning purposes only.  In a non-demo app, it is recommended that the offline store be used all the time to maintain consistency of the data.

Follow the below steps to try it out.

  • Create the project.
    cordova create C:\Kapsel_Projects\OfflineDemo3 com.mycompany.offline3 OfflineDemo3
    cd C:\Kapsel_Projects\OfflineDemo3
    cordova platform add android
    
    cordova create ~/Documents/Kapsel_Projects/OfflineDemo3 com.mycompany.offline3 OfflineDemo3
    cd ~/Documents/Kapsel_Projects/OfflineDemo3
    cordova platform add ios
  • Replace C:\Kapsel_Projects\OfflineDemo3\www\index.html with the contents of index3.html.

  • Modify the variable smpServerHost in index.html to point to your SMP server.

  • Place a copy of datajs-1.1.2.min.js into the www folder.

  • Add the Cordova network information plugin and the Kapsel Offline OData plugin.
    cordova plugin add cordova-plugin-network-information
    
    cordova plugin add kapsel-plugin-odata --searchpath %KAPSEL_HOME%/plugins
    cordova plugin add kapsel-plugin-logon --searchpath %KAPSEL_HOME%/plugins
    or
    cordova plugin add kapsel-plugin-odata --searchpath $KAPSEL_HOME/plugins
    cordova plugin add kapsel-plugin-logon --searchpath $KAPSEL_HOME/plugins
    
  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios
    image7.PNG

Sample that Defines Relationships using $expand

The definition of a service can be examined by opening the service URL such as http://services.odata.org/V2/OData/OData.svc/.
This shows that there are three collections available named Products, Categories and Suppliers. For further details see the following URL.  http://services.odata.org/V2/OData/OData.svc/$metadata
Notice that Products is defined as an EntityType of OData.Product and it has a set of NavigationProperties.  Specifically it defines that a Product has a Supplier and a Product has a Category.  When the offline store is created it needs to know about these relationships to correctly create the tables and relationships between the tables.  If the metadata does not specify a referentialconstraint as this service does not, the defining requests will need to use the $expand format to specify how the tables are related.  This is explained in more detail at Using Defining Requests to Build Entity Relationships.
The following sample displays a table of categories as links that when clicked on shows the products in the clicked on category and the supplier of the product.  To make this data available when the device is offline, we need all three entities.  The following defining requests were used initially when creating this sample.

"definingRequests" : { //the below requests will be used to populate the offline store    "CategoriesDR" : "/Categories",     "ProductsDR" : "/Products",         "SuppliersDR" : "/Suppliers"    
}

Then the following query could be used to retrieve the Categories.

/Categories?$orderby=Name desc

When a category is clicked on a second query can be performed to return the products and supplier information for a given category.  Here are a couple of queries that could be used.

/Products?$expand=Supplier,Category&$filter=Category/ID eq 0&$orderby=Name desc
or
/Categories(1)/Products?$expand=Supplier&$orderby=Name desc

Unfortunately, the above queries returns 0 results when the offline store is open since the relationships between the entities are not defined with ReferentialConstraint.  See also ReferentialConstraint Element.
Since we are not able to change the OData service, the relationships can be specified by using expand in the defining requests as shown below.

"definingRequests" : { //the below requests will be used to populate the offline store    "CategoriesDR" : "/Categories?$expand=Products/Supplier"    //"ProductsDR" : "/Products?$expand=Category,Supplier"  //this also works
}

Note, the techniques used in this sample are for learning purposes only.  In a non-demo app, it is recommended that the offline store be used all the time to maintain consistency of the data.

Try out the complete example by following the below steps.

  • Create the project.
    cordova create C:\Kapsel_Projects\OfflineDemo4 com.mycompany.offline4 OfflineDemo4
    cd C:\Kapsel_Projects\OfflineDemo4
    cordova platform add android
    
    cordova create ~/Documents/Kapsel_Projects/OfflineDemo4 com.mycompany.offline4 OfflineDemo4
    cd ~/Documents/Kapsel_Projects/OfflineDemo4
    cordova platform add ios
  • Add the Cordova network information plugin and the Kapsel Offline OData plugin.
    cordova plugin add cordova-plugin-network-information
    
    cordova plugin add kapsel-plugin-odata --searchpath %KAPSEL_HOME%/plugins
    cordova plugin add kapsel-plugin-logon --searchpath %KAPSEL_HOME%/plugins
    or
    cordova plugin add kapsel-plugin-odata --searchpath $KAPSEL_HOME/plugins
    cordova plugin add kapsel-plugin-logon --searchpath $KAPSEL_HOME/plugins
    
  • Replace C:\Kapsel_Projects\OfflineDemo4\www\index.html with the contents of index4.html.

  • Modify the variable smpServerHost in index.html to point to your SMP server.

  • Place a copy of datajs-1.1.2.min.js into the www folder.

  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios
    Press Register > Read > Electronics
    image11.PNG

Additional Settings

The following section provides examples of some additional settings that can be set.
Encrypting the Offline Database
Delta Queries
Refreshing a Subset of the Offline Data
Prepopulate Offline Database and Refresh Interval of Shared Data

Encrypting the Offline Database

To encrypt the data in the offline stores, specify an encryption key.  Without this, it is possible on an Android or iOS simulator to access the UltraLite database files and view the data as shown below.
image10.PNG

 

The following option can be provided when opening the store to encrypt the stores using AES-256.

var options = {    "storeEncryptionKey" : "myVerySecretKey123!"    //"storeEncryptionKey" : applicationContext.registrationContext.password //if using the Logon plugin, the user entered password for the registration can be used if it never changes
};
store.open(openStoreSuccessCallback, errorCallback, options);

A better solution than hardcoding the password would be to generate a random password and then to store it in the datavault provided by the Logon plugin.  Here is an example of how that might look.

var otp = null;  //one time password.  Must be set once the first time the app starts

function logonSuccessCallback() { 
    getOneTimePassword();    ...
}

function getOneTimePassword() {
    sap.Logon.get(getSuccess, errorCallback, "key");
}

function getSuccess(val) {
    if (val == null) {        val = Math.random().toString(36).substring(16);         sap.Logon.set(val);        return;    }    otp = val;
}

function openStore() {
    ...    var options = {        "storeEncryptionKey" : otp    };    store.open(openStoreSuccessCallback, errorCallback, options);
}

Delta Tracking

The Offline OData plugin can work with delta query enabled backends to minimize the communication between the SMP server and the OData producer.  The following links provide additional details.
Delta Queries (Part 1)
Performance Improvement with Caching and Delta Tracking
Delta Query Support

Refreshing a Subset of the Offline Data

When performing a refresh, if it is only a subset of the data that changes often, in the refresh call it is possible to specify which defining requests should be refreshed.  Assume the application has the following defining requests.

"definingRequests" : { //the below requests will be used to populate the offline store    "CategoriesDR" : "/Categories",     "ProductsDR" : "/Products",        "SuppliersDR" : "/Suppliers"
}

To only refresh the Products and Suppliers, the following call could be made.

store.refresh(refreshStoreCallback, errorCallback, ["SuppliersDR", "ProductsDR"]);

Prepopulate Offline Database and Refresh Interval of Shared Data

The database used on the device to store the offline data is created and optionally initially populated on the SMP server before it is sent to the device the first time the store is opened.  This can speed up the time taken when the offline store opens for the first time.  As well, if the data is cached in the SMP server, calls to refresh the data from the device will use the cached data in the SMP server rather than making requests to the OData producer.
Assume the application has the following defining requests.

"definingRequests" : { //the below requests will be used to populate the offline store    "CategoriesDR" : "/Categories",     "ProductsDR" : "/Products",        "SuppliersDR" : "/Suppliers"
}

Also assume that the following application configuration file is specified in the management cockpit under Applications > com.mycompany.offline > Import Settings

[endpoint]
Name=com.mycompany.offline
prepopulate_offline_db=Y
prepopulate_offline_db_interval=1440

[defining_request]
name=CategoriesDR
is_shared_data=Y
refresh_interval=1440
track_deltas=NEVER
delta_token_lifetime=0

[defining_request]
name=ProductsDR
is_shared_data=Y
refresh_interval=1440
track_deltas=NEVER
delta_token_lifetime=0

[defining_request]
name=SuppliersDR
is_shared_data=Y
refresh_interval=1440
track_deltas=NEVER
delta_token_lifetime=0

The above configuration file specifies that the offline database is prepopulated and filled with data that is at most less than one day old (1440 minutes = 60 minutes * 24 hours).
It also indicates that if the mobile device requests a refresh operation and the data on the server is less than one day old, the SMP server uses the cached data rather than contacting the OData producer.
Note, these options are further explained at Defining an Application Configuration File with Defining Requests.

Batch

If multiple requests need to be made, it is more efficient to send them as one HTTP(S) request than in multiple requests.
The following steps demonstrate how to perform create and an update operation in one request using the create, update, delete app.

See also Batch Operations, Addressing Links between Entries, Referencing Requests in a Change Set (Content-ID Referencing) and $batch Processing.  Note that Content-ID referencing is not supported in SAP NetWeaver Gateway as mentioned under the Constraints section of the last link.

  • Modify the index.html to include the following new button.
    <button id="deepinsert" onclick="batchCreateAndUpdate()">Batch Create and Update</button>
  • Add the following method to the index.html
    function batchCreateAndUpdate() {        var oHeaders = {    };    var params = {        __batchRequests: [ {            __changeRequests: [ {                requestUri: getEndPointURL() + "/Products",                method: "POST",                data : {                    "ID" : 199,                    "Name" : "Cheese",                    "Description" : "Orange, aged 1 year",                    "Price" : "4.99",                    "Rating" : 1,                    "ReleaseDate" : "2014-01-01T00:00:00"                }            },            {                requestUri: getEndPointURL() + "/Products(0)",                method: "PUT",                data: {                    "ID" : 1,                    "Name" : "Bread",                    "Description" : "Whole grain bread",                    "Price" : "2.99",                    "ReleaseDate" : "2014-01-01T00:00:00"                }            }            ]        }    ]    };    oHeaders['Authorization'] = authStr;    //oHeaders['X-SMP-APPCID'] = applicationContext.applicationConnectionId;    //this header is provided by the logon plugin        var request = {        headers : oHeaders,        requestUri : getEndPointURL() + "/$batch",        method : "POST",        data : params    };    OData.request(request, read, errorCallback, OData.batchHandler);
    }
  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios
    Open the offline store and press the Batch Create and Update button.  Notice that a new record Cheese is added and the price of bread is increased from 2.5 to 2.99.
    image17.PNG

Deep Insert

Note, this feature was added in SP08 of the SDK.  A deep insert allows creating a related entity.  With the Kapsel OData Offline plugin the related entity must not be in a one to many relationship.
See also
Create Related Entities When Creating an Entity

This example will add a button that when pressed will add a new category named Toys and a new product named RC Helicopter.  The following steps demonstrate this using the create, update, delete app.

  • Modify the index.html to include the following new button.
    <button id="deepinsert" onclick="deepInsert()">Deep Insert</button>
  • Add the following method to the index.html
    //Example of an insert that also creates a related item (Category). 
    function deepInsert() {
        var oHeaders = {};
        var params = {
            "ID" : 99,
            "Name" : "RC Helicopter",
            "Description" : "Flight time 5 minutes",
            "Price" : "29.99",
            "Rating" : 1,
            "ReleaseDate" : "2014-01-01T00:00:00",
            "Category" : {  //Adding a new category entity
                "ID" : 3,
                "Name" : "Toys"
            },
            //adding navigation properties using entity bindings while offline is not currently supported SP08.
            //
    https://msdn.microsoft.com/en-us/library/dd541294(prot.20).aspx
            /*"Supplier" : {
                "__metadata": {"uri": "/Suppliers(1)"}
              }*/
        };
        oHeaders['Authorization'] = authStr;
            var request = {
            headers : oHeaders,
            requestUri : getEndPointURL() + "/Products",
            method : "POST",
            data : params
        };
        OData.request(request, read, errorCallback);
    }


  • Modify the ProductsForm table to include an the Category column
    <th align="left">Category</th>
  • Modify the readSuccessCallback to include Category and Supplier details.  Add the new cell for Category.
    var cell7 = row.insertCell(6);
    ...
    cell7.innerHTML = data.results[i].Category.Name;
  • Modify the read request to return details of the Supplier and Category so we can confirm that the Deep Insert was successful.
    var sURL = getEndPointURL() + "/Products?$expand=Supplier,Category&$orderby=Name desc";
  • Modify the defining request to include Categories and Suppliers.
    "definingRequests" : {    "ProductsDR2" : "/Products?$expand=Category,Supplier"
    }
  • Prepare, build and deploy the app with the following command.
    cordova run android
    or
    cordova run ios


    Open the offline store and press the Deep Insert button.  Notice that a new record for RC Helicopter is added and it belongs to the new category named Toys.
    image15.PNG

Binary Data/Attachments

There are multiple ways to access binary data in OData.  The following demonstrates a few examples.

Edm.binary

http://services.odata.org/V2/Northwind/Northwind.svc/$metadata

contains

<Property Name="Picture" Type="Edm.Binary" Nullable="true" MaxLength="Max" FixedLength="false"/>

The following URL will return the image data.

http://services.odata.org/V2/Northwind/Northwind.svc/Categories(1)/Picture/$value

The following doesn't appear to show the image.  I am not sure how to make use of the stream returned as the image does not show.

<img src="http://services.odata.org/V2/Northwind/Northwind.svc/Categories(1)/Picture/$value">


Perhaps it is because the Content-Type is application/octet-stream rather than image/jpeg; charset=UTF-8

Media Resources m:HasStream="true"

Support for this was added in SP08 of the SDK.  It is also possible to enable the end user to decide on an attachment by attachment basis which attachments should be made available while offline by calling

store.registerStreamRequest(...) 

For additional details see Offline Media Stream Setup.

https://sapes1.sapdevcenter.com:443/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/$metadata

contains

<EntityType Name="Carrier" m:HasStream="true" sap:content-version="1">
https://sapes1.sapdevcenter.com:443/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/CarrierCollection('SR')

returns

<link href="CarrierCollection('SR')/$value" rel="edit-media" type="image/gif"/><content type="image/gif" src="CarrierCollection('SR')/$value"/><m:properties>    <d:mimeType>image/gif<d:mimeType></m:properties>

It is not clear to me how to access the binary data as the following link does not appear to return the binary data.

https://sapes1.sapdevcenter.com/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/CarrierCollection('SR')/$value

See also
Representing Media Link Entries.

Edm.Stream

This is something introduced in OData v 3.0 and hence is not currently supported in the Kapsel Offline OData plugin with SDK SP08.

http://services.odata.org/V3/OData/OData.svc/$metadata

contains

<Property Name="Photo" Type="Edm.Stream" Nullable="false"/>
http://services.odata.org/V3/OData/OData.svc/PersonDetails(0)?$format=json

returns

{      "odata.metadata":"http://services.odata.org/V3/OData/OData.svc/$metadata#PersonDetails/@Element",    "PersonID":0,    "Age":21,    "Gender":false,    "Phone":"(505) 555-5939",    "Address":{          "Street":"2817 Milton Dr.",        "City":"Albuquerque",        "State":"NM",        "ZipCode":"87110",        "Country":"USA"    },    "Photo@odata.mediaETag":"\"nCP1Tf4Uax96eYIWjvoC/6ZflG8=\""
}   

When accessed via datajs it appears as below.
image16.PNG

 

It is not clear to me how to access the binary data.  I would have expected a media_src entry to describe the URL to be used to retrieve the binary data.  The following URLs do not appear to return anything.

http://services.odata.org/V3/OData/OData.svc/PersonDetails(0)/Photo
http://services.odata.org/V3/OData/OData.svc/PersonDetails(0)/Photo/$value

Troubleshooting

When the store fails to open or fails during a flush or refresh, additional details regarding the error can often be seen in one of three log files; the SMP server log file, the JavaScript console or the device log.
The Offline component of the SMP server should have its log level increased when debugging.

 

image8.PNG

 

The SMP server's log file is located at

C:\SAP\MobilePlatform3\Server\log\YKFN00528072A-smp-server.log

The JavaScript console log can also be useful to monitor. To do so, Open Chrome and press Ctrl Shift I when using an Android 4.4 emulator or device or use Safari on a Mac and choose Develop iPhone Simulator or device.  See also Debugging Appendix.
Finally the Android or iOS log can also be useful.

 

The following are some examples of error conditions and the associated logged messages for these problems.

Version 3 OData Endpoint used with store.open

The endpoint in the management cockpit was modified from

http://services.odata.org/V2/OData/OData.svc
to
http://services.odata.org/V3/OData/OData.svc

JavaScript console from debugging an Android device.

store.open called at 14:20.20 index.html:270
An error occurred "Unknown network error occured" index.html:69
 Device is ONLINE 

Android LogCat Output

10-29 14:20:20.538: I/chromium(16869): [INFO:CONSOLE(270)] "store.open called at 14:20.20", source: file:///android_asset/www/index.html (270)
10-29 14:20:25.653: E/SMP_ODATA(16869): Failed to open store
10-29 14:20:25.653: E/SMP_ODATA(16869): com.sap.smp.client.odata.exception.ODataNetworkException: Unknown network error occured
10-29 14:20:25.653: E/SMP_ODATA(16869): at com.sap.smp.client.odata.offline.ODataOfflineStore.openStoreSync(ODataOfflineStore.java:500)
10-29 14:20:25.653: E/SMP_ODATA(16869): at com.sap.smp.client.odata.offline.ODataOfflineStore$OpenStoreWithOptionsThread.run(ODataOfflineStore.java:406)
10-29 14:20:25.653: E/SMP_ODATA(16869): Caused by: com.sap.smp.client.odata.offline.ODataOfflineException: [-10210] The operation failed due to an error on the server.
10-29 14:20:25.653: E/SMP_ODATA(16869): ... 2 more

Here are some snippets from the SMP server log file.

2014 10 29 14:20:37#0-400#ERROR#com.sap.mobile.platform.server.mobilink.SessionLogger##anonymous#Thread-213###[-100099] An error occurred while parsing the metadata document for service "https://10.7.171.223:8080/com.mycompany.offline" com.sap.odata.offline.util.MODataException: [-100099] An error occurred while parsing the metadata document for service "https://10.7.171.223:8080/com.mycompany.offline"
...
Caused by: org.apache.olingo.odata2.api.ep.EntityProviderException: Invalid or missing namespace for 'Schema'.

Incorrect properties passed to store.open

Notice that the serviceRoot is incorrect.  It has an x added to the end of value.  The service root should be a connection name such as com.mycompany.offline.

var properties = {    "name": "ProductsOfflineStore",    "host": smpServerHost,    "port": smpServerPort,    "https": smpServerProtocol == "https",    "serviceRoot" :  "com.mycompany.offlinex",    "streamParams" : "custom_header=Authorization:" + authStr + ";",    "definingRequests" : {        "ProductsDR" : "/Products"    }
};
store = sap.OData.createOfflineStore(properties);

JavaScript console from debugging an iOS simulator.

[Log] store.open called at 11:10.06 (index.html, line 270)
[Log] An error occurred "[-10210] The operation failed due to an error on the server." (index.html, line 69)
[Log]  Device is ONLINE (index.html, line 264)

Here are some snippets from the SMP server log file.

2014 10 29 11:09:38#0-400#INFO#com.sap.mobile.platform.server.mobilink.SessionLogger##anonymous#Thread-229####null#null#null#info#Offline#null#null#18730952-12fa-4f42-b611-21b1468c5051#null#1414609778664#null#com.sap.mobile.platform.server.mobilink.SessionLogger:info#Service root: https://10.7.171.223:8080/com.mycompany.offlinex#null#385#null#28#null |
...
2014 10 29 11:09:38#0-400#INFO#com.sap.mobile.platform.server.mobilink.SessionLogger##anonymous#Thread-229####null#null#null#info#Offline#null#null#18730952-12fa-4f42-b611-21b1468c5051#null#1414609778745#null#com.sap.mobile.platform.server.mobilink.SessionLogger:info#Sending HTTP GET "https://10.7.171.223:8080/com.mycompany.offlinex/$metadata"#null#385#null#89#null |
2014 10 29 11:09:38#0-400#ERROR#com.sap.mobile.platform.server.mobilink.SessionLogger##anonymous#Thread-229###[-100025] An error occurred while communicating with the OData server to retrieve the result of request "https://10.7.171.223:8080/com.mycompany.offlinex/$metadata" com.sap.odata.offline.util.MODataException: [-100025] An error occurred while communicating with the OData server to retrieve the result of request "https://10.7.171.223:8080/com.mycompany.offlinex/$metadata"
...
Caused by: com.sap.odata.offline.util.MODataException: [-100010] Retrieve metadata failed because the OData server returned HTTP code, 404, with message: null

Incorrect Credentials Passed to store.open

Notice the addition of 123456 to the authorization header

var properties = {    "name": "ProductsOfflineStore",    "host": smpServerHost,    "port": smpServerPort,    "https": smpServerProtocol == "https",    "serviceRoot" :  appID,    //There is a cookie store for JavaScript which is different from the Java one used by the Offline plugin    "streamParams" : "custom_header=Authorization:123456" + authStr + ";custom_header=X-SMP-APPCID:" +  appCID + ";",    "definingRequests" : {        "ProductsDR" : "/Products"    }
};    
store = sap.OData.createOfflineStore(properties);

JavaScript Console from debugging an Android device.

store.open called at 13:53.33 index.html:270
An error occurred "Unknown network error occured" index.html:69
 Device is ONLINE 

Android LogCat Output

10-29 13:53:33.651: I/chromium(754): [INFO:CONSOLE(270)] "store.open called at 13:53.33", source: file:///android_asset/www/index.html (270)
10-29 13:53:56.713: E/SMP_ODATA(754): Failed to open store
10-29 13:53:56.713: E/SMP_ODATA(754): com.sap.smp.client.odata.exception.ODataNetworkException: Unknown network error occured
10-29 13:53:56.713: E/SMP_ODATA(754):   at com.sap.smp.client.odata.offline.ODataOfflineStore.openStoreSync(ODataOfflineStore.java:500)
10-29 13:53:56.713: E/SMP_ODATA(754):   at com.sap.smp.client.odata.offline.ODataOfflineStore$OpenStoreWithOptionsThread.run(ODataOfflineStore.java:406)
10-29 13:53:56.713: E/SMP_ODATA(754): Caused by: com.sap.smp.client.odata.offline.ODataOfflineException: [-10207] Communication with the server failed due to invalid authentication
10-29 13:53:56.713: E/SMP_ODATA(754):   ... 2 more

Here are some snippets from the SMP server log file.

2014 10 29 13:53:59#0-400#ERROR#com.sap.mobile.platform.server.coreservices.configuration.service.ApplicationConnectionServiceImpl##anonymous#http-bio-8080-exec-10####null#null#null#error#Registration#null#null#ddafa3cc1fa24acab78726e30bd48967#null#1414619639774#null#com.sap.mobile.platform.server.coreservices.configuration.service.ApplicationConnectionServiceImpl:isAppConnInputValid#Invalid application connection#null#644#null#0#null |
2014 10 29 13:53:59#0-400#ERROR#com.sap.mobile.platform.server.online.filter.application.SMPApplicationSecurityFilter##anonymous#http-bio-8080-exec-10####null#null#null#error#Other#null#null#ddafa3cc1fa24acab78726e30bd48967#null#1414619639774#null#com.sap.mobile.platform.server.online.filter.application.SMPApplicationSecurityFilter:doFilter#Application connection is not found::null#null#644#null#1#null |

SMP Server not reachable during a Flush or Refresh

JavaScript Console output from debugging an iOS simulator.

[Log] store.flush called at 10:58.56 (index.html, line 537)
[Log] An error occurred "[-10060] An error occurred while performing a synchronization.  Reason: -1305 (MOBILINK_COMMUNICATIONS_ERROR) %1:220 %2:The operation couldn't be completed. Connection refused %3:61" (index.html, line 95)
[Log]  Device is ONLINE (index.html, line 531)

Network Disconnected during a Flush or Refresh

JavaScript Console output from debugging an iOS simulator.

[Log] store.open called at 10:12.04 (index.html, line 537)
[Log] Store opened in  0.694 seconds at 10:12.04 (index.html, line 537)
[Log] Store is OPEN. Device is ONLINE (index.html, line 531)
[Log] store.refresh called at 10:12.10 (index.html, line 537)
[Log]  Device is OFFLINE (index.html, line 531)
[Log] An error occurred "[-10060] An error occurred while performing a synchronization.  Reason: -1305 (MOBILINK_COMMUNICATIONS_ERROR) %1:220 %2:The operation couldn't be completed. Network is unreachable %3:51" (index.html, line 95)
[Log]  Device is OFFLINE (index.html, line 531)

Note, that the flush or refresh operation continues with a short network disconnect.
JavaScript Console output

[Log] store.flush called at 10:56.06 (index.html, line 537)
[Log]  Device is OFFLINE (index.html, line 531)
[Log]  Device is ONLINE (index.html, line 531)
[Log] Store flushed in  15.39 seconds at 10:56.22 (index.html, line 537)

Rewrite URL in SMP

When the offline store is open, URLs that match the defining request are handled by the offline store rather than being sent out over the network.  For this to work correctly the option Rewrite URL in SMP much be selected for the rewrite mode in the Back End tab of the management cockpit.

 

Questions and Answers

Question

Is there any way to add additional "defining Requests" after an OData offline db got created?
There is a product collection with 1 million entries. I do not want to download this complete collection, so I am setting my definingrequest to an OData collection with filter to city eq Berlin. This is working and will create the database for me with a few thousand products. Now I am in another city and want to add the products of that other city, e.g. Hamburg into my already existing offlineDB. Is this somehow possible?

Answer

There is no way to add additional defining requests to an already existing database.  Once a database is created, the defining requests become fixed.
One potential way to work around this is to create multiple stores on your device.  By using different storeName values in the store options, you can have multiple stores existing at the same time.  So you can have a store_Hamburg and a store_Berlin and open either depending on where you are.

Question

Is there any way to perform a free text search on the offline database?
I know that in OData V4 a new $search query parameter got introduced, but I guess this one is not yet available in the offline store.

Answer

The offline store does not yet support the $search query parameter.
However, it does support the $filter indexof operation.  With this, you can do searches such as:

/Products?$filter=indexof(Name, 'wrench') ge 0

to search for entities containing a string

 

 

Question

I know that function imports are not supported in offline. But if there are entities with function imports and without function imports, can we use entities without function imports offline?
Also, what about in the case of variables with size more than 512? If any of the collection having variable size more than 512 can it be used when offline?

Answer

We essentially ignore function imports.  So as long as you don’t try to use them, you can offline other entity sets fine.

 

We currently don’t support KEY properties or REFERENTIAL CONSTRAINT properties with a greater size.  However, all other properties can have a greater size.

Question

I am getting an error when opening my offline store such as

Provided value for the property 'Price' is not compatible with the property

Answer

The V2 spec requires that Edm.Double be represented as a JSON string, but this service is returning them as a JSON floating point number.  The parser in the offline server is strict and expects a string so it is failing when it is parsing the Edm.Double properties.

 

A work around to this issue is to force the offline server to use ATOM when retrieving the defining requests.  That can be done by configuring the offline application using an INI file and using that under Applications > com.mycompany.offline > Import Settings.

Name=com.mycompany.offline5
request_format=atom

 

 

Question

It seems that the OData Offline DB uses a case sensitive search. My customer would like to get results case insensitive.

Answer

The case sensitivity is based on the case sensitivity of the underlying database which is case sensitive by default.  Comparison operations can be made case-insensitive using an application config ini file and setting

case_sensitive_offline_db=no

  However, using substringof with tolower should work fine.  Here is an example of using the tolower method in a filter to avoid case sensitivity.

http://services.odata.org/V2/OData/OData.svc/Products?$format=json&$filter=tolower(Name) eq 'bread'
vs
http://services.odata.org/V2/OData/OData.svc/Products?$format=json&$filter=Name eq 'bread'

 

Question

How many Offline Stores can be open at the same time?  The following error is occurring when opening five offline databases.  [-10067] Could not create the store. Reason: -685

Answer

There is a limit to the total number of Ultralite databases that can be running concurrently as of SP09, and each offline store has 2 databases (the offline store and the request queue).  Currently on a device, the limit is 8 databases which means that a maximum of 4 offline stores can be open at the same time.

 

Question

The following error is seen 09-08 13:12:29.466: I/chromium(13600): [INFO:CONSOLE (1059)] "processMessage failed: Stack: RangeError: Invalid time value 09-08 13:12:29.466: I/chromium(13600): at Date.toISOString (native) 09-08 13:12:29.466: I/chromium(13600): at sap.ui.controller._stringToUTC

Answer

After calling applyHttpClient try adding this line: window.OData.jsonHandler.recognizeDates = true;

 

Question

Is there support for sync/flush operations on the Offline DB when the app is in the background?

Answer

Currently, the Offline Store supports resumable downloads.  So if the app went to the background during a flush/refresh the sync would stop, but the download portion of the sync could be resumed where it left off when the store reopens.

 

 

Back to Getting Started With Kapsel

SAP Fiori - UI Add-on SP13 notes list, SAPUI5 library 1.28.17

$
0
0

Please feel free to update this document.

 

After you have updated to UI_Add-on SP13, you should apply following mandatory notes.

 

1. Double check the mandatory notes.

 

Read carefully the notes description. Some notes points other notes.

 

UI Add-on SP13:

  • 2170223 - General Information: FIORI UI Infrastructure Components Q3/2015
  • 2173693 - Central Note for SAP Fiori Launchpad - UI Add-On 1.0 SP13

 

  • Apply all notes for after SP13:

          Go to http://support.sap.com/notes -> Launch the SAP Note and KBA search

    • Search team = SAPK-74014INSAPUI
    • Application Area = CA*
    • Search team = SAPK-74013INSAPUI
    • Application Area = CA*

 

SAPUI5 library:

  • SAP Fiori LL19 - Steps for updating SAPUI5 libraries
  • 1933498 - Upgrading SAPUI5 version in ABAP systems
  • 2134776 - SAPUI5 Distribution 1.28 - Central Note
  • 2213049 - SAPUI5 upgrade to version 1.28.15
    • 2118663 - Install a patch for SAPUI5 runtime libraries
    • 2150275- SAPUI5 install patch brings version error
    • 2202559- UI2 & USHELL upgrade to version 1.28.12 for UI Add-On 1.0 (SC: UI2_SRVC)
  • 2201552 - Patched version 1.28.15 of SAPUI5 Runtime and standard libraries
  • 2200065 - Corrections in SAP Smart Business shipped with SAPUI5 Distribution version 1.28.11

 

UI Theme Designer:

  • 1852401 - UI Theme Designer for SAP NetWeaver AS ABAP (main SAP Note)
  • 2171959 - UI theme designer for ABAP: Version 1.10.6
  • 2159897 - UI theme designer for ABAP: Images not saved to server

 

2. Check SAPUI5 library version. It should be 1.28.17 or higher.


    http ://<server>:<port>/sap/public/bc/ui5_ui5/index.html

Image 2015-05-06-11.jpg

SAP-Infotag für Data Management Services - "Ready for HANA with DMS/SLO" - 27. Oktober 2015, Bensheim

$
0
0
Hier anmelden>
Sehr geehrte Damen und Herren,

SAP HANA eröffnet Unternehmen zahlreiche innovative Möglichkeiten, Ihre Daten wertschöpfend einzusetzen.

SAP bietet hierzu ein umfassendes Serviceportfolio rund um das Datenmanagement an. Die Services basieren auf unseren Erfahrungen aus einer Vielzahl von Projekten und den SAP Produkten für das Information Management, insbesondere aus neuen Lösungen, die mit SAP HANA für das Datenmanagement zur Verfügung stehen.

Mit unseren Services und Lösungen unterstützen wir unter anderem:

  • Das Management von strukturierten und unstrukturierten Daten
  • Unabhängig von Datentyp und dem Quellsystem
  • Von der Anlage bis zur Archivierung bzw. Löschung
  • Die Datenbereinigung und
  • Die Datenmigration nach SAP HANA


Von zunehmender Bedeutung sind für unsere Kunden geschäftsgesteuerte Veränderungen wie Fusionen, Übernahmen und Umstrukturierungen, die eine Anpassung der SAP-Systemlandschaften und eine Harmonisierung der Daten erforderlich machen. Mit unseren darauf ausgerichteten SAP-System-Landscape-Optimization-Services (SLO) wollen wir Sie bei der Erreichung Ihrer Ziele unterstützen.

Wir laden Sie herzlich zu unserem

SAP-Infotag für Data Management Services "Ready for HANA with DMS/SLO" am 27.10.2015 in Bensheim

ein, um sich umfassend über unsere Lösungen und Services zu informieren und hochaktuelle Fragen zur Datenintegration, Datenmigration und Datenqualität mit uns zu diskutieren:

  • Welche Daten bringe ich auf welche Weise auf die SAP-HANA-Plattform?
  • Wie aktuell sind meine Daten und welchen Nutzen liefern sie?
  • Sind meine Daten vollständig oder redundant? Wie sorge ich dauerhaft für eine hohe Datenqualität?
  • Wie integriere ich bestehende Systeme mit SAP HANA?

Erfahren Sie beispielsweise, wie Sie mit einer exzellenten Datenqualität Ihre operativen Kosten senken und die Handlungsfähigkeit Ihres Unternehmens deutlich steigern können.

Werfen Sie einen Blick in unsere abwechslungsreicheAgendaund melden Sie sich am besten gleich an.

Wir freuen uns auf Ihre Teilnahme!

Mit freundlichen Grüßen

Webseminar: Ihr Weg zu SAP Business Suite 4 SAP HANA: wie SAP HANA Enterprise Cloud und SAP HANA Cloud Platform Ihr Migrationsprojekt erfolgreich machen am 14.10.2015

$
0
0

Zur Anmeldung>


SAP HANA Enterprise Cloud (SAP HEC) und SAP HANA Cloud Platform (SAP HCP) unterstützen Sie, die Herausforderungen der Migration auf die neue SAP Business Suite 4 SAP HANA (SAP S/4HANA) erfolgreich zu meistern.

In diesem Webseminar erfahren Sie, wie Ihnen durch Nutzung von Infrastruktur und Experten-Services der HEC für Ihre SAP-Systeme in Kombination mit HCP für Ihre Eigenentwicklungen und Modifikationen der Weg auf SAP S/4HANA und in die Cloud signifikant erleichtert wird. Resultat sind erhöhte Agilität Ihrer IT bei reduzierten Kosten.

Zielgruppe

Dieses Webseminar richtet sich an IT-Entscheider und Enterprise-Architekten.


Zielsetzung

Erfahren Sie mehr darüber, wie SAP HANA Enterprise Cloud und SAP HANA Cloud Platform Ihre Migration auf SAP S/4HANA unterstützen können.


Das Webseminar ist kostenlos. Sie benötigen lediglich einen Onlinezugang und ein Telefon.

Melden Sie sich gleich an!


Wir freuen uns auf Ihre Teilnahme.


Mit freundlichen Grüßen

Webseminar: SAP Application Management Services für die SAP HANA Enterprise Cloud am 17.11.2015

$
0
0

Zur Anmeldung>


Stehen Sie vor der Herausforderung, Ihre SAP-Basis und die SAP-Applikation selbst zu betreiben oder von SAP betreiben zu lassen?

Erfahren Sie in diesem Webseminar, wie SAP Application Management Services (SAP AMS) den Support, die Pflege und Weiterentwicklungen Ihrer Applikationen im täglichen Betrieb gewährleisten.

Für den Betrieb Ihrer SAP-Applikation in der SAP HANA Enterprise Cloud (SAP HEC) bieten wir Ihnen mit SAP AMS eine individuelle, für die eingesetzten Applikationen maßgeschneiderte, virtuelle SAP IT-Abteilung.


Zielgruppe

Dieses Webseminar richtet sich an IT-Leiter aller Führungsebenen und aller Branchen.


Zielsetzung

Nach dem Webseminar wissen Sie, welchen zusätzlichen Mehrwert SAP AMS als Ergänzung zum SAP-Systembetrieb in der SAP HEC bietet.


Das Webseminar ist kostenlos. Sie benötigen lediglich einen Onlinezugang und ein Telefon.

Melden Sie sich gleich an!


Wir freuen uns auf Ihre Teilnahme.


Mit freundlichen Grüßen

SAP HANA Cloud Platform mobile services - Release Notification

$
0
0

This document contains the latest release information about HANA Cloud Platform mobile services and will be updated regularly. Here you can find links to release notes and release history information.


Please subscribe to this document in order to be notified about changes regarding HCP mobile services by selecting "Receive Email notification" on the right of this document and/or select "Follow".

 

"What's New" information as part of documentation can be found here: SAP HANA Cloud Platform Mobile Services Release Information

 

 

Release VersionInformationRelease Date
HCP mobile services 1.3Release Blog: SAP Hana Cloud Platform mobile services 1.3 released September 30, 2015
HCP mobile services 1.2

Release Blog: SAP HANA Cloud Platform mobile services 1.2 released

HCP mobile services 1.1

Release Blog: SAP HANA Cloud Platform mobile services – Feature Release

HCP mobile services 1.0Release Blog: SAP HANA Cloud Platform mobile services released
HCP mobile services trial

Release Blog: SAP HANA Cloud Platform Mobile Services Trial Availibility

Getting Started: How to enable HANA Cloud Platform Mobile Services Trial

 

Other Information:


To receive regular updates and notification about HCP platform maintenance, please subscribe to the HANA Cloud announce mailing list: hanacloud-announce Info Page

 

 

If you are an HCP mobile services customer and you want to open a support ticket follow the instructions here: Get Support

Please use the support components starting with MOB-CLD as listed here: http://service.sap.com/sap/support/notes/1888290


Filters in Drill Down Pane of HTML5 Dashboards

$
0
0

You may want to understand the purpose of the Filters area in the Drill Down Pane of a HTML5 Dashboard. This can be found when showing the drill down pane for a dashboard report and then expanding the Filters area.

 

 

Reproducing the Issue

  1. Go to the ANALYSIS work center
  2. Go to the DASHBOARDS view
  3. In any of the dashboard reports hit the Show drill down pane icon
  4. Click on Filters

You will see an empty area and no option to filter data like in browser reports

 

DB1.png

Cause

Filters in dashboard have a different meaning than filters which are exposed in reports. Filters in dashboard are filters which have been applied to the report during interaction. In the intial view there are no filters applied to a dashboard. This is why the Filters list is shown empty.

Take for example the Sales Performance dashboard.

There is an interaction between Sales Reps by Revenue in Pipeline (Top 10) - Next 12 Months and Average Sales Cycle - Last 12 Months. When a user clicks on a Sales Rep in the first report this will trigger an interaction for the second report (you can see that the second report refreshes with updated data). This is called filters in dashboard and will be shown for the second report once user does such kind of interaction. If you now open the Filters area again for the second report you will see the name of the Sales Rep that you selected in the first report.

 

DB2.png

Inconsistent index in portal

$
0
0

Symptoms:

  • Index is inactive in 'Indexing Monitor'.
  • Index is not visible in 'Index Administration'.
  • Not able to create index in same name which was deleted earlier.
  • Error during search occured: com.sapportals.wcm.WcmException: com.sapportals.trex.TrexException: Index does not exist; index=<index name>(Errorcode 2007)


Environment:

TREX 7.0/7.1

 

Cause:

Index is directly deleted on standalone TREX admin tool.

 

Solution:

Create index in Standalone TREX Admin Tool.

Go to Standalone TREX Admin Tool -> Index: Landscape -> Right click on page content area -> Choose 'Create Index' -> Use Same Index ID as earlier -> Put '1' in queue server field -> Click on 'Execute'  -> after this run 'Reindex' from portal

SAP Web IDE - Enablement

$
0
0

Getting Started

Create

Extend

Mobile

Analytics

Events

WEB IDE OVERVIEW.png

SAP's Browser Based Development Tool for SAPUI5

 

SAP Web IDE is an extensible development environment with a growing set of embedded tools covering the end-to-end development process. It lets you rapidly design, build, and deploy Fiori-like web applications based on SAPUI5.

  • Improved developer productivity through wizards, templates, and code editors
  • Customize or build SAP Fiori applications
  • Develop your apps once and run them on mobile devices, or your desktop

SAP Web IDE allows developers to collaborate with business experts and designers to fulfill end-users requirements and expectations more effectively.


SAP Web IDE Solution Overview

 

Free Public Trial

You can access SAP Web IDE from the SAP HANA Cloud Platformwebsite - free of charge!  The Getting Started documentation will guide you through your first steps.

 

SAP Web IDE Packaging and Licensing New

SAP HANA Cloud Platform: Pricing and Packaging Options(SAP Web IDE is included in all Get Started / Small Business / Enterprise packages)

 

Wondering what's new in SAP Web IDE?

 

 

Getting Started with SAP Web IDE

 

SAP Web IDE prerequisite: HCP account

  • Web IDE on HCP Trial

           https://account.hanatrial.ondemand.com

          -> logon with your SCN user -> Subscriptions -> webide -> Application URL (bookmark this) starts SAP Web IDE

 

Getting started with SAP Web IDE

  • SAP Web IDE online help

          https://help.hana.ondemand.com/SAP_RDE/frameset.htm?6284a94889db4f3cad001ba674282f20.html

  • This will explain:
    • opening SAP Web IDE
    • entering the Git settings
    • connecting remote systems,
    • including installation and setup of HANA Cloud Connector
    • setting SAP Web IDE preferences
    • enabling external plugins


Troubleshooting

 

 

How to Guides for SAP Web IDE Release 1.12:

 

 


 

 

Local Installation for Trial

 


How to guides

 

How to guides up to release 1.4

How-To Guide (Windows)

How-To Guide (Mac)

  • Download and install Java
  • Download and install the required software
  • Configure and start Eclipse Orion
  • Connect to a remote system Connect to an external Git repository

SAP Web IDE Local Install

DJ Adams demos how to install SAP Web IDE locally

 

Additional Resources for SAP Web IDE

 

 

SCN

 

SAPUI5

 

SAP Web IDE Packaging and Licensing

 

SAP HANA Academy

 

 

People to Follow

 

Marc Anderegg , Jennifer ChaJamie CawleyKeren Rotenberg, Simmaco Ferriero, Chris Whealy

 

 

 

Brought to you by the SAP Technology RIG

Create Menu and Menu Item

$
0
0

This document will helpful to create menu item and add custom webdynpro application to it.

 

Step 1: Create Menu and Menu Item.

 

  • Maintain the details of the Menu and Menu Item using T code : /SCF/UNAVCFG

 

  • Select Application Definition

image1.jpg

 

  • Select Application ID ( In right side Application definition ) then click on Application View.

image2.jpg

  • Select Application View then click on Feature menu

 

  • Create Menu → Click on ‘New Entries'.

image3.jpg

  • Menu Item → Click on ‘New Entries'.


image4.jpg

Note: Here have to use Parent Node ID as Menu Node ID.

 

 

Step 2:  Create Custom webdynpro view for Menu Item.

 

  • Enhance the webdynpro component /SCF/UIWD.

image5.jpg

  • Created view ZMAIN.

image6.jpg

Step 3: To browse custom webdynpro application through menu item.

image7.jpg

  • Click on carrier determination menu item then it navigates to application.

image8.jpg

IBM on-premise cloud configuration for SAP on AIX

$
0
0

This document describes the SAP Landscape Virtualization Management scenarios with AIX. For other IBM platforms refer to the parent document IBM On-Premise Cloud Configuration for SAP.

 

IBM PowerVC is the recommended virtualization management offering, built on OpenStack, that delivers advanced virtualization management on IBM Power Systems. OpenStack technology has evolved as industry standard for infrastructure-as-a-service management. This technology has been made available for SAP on AIX environments by supporting PowerVC with SAP Landscape Virtualization Management.

 

With the introduction of IBM PowerVC leveraging industry standard APIs, the support of older products - namely IBM Systems Director, IBM Flex System Manager and IBM Hardware Management Console (HMC) - is deprecated. HMC 8.3 is the last supported version. We encourage customers to migrate to PowerVC.

 

Virtualization scenarios:

The following virtualization scenarios are supported with any type of storage and storage attachment:

 

Use CaseDescriptionDependencies

End-to-end monitoring and visualization

Show virtualization topology, server and virtualization configuration, and utilization metrics

IBM PowerVC, IBM Systems Director, IBM Flex System Manager, or HMC

Show and monitor AIX Workload Partitions (WPAR)IBM Systems Director WPAR Manager

OS and SAP monitoring

SAP host agent

Operations

Activate/ Deactivate, shutdown virtual system (logical partition)

IBM PowerVC, IBM Systems Director, IBM Flex System Manager, or HMC

Relocate virtual system (live partition mobility)

IBM PowerVC, IBM Systems Director, IBM Flex System Manager, or HMC

Provisioning

Provision new virtual system from image

IBM PowerVC, IBM Systems Director or IBM Flex System Manager, with VMControl and Storage Control

 

 

Storage scenarios:

The following storage-related scenarios are supported:

 

Use CaseDescriptionDependencies

SAP Relocate

Relocate SAP instance or database including storage attachment

SVC, V7000, XIV, DS8000 (NPIV or direct attached SAN)

with Tivoli Storage FlashCopy Manager and/or PowerVC

System Clone/Copy/Refresh

Fast online/offline cloning of database or entire SAP system

System Rename

Rename SAP system and database including user authorization

 

IBM SAN Volume Controller (SVC) provides storage virtualization and allows to combine storage systems from multiple vendors. Likewise, IBM FlashSystems is supported with SVC.

 

If storage is mirrored using SVC or V7000, the administrator can select to create the Clone/Copy/Refresh at the remote site. With this feature most common high-availability/disaster recovery scenarios are supported.

 

Restrictions with PowerVC storage management:

If PowerVC is used for storage management (i.e. no Tivoli Storage FlashCopy Manager installed) the following restrictions apply:

  • System clone/copy/refresh is only supported in offline mode
  • IBM SAN Volume Controller (SVC), IBM Storwize V7000 and XIV are supported.

 

SAP scenarios:

  • Automatic Capacity Management including provisioning of additional dialog instances is supported.
  • Post-Copy Automation is supported.

 

SAP notes and documentation:

 

What is coming next?

OpenStack technology has evolved as industry standard for infrastructure-as-a-service management. Future enhancements in IBM platform management will further utilize OpenStack technology provided by IBM products like PowerVC and IBM Cloud Manager.

 

Online cloning with PowerVC is under investigation.

SAP Crystal Reports, developer version for Microsoft Visual Studio: Updates & Runtime Downloads

$
0
0

Purpose

The purpose of this document is to provide a quick look-up of all Support Packs, Fixed Issues and Distribution File downloads available for SAP Crystal Reports, developer version for Microsoft Visual Studio.

 

Overview

Support Packs for "SAP Crystal Reports, developer version for Microsoft Visual Studio" are scheduled on a quarterly bases. Note:  there has been a small product name change. From Support Pack 5 onwards, the product will be known as SAP Crystal Reports, developer version for Microsoft Visual Studio as opposed to SAP Crystal Reports for Visual Studio 2010.

 

Support Packs, Fixed Issues and Distribution File downloads

Fixes for each Support Pack are prioritized and released on or about end of each yearly quarter. All support packs are full builds of Crystal Reports for Visual Studio 2010/2012, thus it is not necessary to update incrementally. The most recent Support Pack in the below table is listed first.

To keep current and up to date with new releases as well as KBAs and more follow us on Twitter

Update: All Service Packs are cumulative so we are removing the links to previous patches and will be keeping 3 or 4 still active. Links still work if you have them. For installing and starting at the RTM build and progressing to the latest SP is not required.

 

Please note:To integrate "SAP Crystal Reports, developer version for Microsoft Visual Studio" into VS 2010 or 2012 (SP 7 and higher) or VS 2013 (SP 9 or higher) or VS 2015 RC (SP14) - VS 2015 (fully - SP 15), you must run the Install Executable. Running the MSI will not fully integrate Crystal Reports into VS. MSI files by definition are for runtime distribution only.

 

Note 2: SAP Crystal Reports, Developer Version for Visual Studio .NET does NOT support Express Editions of any version of Visual Studio .NET. VS.

 

Install ExecutableFixed IssuesMSI 32 BitMSI 64 Bit

MSM

32 Bit

ClickOnce

32/64

ClickOnce

"Homesite"

WEB XML Deployment

Support Pack 15

(v.13.0.15.1840

SP14 Fixed Issues32bit.msi64bit.msi13_0_15.msnClickonce32/64

clickonce32

clickonce64

crdbxml15.msi

Support Pack 14

(v.13.0.14.1720)

SP14 Fixed Issues32bit.msi64bit.msi13_0_14.msnclickonce32/64

clickonce32

clickonce64

crdbxml14.msi

Support Pack 13

(v.13.0.13.1597)

SP13 Fixed Issues32bit.msi64bit.msi13_0_13.msnclickonce32/64

clickonce32

clickonce64

crdbxml13.msi
Support Pack 12 (v.13.0.12.1494)

SP12 Fixed Issues Wiki

32bit.msi64bit.msi13_0_12.msnclickonce32/64

clickonce32

clickonce64

crdbxml12.msi

Support Pack 10

(v.13.0.10.1385)

SP10 Fixed Issues Wiki32bit.msi64bit.msi13_0_10.msnclickonce32/64

clickonce32

clickonce64

crdbxml10.msi
Support Pack 9 (v. 13.0.9.1312)SP 9 Fixed Issues Wiki32bit.msi64bit.msi13_0_9.msnclickonce32/64

clickonce32

clickonce64

crdbxml9.msi

Support Pack 8 (v. 13.0.8.1216)

SP 8 Fixed Issues Wiki32bit.msi64bit.msi13_0_8.msm

clickonce32/64

See KBA 1957502 for fix

clickonce32

clickonce64

crdbxml8.msi
Support Pack 7 (v. 13.0.7.1136)SP 7 Fixed Issues Wiki32bit.msi64bit.msi13_0_7.msmclickonce32/64

clickonce32

clickonce64

crdbxml7.msi

Support Pack 6

(v. 13.0.6.1027)

SP 6 Fixed Issues Wiki32bit.msi64bit.msi13_0_6.msmclickonce32/64

clickonce32

clickonce64

crdbxml6.msi

Support Pack 5

(v. 13.0.5.x)

SP 5 Fixed Issues

Wiki

32bit.msi64bit.msi13_0_5.msmclickonce32/64

clickonce32

clickonce64

N/A

Support Pack 4

(v. 13.0.4.x)

SP 4 Fixed Issues Wiki32bit.msi64bit.msi13_0_4.msmclickonce32/64

clickonce32

clickonce64

N/A

Support Pack 3

(v. 13.0.3.x)

SP 3 Fixed Issues Wiki32bit.msi64bit.msi13_0_3.msmclickonce32/64

clickonce32

clickonce64

N/A

Support Pack 2

(v. 13.0.2.x)

SP 2 Fixed Issues Wiki32bit.msi64bit.msi13_0_2.msmclickonce32/64

clickonce32

clickonce64

N/A

Support Pack 1

(v. 13.0.1.x)

SP 1 Fixed Issues Wiki32bit.msi64bit.msi13_0_1.msmclickonce32/64

clickonce32

clickonce64

N/A

RTM

(v. 13.0.0.x)

Release Notes

Installation Guide

32bit.msi64bit.msi13_0.msmclickonce32/64

clickonce32

clickonce64

N/A

 

SP 14 - VS 2015 RC (SP14 - CR for VS will not install into Community RC build)

Note: As a temporary workaround for installing SP 14 into Community version of VS 2015 RC build create this key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\DevDiv\vs\Servicing\14.0\professional]

"Install"=dword:00000001

WARNING: Please refer to Knowledge Base article 2007224 for more info on configuring WEB Applications in Visual Studio 2013.

WARNING 2 - SP 11 had Regression issues, please use the latest SP now for all updates

SP 8 ClickOnce Note: There is a minor issue in the Product.xml file for ClickOnce Deployment package.

See Kbase 1957502 or manually modify the file to update the version:

<BypassIf Property="CRRuntime64Version" Compare="VersionGreaterThanOrEqualTo"  Value="13.0.8"/>

Only affects the Developers PC.

Note: Manual deployment of crdb_xml drivers requires manually installing and deploying JRE/JDK

1871962 - How To manually deploy Service Pack 6, and above, crdb_XML data source driver for Crystal Reports Developer for Visual Studio

Note: Clickonce32/64 is managed by the xml file for which one is installed.

1534388 - CRVS2010 - Creating Click Once deployment

Note: Click Once "Homesite" is to tell your installer to go here for the runtime.


Related Content

 

Related Documents

 

SAP Crystal Reports, Developer Version for Microsoft Visual Studio - Supported Platforms

Crystal Reports for Visual Studio .NET SDK Developer Guide

Crystal Reports for Visual Studio .NET SDK API Reference Guide

 

Report Application Server .NET SDK Developer Guide

Report Application Server .NET SDK API Reference Guide

 

All Supported Platforms/PARs

 

Related Notes

1544708  - What are the runtime dependencies for CRVS2010?

1531409  - How to deploy the CRVS2010 runtime when using merge modules?

1606608  - Where is the SDK for VS .NET in Crystal Reports 2011?

1606663  - Does Crystal Reports SDK for VS .NET work with Delphi Prism?

1606621  - What .NET frameworks does CRVS2010 support?

 

For more information, use the search box in the right top corner of this page. Ensure that "All of SAP" is selected from the drop down.

Generar nota de credito con referencia a entrega de devolucion

$
0
0

Hola:

 

Por medio de este documento voy explicar como se puede realizar la nota de crédito de una devolución con referencia a una entrega.

 

Introducción:

 

Con la configuración estándar de SAP la nota de crédito se realiza con referencia al pedido de venta, pero por requerimientos propios del negocio se puede realizar la configuración para realizar con la entrega de devolución.

 

 

Beneficios:

 

Al realizar la nota de crédito con referencia a una nota de entrega se puede garantizar:

 

a) Realizar la nota de crédito después de todo los pasos necesarios, ya que en algunas ocasiones se omite realizar la entrada del material de la devolución.


b) Realizar la nota de crédito por la misma cantidad que se recibió de material en lugar de tener solo la información del pedido de devolución, ya que puede variar la información al recibir el producto.


c) Estandarizar el proceso Pedido - Entrega - Factura para materiales en stock.

 

 

Desarrollo:

 

1. Agregar clase de factura por entrega y borrar clase de factura por pedido.

 

Comercial --> Ventas --> Documentos de ventas --> Cabecera de documentos de ventas --> Definir clase de documento de ventas:

 

Es necesario agregar el tipo de factura para entrega y borrar la clase de factura por pedido.

 

Captura1.JPG

Captura2.JPG

 

2. Indicar el tipo de relevancia para factura para el tipo de posición

 

Comercial --> Ventas --> Documentos de ventas --> Posición documentos de ventas --> Definir tipos de posición:

 

Asignar relevancia para factura basado en la entrega

 

Captura3.JPG

 

3. Asignar control de copia de entrega a factura.

 

Comercial --> Facturación --> Documentos de facturación --> Actualizar control de copia para facturas --> Control de copia: Documento entrega a factura:

 

Se crea e control de copia de entrega a factura.

 

Captura4.JPG

 

Captura5.JPG

 

Captura6.JPG

 

Con esta configuración ya se puede generar la nota de crédito de devolución con referencia a una entrega en lugar del pedido de devolución.

 

Espero les sea de utilidad y quedo en espera de sus comentarios y/o sugerencias.

 

Saludos

 

Jose Antonio Martinez


Sales and operations planning - LTP and Short term planning part 2

$
0
0

Sales and operations planning part 2

Featured Content for Application Lifecycle Management

$
0
0

Events and Replays

SAP Innovation Camp Newtown Square Sept 16-17  - Stretch Your Arms and Legs and Get Ready

SAP TechEd Las Vegas October 19-23, 2015> IT Management Sessions
SAP TechEd Barcelona November 10-12, 2015> IT Management Sessions

SAPPHIRE NOW + ASUG Annual Conference 2015 Orlando: Watch the Replays. Already save the date for next year: May 17-19, 2016

 

News

Video Learn everything about the Innovation Control Center Concept (Joerg Rudat)

Whitepaper SAP MaxAttention Next Generation Add-On (MANGO) Juicing Up SAP Solution Manager

Revised SAP Standards in SAP Support Portal: E2E Support Standards

SAP's Prolonged Commitments: SAP Maintenance 2025

Follow SAP AGS @SAP_AGS

Follow SAP Product Support @SAPSupportHelp.

_______________________________________________________________

 

Blogs and Documents


SAP ONE Support Launchpad: Sneak Preview - License Key Application

http://scn.sap.com/profile-image-display.jspa?imageID=69125&size=72An exciting Sneak Preview about a seamless support experience by Catherine Lynch .October, 2015

 

 

 

 

 

Learn about Maintenance Planner - The Next Generation Experience for Landscape Maintenance with SAP Solution Manager

http://scn.sap.com/profile-image-display.jspa?imageID=66153&size=72Maintenance Planner is a solution hosted by SAP, offers easy maintenance of systems in your landscape and is generally available to all our customers on SAP Support Portal. Learn more from this document (also see Key Topics) and the blogs by Priti Dhingra: Announcing General Availability of Maintenance Planner - Successor of SAP Solution Manager Maintenance Optimizer, Prerequisites and Initial Setup and new: Simplified Installation of SAP Fiori Apps with Maintenance Planner. September, 2015

 

 

 

 

New SAP NetWeaver Guide Finder is Online!

http://scn.sap.com/profile-image-display.jspa?imageID=61005&size=72

Easily find the right guides for your use case, platform and release to install, upgrade/update, copy, rename, split your SAP system by using the new guide finder – read this blog by Sven Gierseor give it a try here! August, 2015

 

 

 

 

Zero Downtime: Mission Accomplished

http://scn.sap.com/profile-image-display.jspa?imageID=62502&size=72Upgrading with zero downtime - not a myth! Mission Zero Accomplished. SAP’s banking customer ATB Financial proved that it can be done. In this blog ATB Financial and Andrea Diederichsshare the success with our community. June, 2015

 

 

 

 

The Value of SAP Maintenance and Support

http://scn.sap.com/profile-image-display.jspa?imageID=62728&size=72

Michael Kleinemeier  provides insights on key areas where SAP delivers high value to customers through support. June, 2015

 

 

 

 

 

Recently Featured Content

Intercompany third party scenario in SAP business ByDesign

$
0
0

Intercompany third party feature/functionality is used to buy stock from your partner company to fulfill your requirements. However your partner do not supply the product to the your company instead he order it from a supplier and instruct this supplier to send it to your company address.

t.jpg

 

By reading this document you will see an example on how you can set this scenario on your system, how you will execute it, and of course, Common issues which you may face.

 

1. Prerequisites

2. Master Data

3. Executing the Scenario

4. References

5. Common Issues

 

1. Prerequisites

 

In Scoping, the following topics must be activated in following order

 

  • The Sell Standard Products business topic in the Product and Service Portfolio for Sales business package.
  • The Sales Orders business topic in the Selling Products and Services business package.
  • The Third-Party Procurement business topic in the Purchase Request and Order Management business package.
  • In the Purchase Requests business topic of the Purchase Request and Order Management business package, the scoping question Do you want purchase orders to be created automatically from purchase requests? has been answered with Yes.
  • You have to select the Purchasing Between Partner Companies business topic.


2. Master Data

 

  • Sending and receiving companies should be defined in your org structure.
  • The Products which you will use are activated for Sales and Purchasing on both companies.
  • A Valid contract or list price for one or more suppliers from which the product can be delivered has been created in the Sourcing and Contracting

        work center.

  • The product is assigned to a product category for which automatic purchase order creation is activated which is done in the Purchase Requests and Orders work center (Define Automatic Creation of Purchase Orders common task).
  • When you create a company on your system, you have a resultant business partner, which has the roles Account and Supplier.
    the output channel Internal EDX must be set for the following business documents in the Business Partner Data work center, on the Communication tab page, under Collaboration

supplier2.png

  • For customer, you need to set the Internal EDX option for the fields "Sales Order Confirmation", "Advanced Shipping Notification Outbound" and "Customer Invoice/Credit Memo".

 

account.png

3. Executing the scenario

 

Your company request XX ea of the product ABC from your partner company. Since they do not have enough stock to cover the demand, they would order it from a supplier and instruct this supplier to send it to your company address.

 

1. Create a purchase order at your company with purchasing unit and employee responsible from your company, partner company as supplier.

 

1.jpg

 

2. This purchase order will create an intercompany sales order with sales unit and employee responsible from your partner company at his company. The fulfillment will be external here and would his supplier from whom he will source the material to your company.

 

2.jpg

 

3. The intercompany sales order will create a third party purchase order at partner company level, with external supplier and ship to as your receiving company.

 

3.jpg

 

4. Create third party delivery notification against third party purchase order as your partner company level which will have following effect

4.a) create third party inbound delivery against third party PO at partner company level

4.b) create third party outbound delivery against SO at partner company level

 

5. Create an inbound delivery notification against the intercompany PO your company level.

 

6. Create an inbound delivery against PO at your company against inbound delivery notification.

 

7. Create a supplier invoice at your partner company level to pay his external supplier against third-party purchase order.

 

8. Create a customer invoice against intercompany sales order at your partner company which will automatic create supplier invoice at your company level against the intercompany purchase order

 

 

4. References

 

In the Help Center you can find the following document which can be followed when setting or executing this scenario:

 

- Intercompany Stock Transfer

- Third-Party Order Processing

SAP Predictive Analytics - 2015 Events

$
0
0

Webinars for SAP Predictive Analysis. Subscribe to stay up-to-date!

TutorialsWebinars

Webinars, Workshops and Events - all about SAP Predictive Analysis. Subscribe to stay up-to-date!

SAP Predictive Analytics - Webinars

 

The SAP Predictive Analytics webinars offer interactive presentations on a variety of Predictive topics for the more familiar user. Content is presented by experts from SAP and our broad partner & customer ecosystem.


Please subscribe to email notifications for this page to be kept informed of the latest events.

All webinar timings and dates are subject to change.

Registrations open no later than a week before the event.

 

 

Solution Expert Series

Public

Data Science Series

Public

Special Interest Group

Focused on SAP Predictive Analytics.

Anyone can register.
Recordings are posted here.

Understand nuances of data science!

Anyone can register.
Recordings are posted here.

Targeted to a specific audience, access might be limited.

 

 

 

Upcoming Webinars - Registrations

DatePresenter
registration 2.png

Data Science Series

A tour of Advanced Predictive Modelling: A Step By Step Case Study (Part II)

Oct 01

RR, PP

registration 2.png

Solution Expert Series

On the Move: SAP Predictive with Vehicle Insights

Nov 05BGPP
registration 2.png

Thought Leader Series

Predictive Analytics Meets the IoT: Harnessing the Opportunity, Overcoming the Challenges

Nov 10Fern Halper
registration 2.png

Data Science Series

Enabling “Smart Finance” through Advanced Analytics

Dec 03PP, YW
h

Webinar Recordings

DatePresenter
thumbnail.png

Data Science Series

Data Science - Recommendation Engines, Challenges and Practices (recording added soon!)

Sep 24

PJ, PP

thumbnail.png

Solution Expert Series

SAP Predictive Analytics - Industry Use Case Examples (recording)

Sep 10MW
thumbnail.png

Expert Series Webinar

SAP Predictive Analytics: Taking a look into the future from your BW on HANA (recording)

Aug 06OC
thumbnail.png

Expert Series Webinar

SAP Predictive - When to choose Expert Mode (recording)

Jun 18JR
thumbnail.png

Data Science Series

New Era of Predictive Analytics  (recording | presentation)

Jun 4

PP

thumbnail.png

Expert Series Webinar

SAP Predictive - Putting Insight to Work (recording)

May 14OC, MW
thumbnail.png

Expert Series Webinar

Data Preparation Made Easy (Presentation)

Apr 15RM, GS
thumbnail.png

Expert Series Webinar

SAP Predictive - Introduction to Advanced Analytics

Mar 26RM , MW

 

 

 

SAP Predictive Analytics - In-Person Events

 

Links to Upcoming In-Person Events

Date

Location

SAP Predictive Analytics WorkshopSep 15Minneapolis,MN, USA
SAP Predictive Analytics WorkshopSep 17Chicago, IL, USA
SAP Predictive Analytics WorkshopSep 22Detroit, MI, USA

LSZ Event “Business Intelligence & Analytics”

including sessions about Predictive Analytics

Sep 24Vienna, Austria
SAP Data Decisions WorkshopSep 24Tampa Bay, FL, USA

Management Events – BI Congress

including sessions about Predictive Analytics

Sep 24Zurich, Switzerland
Strata + Hadoop WorldSep 29 - Oct 1New York, NY, USA

DSAG Annual Congress

including sessions about Predictive Analytics, big SAP booth

Sep 29 - Oct 1Bremen, Germany
SAP Data Decisions Hands-On Workshop - details to followOct 9Houston, TX, USA
SAp Data Decisions Hands-On Workshop - details to followOct 14Atlanta, GA, USA

TechEd Americas

including sessions about Predictive Analytics

Oct 19-23Las Vegas, Nevada, USA

TechEd EMEA

including sessions about Predictive Analytics

Nov 10-12Barcelona, Spain

 

 

 

More Webinars:  Lumira | Design Studio | BI Upgrade | EPM | Web IDE

Measure the Sun with Hana Cloud Platform – Hands On Tutorial - 2.0

$
0
0

Have you ever felt you do not get enough sun at work? This 21 hour hands-on tutorial will allow you to connect a light sensor via a internet-connected microcontroller to a Hana Cloud Platform account to create your very own Internet of Things solution. In HCP you will create a database to store the sensor readings and a small Fiori app that allows you to analyze your exposure to the sun in a table chart. All with a trial account and from the comfort of your browser.

 

 

The Idea is to learn about all of the different pieces: devices, firmware, authentication with tokens instead of users, hana database, odata service and ui5 controls to get an end-to-end impressions of the technologies involved. This is not a reference architecture for a big, real/life project but what you learn will be useful to understand the issues that might occur.

 

 

If you are near Walldorf stop by the d-shop and borrow one of 86 devices we have on hand for this tutorial. In other regions or situations you might simply buy an Arduino Yun or another internet-enabled microcontroller to serve as your device.

 

(please excuse the formatting below - SCN does not allow to upload word files)

 

Measure the Sun with Hana Cloud Platform – Hands On

 

Intention

This tutorial shows you how you can develop a simple IoT application with off the shelf hardware (e.g. borrowed from a fal lab or d-shop near you) and the HCP trial account. You will touch all of the technologies necessary and learn how to make use of them.

 

Prerequisites

You should have a Wifi network available to you and know the network name (aka SSID), the user and the password to login. If you don’t have such a network around you can use the hot spot of a smartphone instead.

 

Overview of the Steps

  1. Create an account in HCP, turn on IoT services and register your device and its sensors
  2. Create an account and code the firmware for the Electric Imp to write sensor data into HCP
  3. Build a sample Fiori app to show the sensor data from OData service as a table

 

Create HCP account and create your device and sensor

This account in the SAP cloud allows you to store your sensor data in the Hana database and then allows you to build additional Java or HTML5 applications on top. Furthermore can you use other services from HCP to support your application like Monitoring, Mobile or even Gamification.

If you are an SAP employee you already have a trial account and a developer user on this account on HCP. If you go to https://account.hanatrial.ondemand.com/ and press logon a certificate with your SAP user id on your SAP PC or SAP iPad will log you in automatically.

If you do not have an HCP trial account you only need an email address and at https://account.hanatrial.ondemand.com/ you can register for a trial account for developers in a few minutes. Login to your trial account to start.

Under “Services” enable the “Internet of Things Services”.

Then “Go to Service”. You will see multiple apps that let you administer your devices and sensors.

Next you need to deploy the Messaging Service app into your HCP account. To do so press “Deploy Message Management Service”. You can now close this browser tab again.

In the HCP cockpit go to “Java Applications” and open the app “iotmms”. Under Roles assign your user id (either something like D039026 or p1501272555 – check in your URL) to the role “IoT-MMS-User”. This will allow you to see the messages posted to your device later in this script.

Now we can register our device and our sensor. To do so in the HCP cockpit go again to the IoT Service under “Services”.

Go to the “Device Types” app and create a new device type called “iotimp”. This is the “model” of the device like “Chevrolet Impala” or like “iPhone 5s”.

Go back to the IoT Services cockpit, start the “Message Types” app and create a new message type called “lightreading” with one field called “light” of type “integer”. This is the kind of message the device can send to the server.

PLEASE take note of the message type id (something like “c5b17a4be2d56c9b0eca”) as you will need it later on the device to send this kind of message.

Lastly from the IoT Services cockpit use the Devices app to create your specific device in the system (e.g. your iPhone 5s with IMEI number …). Use as the name “imp” and append the number written on the electric imp to it (e.g. “imp3”). But make sure you …

… PLEASE make sure you note down the OAuth token (something like “fb1bfcf6ea2216bc39d52b6fccb38”) as this is what you later need to put on your device to authenticate it towards HCP. Otherwise anyone could send this message type on behalf of this device to HCP. This will only be shown here once and if you do not write it down you have to generate a new token (or if someone steels your device then you should also regenerate the token).

PLEASE lastly take note of the device id for your imp (something like “50e1f31c-adf0-4b88-94c0-7d1a80668664”). This is required to identify the device towards HCP.

You have now successfully readied the server part of your IoT application to receive messages from the device. You could (if you wish) send this message from any device via a POST request (e.g. from Chrome with the advanced rest client).

 

Program your Imp to send measurements to HCP

The electric imp hardware comes with a cloud account of its own. This account is used to maintain devices and the firmware on those devices.

Please create a new Account for yourself on the electric imp website at https://ide.electricimp.com/login and login to this account. This account will now be used on a mobile device to onboard your device in the field.

Download the native Electric Imp app on your ios or android device (you can find the apps by searching for “electric imp” in the respective app stores).

Open the app, log in and open “Configure an Imp” or “Other Network”.

Enter the name of your wifi network, user and password. If you are in SAP you can use the network SAP-Internet and leave the password field empty – the imps in use in SAP have been whitelisted.

Turn on the power to the imp (push the white sd card into its slot) – the sd card should be blinking red.

Press the “Send BlinkUp” button and hold the end of the sd card onto the screen of the smart device. There is a photo sensor in the imp which will read the wifi credentials from the blinking screen. You might want to look away as the blinking can be irritating.

Afterwards the Imp should blink green about 20 times and then stop blinking.

Go back to your browser where you are logged in. You should see the new imp with a number as its identifier under “Unassigned Devices”.

Now create a new model called “iotimp” and assign the imp you have just connected to the Internet to this model. If you select the number identifying your imp then you should see that the imp is “online” in the upper right corner.

Select the model and insert the code below into device field (right side of the screen):

 

hardware.pin8.configure(ANALOG_IN); // light sensor is tied to pin 8

 

function mainLoop() {

    local light = hardware.pin8.read(); // reading light sensor value

    agent.send("light", light); // send the value to the server under the label “light”

    imp.wakeup(15, mainLoop); // start this function again in 15 seconds

    };

 

mainLoop();

 

You can now push this code to the device by pressing “Build and Run”. The device is now checking for light level every 15 seconds and is sending it to the electric imp agent in the cloud. But the agent does not do anything with it yet.

To let the agent show the value please paste the following code on the left side of the screen:


device.on("light", function(light) { // whenever we get a "light"

  server.log(light); // we show the value in the log

});


Once you build and run this you should see the sensor values show up in the log at the bottom of the screen. Please take note of the values you get when the light sensor is not covered vs when you cover it with your finger.

To let the agent post the sensor data to HCP please paste the following code on the left side of the screen on the agent side:


device.on("light", function(light) { // whenever we get a "light"

    // replace the following token with your access token

    local headers = {"Authorization":"Bearer fb1bfcf6ea2216bc39d52b6fccb38",

"Content-Type":"application/json;charset=utf-8"};

    // change URL to fit your trial account and device id

    local url = "https://iotmmsp1501272555trial.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/data/50e1f31c-adf0-4b88-94c0-7d1a80668664";

    // adjust message type id to yours

    local body = "{\"mode\":\"sync\", \"messageType\":\"c5b17a4be2d56c9b0eca\", \"messages\":[{\"light\":" + light + "}]}";

    local request = http.post(url, headers, body);

    local response = request.sendsync();

    foreach (index, slot in response)

        {

        server.log(index);

        server.log(slot);

        }

});


Before building and running this you need to replace the url to match your trial account url. You also need to replace the values for device (part fo the url), message type  and authorization token with your values noted earlier.

Once you build and run this your HCP database should fill with data from your sensor. To check this follow the following steps:

Login to the hana cloud platform at https://account.hanatrial.ondemand.com/.

Go to “Services” and then go to the “IoT Services” and then “Go To Service”.

Then jump into the MMS Cockpit app. From there start the “Display stored messages” app.

If you now continuously click on the table icon that has your message type id in its name (in my case T_IOT_C5B17A4BE2D56C9B0ECA) you can see that a new sensor value shows up every 15 seconds. The timestamp is generated by the server and the server is (like all IoT devices) on UTC timezone.

You now have a database filling up with sensor values. The last part shows you how to make use of this sensor data by visualizing it or building other apps on top.

 

Create OData feed and HTML5 app showing the data

We will do this in 2 steps. First we will create an OData service that allows to acces the data from any application. OData is a standard defined by Microsoft and SAP and multiple tools are available from Microsoft (e.g. PowerPivot) and others that can read such OData feeds.

Secondly we will build a small HTML5 app with the open source UI5 controls that you can extend as you see fit for your use case.

To do this again login to the hana cloud platform at https://account.hanatrial.ondemand.com/.

Under “HANA Instances” create a Hana Instance with name “iotinstance”. You can also use an instance that already exists in your trial account – then you need to replace all mentions of iotinstance below with the name of your instance. This instance is the new database we want to use for both storing sensor data and retrieving it.

Now go to Java Applications and stop the “iotmms” app. Delete the Data Source Binding and create a new binding to the HANA XS database instance. Start the application again. Now all sensor data is stored into this new database every 15 seconds.

Go back to the HCP cockpit and under “HANA Instances” open the “SAP HANA Web-based Development Workbench”. You should see your trial account name (e.g. d039026trial) and your hana instance “iotinstance” underneath.

From the menu open the “Catalog”. You will see multiple databases and at least one starting with “NEO_” and one starting with “DEV_”. Expand the databases starting with “NEO_” and the Tables group and find the table that corresponds to your message type ids (In my case it was T_IOT_C5B17A4BE2D56C9B0ECA). Use the right click menu on the table to “Open Content”. This will generate a query on the right side and shows the content of the table.

Please take note of the name of the database and the table for later use (something like "NEO_61PHH4VTB4EOC8CEWTKI5O4BP"."T_IOT_C5B17A4BE2D56C9B0ECA").

Lastly you need to provide access to your user of the content to this table from outside of this workbench. To do so replace the query with the following statement:


GRANT SELECT ON T_IOT_C5B17A4BE2D56C9B0ECA TO p1501272555;

 

Make sure you replace the table name and the user name with your table and user. Press the green button to run this statement. It should execute successfully.

To be able to read the data we will now create an OData service in XS.

Go back to the tab with the HANA web-based development workbench and right click your hana instance “iotinstance” and create a new package called “iotpackage”.

In this package (using right click) create a new file called “.xsapp” and leave it empty. Make sure to save it anyway. To check your result you can see the new app listed in the Hana Cloud Cockpit under HANA XS Applications (you might need to refresh the browser window).

In the HANA web-based development workbench create a new file called “.xsaccess” with the following code and save it. This defines the authentication method that will be used to govern access to the OData service:


{"exposed" : true ,"authentication" : [{"method" : "Basic"}]}

 

Lastly create 1 more file called “iottable.xsodata” and put the following into it:


service { "NEO_61PHH4VTB4EOC8CEWTKI5O4BP"."T_IOT_C5B17A4BE2D56C9B0ECA" key generate local "GeneratedID";}

 

Make sure to replace the name of the database and table with yours. Save it to activate it. This generates an OData service end point on the Hana Cloud Platform that can be called by anyone in the internet.

Now you can actually call the OData service in the browser to see the table by pressing the green button. It will open a URL similar to this in a new browser tab:

 

https://s8hanaxs.hanatrial.ondemand.com/p1501272555trial/iotinstance/iotpackage/iottable.xsodata


If you append the name of your table:


https://s8hanaxs.hanatrial.ondemand.com/p1501272555trial/iotinstance/iotpackage/iottable.xsodata/T_IOT_C5B17A4BE2D56C9B0ECA


You can see your data now in the browser. You can try this from any browser and after logging in you get access to your data from the cloud.


Create a UI5 app to show your data

Back in the HANA web-based development workbench right click your hana package called “iotpackage” and create a new file called index.html with this content:

 

<!DOCTYPE html>

<html>

  <head>

    <meta http-equiv='X-UA-Compatible' content='IE=edge' />

    <meta http-equiv='Content-Type' content='text/html;charset=UTF-8' />

    <title>IoT App</title>

 

    <!-- Bootstrap SAP UI5 libraries -->

    <script id='sap-ui-bootstrap' type='text/javascript'

src='https://sapui5.hana.ondemand.com/resources/sap-ui-core.js'

      data-sap-ui-theme='sap_bluecrystal'

      data-sap-ui-libs='sap.ui.commons, sap.viz, sap.ui.table'>

  </script>

 

  <script>

    var table = new sap.ui.table.DataTable({

    columns : [{

                    label : "Device",

                    template : "G_DEVICE",

            },

            {

                    label : "Light",

                    template : "C_LIGHT"

            },

            {

                    label : "Created",

                    template : "G_CREATED",

                    sortProperty : "G_CREATED"

            }]

    });

 

    //Bind the table to the OData service

    var tableModel = new sap.ui.model.odata.ODataModel("iottable.xsodata", true);

 

    //Define a panel that has a title and that contains some text and the table

    var panel = new sap.ui.commons.Panel();

 

    table.setModel(tableModel);

table.bindRows("/T_IOT_C5B17A4BE2D56C9B0ECA?$orderby=G_CREATED%20desc");

    panel.addContent(table);

 

    //Place the panel in the body of the HTML document

    panel.placeAt("content");

    setInterval(function () {

      table.bindRows("/T_IOT_C5B17A4BE2D56C9B0ECA?$orderby=G_CREATED%20desc");;  

    }, 5000);

 

  </script>

 

  </head>

  <body class='sapUiBody'>

    <div id='content'></div>

  </body>

</html>


Please make sure you change the name of the table in 2 places in this file to your table name.

If you save the file and hit the green run button it should work right away and show your data in a chart and in a table updating every 5 seconds.

 

Reference

This end-to-end walkthrough is based on the help of a few talented people like Martin Raepple, Domnic Savio Benedict, Praharshana Perera, Rui Nogueira, Anika Schwind and Mathias Uwe Berg-Neels who I could not have completed this without. Furthermore there are a lot of tutorials covering individual steps:

http://hcp.sap.com/developers/TutorialCatalog/nat200_04_native_hana_hello_ui5_with_webide.html

https://help.hana.ondemand.com/help/frameset.htm?e4c52854bb571014aeb88753d0dad158.html

https://electricimp.com/docs/gettingstarted/blinkup/

http://hcp.sap.com/developers/TutorialCatalog/nat200_04_native_hana_hello_ui5_with_webide.html

https://help.hana.ondemand.com/help/frameset.htm?3762b229a4074fc59ac6a9ee7404f8c9.html

http://scn.sap.com/community/developer-center/cloud-platform/blog/2013/10/17/8-easy-steps-to-develop-an-xs-application-on-the-sap-hana-cloud-platform

 

Open Ends

It would be great to add predictive.

It would be great to record a video of doing all steps in 2 minutes.

Would be great to base a Smart Business KPI on top – we can do this once Smart Business is available in HCP. It would also be great to show integration to the predictive maintenance application.

It would be great to see what’s needed to make our odata feed fit into Open Data. But making it available publicly (anonym) is not possible on trial accounts.

 

Troubleshooting

If you are stuck it might be necessary to start over with a clean trial account. To do so delete the hana instance (will also delete the hana xs apps), delete all java apps. Then start over at the top of the document.

If your trial account is messed up for whatever reason one more option is to create a new trial account under e.g. your private email address. But unfortunately on an SAP device it is difficult to notlogin to the default trial associated with your sap user id. To do so you either use a non-sap machine or you disable the certificate (under browser settings > certificates and lots of clicks).

One has to first create the table, then create the xs app and the odata service for it, execute the odata top level request once and only then you can grant privileges to your user.

Viewing all 2380 articles
Browse latest View live


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