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

Alerts not triggered/sent in SAP

$
0
0

TROUBLESHOOTING TIPS:

  • Deactivate all the alerts.
  • Ensure ALL alerts have names,even the inactive alerts have to have names excluding special characters such as (*) most commonly occurs when a user tries to list all alerts but is in add mode and ends up adding an alert with the name (*).
  • ALL USER ALERTS,EVEN INACTIVE, SHOULD HAVE A QUERY ATTACHED TO THEM,ANY ALERT WITHOUT A QUERY ATTACHED TO IT USUALLY AFFECTS ALL OTHER ALERTS AND CAUSES ALL ALERTS NOT TO BE TRIGGERED.ATTACH ANY QUERY TO AN INACTIVE ALERT,THIS QUERY DOES NOT NECESSARILY HAVE TO BE RELATED TO THE ALERT BUT SHOULD EXECUTE SUCCESSFULLY.
  • Ensure that all the queries attached to the alerts in the system can be run successfully in SAP without any errors,run each query one by one.This will also help to narrow down to the alert that not being triggered due to an error in the alert query.
  • Once you have discovered the particular alert,activate all the other alerts and set a frequency of between 1 to 5 minutes and confirm that all other alerts are triggered/sent.
  • Ensure the  queries attached to the alert return values.If the there is no data then the alert is triggered but not sent.
  • Ensure one recepient of the alert is logged in at all times(manager logged on the server).This is an application error occuring in some patches on Version 9.0

 

 

Hope this helps.


Dealing with unit of measure in purchasing document and goods movement

$
0
0

We know unit of measure is a vital thing which is used in material master, purchasing document and inventory management etc.  I hope I do not need to elucidate about what a unit of measure is and where it is used. There are lots of SAP help document where you will find all type of details for unit of measure. As we know, there are certain type of unit of measure is used in material master, purchasing document and inventory management like as Base unit of measure, Order unit, Order price unit, stock keeping unit, even you can find more in this SAP help document Units of Measure - Material Master (LO-MD-MM) - SAP Library

Here, I’ll explain how it is used in a purchasing document, from where it can be defaulted, what the priority is for fetching this unit of measure and how the calculation of conversion will be calculated during a creation of purchasing document and goods movement.

As we know, in purchase requisition, we can only have the base unit of measure as unit of measure (EBAN-MEINS). We can’t use any kind of alternate unit of measure (MARM-MEINH) or order unit (MARA- BSTME) in purchase requisition. It is SAP standard design and we can’t change it.

There is another unit of measure field in purchase requisition that is called PO unit (EBAN-BMEIN), this field is used to default the order unit during creation of purchasing document (e.g. Contract, RFQ, Purchase order or Schedule agreement). This field value if coming from source list maintained for the material in ME01 (EORD- MEINS). If there are no source list, then system will pick the unit from source of supply (can be an agreement or a purchase info record).

In this source of supply tab in purchase requisition, you can see multiple order units with regards to same info record. It is depend upon your selection of the tick option “Source determination” (MEREQ_TOPLINE- KZZUO), if you tick this option, then you can’t see multiple order units in this tab, system will fetch only the order unit which is maintained in info record (EINA-MEINS). But if you do not tick this option, then you can able to see all unit of measures which are maintained in your info record condition tab (in case of Variable Purchase Order Unit in active (as 2 - Active with own price) and condition is maintained as per this document Create Info Record for different Order Unit)

In a purchasing document, we can use an alternative unit of measure which is defined in material master (if you are using material master in your purchasing document). If you are not using any material master (for account assigned purchasing document), you need to enter the order unit manually for purchase order line item.

There are some priorities for the order unit (EKPO-MEINS) from where system will fetch the unit of measure. Let’s explain how system reads the unit of measure and how the conversion is calculated during purchasing document creation.

There are 3 ways from where system can fetch the order unit for a purchasing document:

  1. Reference document
  2. Purchase info record
  3. Material master

First priority will be always reference document. If you are creating a purchase order with regards to a contract, then system will always copy order unit (from EKPO-MEINS) and order price unit (from EKPO-BPRME) and all conversion factors from contract and you can’t able to change this order unit. In that case, system will make the order unit as grey mode, but still you can change the order price unit. System will ignore all other reference (like purchase info record or material master).

If you are using a purchase requisition as reference, then order unit will be copied from PO unit (EBAN-BMEIN, which is exists in source of supply tab), here system will allow you to change the order unit. If this field (EBAN-BMEIN) is blank, then system will fetch the order unit from purchase info record.


Second priority will be purchase info record. If you are not using any reference purchasing document, then system will always copy order unit (from EINA-MEINS) and order price unit (from EINE-BPRME) and all conversion factors from purchase info record. In that case, system will allow changing both order unit and ordering price unit.

==>Note: You can always change the order unit in info record (EINA-MEINS) as per your requirement, but system will not update any old purchasing document which was already created by using this info record. It will effect only for new purchasing document.


Third priority will be material master record. If you are not using any reference document or any purchase info record, then system will fetch the order unit and conversion factor (from MARM table) from material master (in that case, order price unit will be same as order unit). First, system will search for the order unit maintained in material master (MARA- BSTME), if there is no order unit, and then system will pick the base unit of measure from material master (MARA- MEINS) as order unit in purchase order line item.

==>Note: If you are using Variable Purchase Order Unit as active (1 or 2), then system will propose base unit of measure as order unit in purchasing document, if there is no order unit maintained in material master. If you active Variable Purchase Order Unit, then system will allow you to change order unit as per your requirement, you just need to maintain the conversion factor in material master. Remember, if you change the order unit manually, then system will not change order price unit automatically, system keeps the existing order price unit, you need to change it manually also.


For the conversion factor, system will always fetch the conversion factor accordingly with regards to the reference document (if any). In case of batch specific conversion, system will ignore all other conversions. The prerequisite is your order unit has to be matched with batch unit.

At the time of creating a service purchase requisition or purchasing document (by using item category D), system will use a default unit of measure (T165-PER_MEINS) which is defined in ML91 and you can’t change it further. For a service requisition or purchasing document, system will always consider the unit of measure which is entered in service tab (ESLL- MEINS) for further process. By the way, changing the order unit (EKPO-MEINS) is controlled by field selection of item category D (field selection PT9F).

==>Note: As of release 606, system will change automatically the purchase order line item’s order unit (EKPO-MEINS) by service tab’s order unit (ESLL-MEINS).


In case of creating an intra-company stock transport order (by using item category U and document type UB), system will not consider the order unit. System will fetch the value from unit of issue (MARC- AUSME). Cause of this behavior, plant to plant transfer is not correspond to purchasing, it quite comes under transfer posting; hence system will not pick the order unit which is maintained in material master. If there is no value defined in this field (unit of issue), then system will fetch the base unit of measure as order unit in stock transport order. In case of using Variable Purchase Order Unit (1 or 2), system will consider Unit of issue as order unit, but then it is possible to change it as per requirement. For inter company stock transport order (using document type NB), system will consider order unit as per normal purchase order.

==>Note: This field (unit of issue) value can be stored in material master (MARC-AUSME) different with regards to plant and also by using unit of issue in material master (MARC- AUSME), system will also consider this unit of measure as ‘Component unit of measure’ in CS01 (STPO-MEINS).


Remember, system will never change any conversion factor or order unit in purchasing document automatically. If there are any changes in material master or info record after a purchasing document created, then you have to create a new purchasing document to bring this new effect. If you carry out any further process (e.g. goods receipt) for any existing document, then system will carry the old order unit or conversion factor for further process.


During goods receipt with regards to a purchase order or schedule agreement, system will always propose you order unit as ‘Unit of Entry’, but you can always change this unit as per your requirement. You just need to be sure that conversion factor of this new unit is maintained in material master; system will pick this conversion from material master. In the same way, during transfer posting, system will allow you to enter different unit of measure in the field ‘Unit of Entry’, system will take the conversion factor from material master. If you will not enter any unit of entry during transfer posting, then system will pick the base unit of measure as unit of entry. For valuation during goods receipt, system will always use the order price unit for GR/IR clearing account’s value and base unit of measure will be considered for stock account line item posting. During physical inventory document, you have the option to enter Unit of entry in MI04 (during count) and MI10 (Create List of Differences w/o Doc.) manually. System will always propose the base unit of measure in this field (Unit of entry (physical inventory)) (ISEG-ERFME), But you can change it from default to any other as per your requirement. You just need to be sure that the conversion factor is maintained in material master. System will take the conversion from material master (MARM table). Once you will enter a different unit of entry in this field, system will calculate the quantity for Base Unit of Measure (ISEG-MEINS) automatically as per maintained conversion in material master.

==>Note: Even though you are using any different unit as ‘Unit of Entry’ during a goods receipt or transfer posting or physical inventory process, system will always update stock as per stock keeping unit (which is base unit of measure). System will update all unit of measures in MSEG table (ERFME = Unit of Entry, MEINS = Stock keeping unit, BSTME = Purchase order’s order unit). Conversion factor will be used as ERFME to MEINS will be picked from material master (MARM table); BSTME to MEINS will be picked from purchasing document (EKPO table). In MB52, you can only see the unit for stock as per base unit of measure, but in MMBE, you can see the stock with different alternative unit of measure by selecting the unit in the field ‘Display Unit of Measure’. In that case, system will calculate the conversion from material master. If you are changing the alternative unit of measure frequently (after done some posting), then you may can see wrong data by using this option, as because system will always take the current conversion from material master.


During sales order creation, system will propose the Sales unit (MVKE-VRKME) from material master for sales order line item (VBAP- VRKME), if the field Sales unit (MVKE-VRKME) is blank in material master, then system will pick the base unit of measure as sales unit. Here, system will allow you to change the unit of measure for sales order item (VBAP- VRKME); you just need to be sure that conversion factor is maintained in material master. You can maintain a different conversion factor for this sales order line item. Once you will change the Sales unit, then you need to change the Condition unit in the document manually. System will not change the Condition unit in the document automatically.

==>Note: In material master, you can use different sales unit as per combination of Sales Organization and Distribution Channel. You may be able to restrict changes for this field via screen variant.


Here is some reference documents for more details about unit of measure.

SAP help documents:
Units of Measure in Purchase Orders - Purchasing (MM-PUR) - SAP Library

Units of Measure in Inventory Management - Inventory Management and Physical Inventory (MM-IM) - SAP Library


Reference OSS notes (KBA and Recommendation note):

187511 - Redesign quantity conversion

1836255 - Units of Measure used in the Valuation of WRX and BSX

77525 - Quantity unit conversion in inventory management

1772735 - Stock Report with Alternative Unit of Measure

1981710 - Wrong unit of measure in RFQ (reference for quotation )

1795967 - If the requisition is generated via MRP the Order unit is not copied from the source list

445239 - ME56/ME57-Source Overview displays numerous OUn

2027096 - Service Purchase Requisition UOM is defaulted and can not be changed at item level.

138767 - Changing the base unit of measure

1597737 - Purchasing Order unit is not defaulted into UB Document type

1994263 - Change of order unit does not update condition unit in Info record

2100007 - Fields about PO Conversion of Order Unit to Base Unit can not be set as editable

1980679 - Why the field 'Unit of Issue' of the supplying plant is taken in STO?

 

SAP OSS notes for program correction regarding unit of measure:

1304204 - Purchase requisition services, no ISO unit of measure

885453 - ME21N: Message 06 480 for PReq without material number

1662759 - Order Unit not derived while creating Outline Agreement

872955 - ME5xN: F4 help for units of measurement in item overview

1115005 - ME51N: Check against the unit UoM of the source of supply

1128924 - Quantity conversion doesn't happen from PR->PO

1714849 - MIRO: Qty conversion in base unit of measure (ACCTIT-MENGE)

1607326 - ME11: Order Unit not taken from material master

1719704 - ME12: Wrong conversion factor after order unit change

1068670 - Units of measure using BAPI_SAG_CREATE/BAPI_CONTRACT_CREATE

Time Variant MDM

$
0
0

Applies to:

SAP MDM 7.1


Summary:

Time is one of the aspect that impact Product in term of its physical characteristics or in terms of perceived effectiveness of its qualities. This has a direct implication on expected revenue for Retailers or Manufacturers and also impact on the operational cost to invest in logistics and inventory management.

 

Therefore it is critical to model this business scenario while defining the Master Data Management solution for enterprise.


This paper talks about as how time variant product scenarios can be modeled using SAP MDM.

 

Author(s):

Ajay Vaidya


Company:

Tata Consultancy Services


Created on:

09 October 2015


Author Bio:

Ajay has been associated with Tata Consultancy Services (world-leading information technology consulting, services organization). He is handling the responsibility of Head of Item MDM Practice in TCS.




Introduction

 

It is well known that each product has shelf life. After the prescribed shelf life product is ceased to fit for purpose. Retail organization always aspire to manage product launching and supply chain effective to get maximum remaining shelf life of the Product in store rather than in inventory, warehouse or in transit.

 

There is one more key dimension that affects the shelf life. Some products change their physical characteristics as time passes away. Some product like season specific or event specific drastically drop their useful value as soon as the season or event is over.

 

Retailers should manage such products effectively to maximize return value.

 

Time variant products that change their physical characteristics are tricky to manage in itself. Organization information management systems should be able to model such products accordingly to reflect its time variant nature. Many organizations know the importance of these aspects but fail to manage appropriately in Information Management.


This paper talks about as how effective management of such time variant products starts from the Master Data Management using SAP MDM.

 

Time Variant Products


Time Variant products are the one that change key aspects, either physical characteristics or its useful life span.


  1. Products value drops drastically after specific time frame though its physical characteristics are intact and fit for use. Such products are typically season use products. For example, rainy products have high demand and value during monsoon season or educational high end products have high demand during back to school season. After the specific time frame, return revenue of those products drops significantly.
  2. Products that change physical characteristics and still continue to be fit for purpose. Such products are typically fresh food products like fruits. For instance, banana could take different physical characteristics and can be sold to be used in that specific physical characteristics. Green bananas product become yellow banana product with complete change in its salable view. Logistics, storage, price and purpose are completely different for green and yellow bananas.

 

Category 2 product are tricky to handle. For instance, green bananas become yellow bananas if kept in inventory for certain time period. Thus the inventory of green banana becomes zero whereas inventory stock for yellow bananas increases all of a sudden without any manual intervention. Effective supply chain and inventory management are key to ensure adequate supply of items in stores. However if such time variant products are not tracked properly with respect to time span, it could lead to non-availability of stock for some products and excess stock for other products.

 

Retail operations should take cognizant of this critical aspect and ensure that at any given point in time product identity is accurately mapped. Retail operating systems should have ability to identify this product identity transition. However it is practically difficult for every operational system to track the identity change.

 

Master Data Management Solution

 

Product Master Data Management (PIM) solution comes to rescue to handle the situation. PIM acts as single source which is reliable, integrated and trusted Product information. PIM should take the responsibility to define as how Product identity changes over the period of time.

 

There are two aspects of the solution:

  1. Tracking the time change for time variant products: This is a responsibility of Retail operations and operational systems to track the inventory and shelf time span of the specific product lot.
  2. Publishing Product identity at any specific time: This is the responsibility of PIM solution. PIM solution defines the multiple product identities and also defines as how those product identities are related to each other. For instance, PIM would define both Green Banana and Yellow Banana products. It also defines a time based rule that reveals the identity of specific product instance / lot provided that time change is tracked by the operational systems.

 

In non time variant products, typically operational system like inventory management system would refer to PIM system to discover detailed physical characteristics and other product details. For instance, PIM system would provide information as how specific product should be stored in inventory, at what temperature it should be stored, what size of packaging hierarchy it would have etc.


The same principle is followed for time variant products as well. The only difference is that the operational system like inventory management system keeps a track of time as when specific lot of Product is stocked in inventory. While referring to PIM system, the inventory management system would also provide the elapsed time since specific product is stocked along with the current product identity details (current product type). In return of this query, PIM system provides details not only about the product characteristics, but it also can provide details about change in product identity (type). For instance, as per the business rule defined in PIM system, if specific time span is already over for Green Banana to become Yellow Banana, the PIM system would provide the new product identity of Yellow banana to the original green banana identity product lot.


Operationa-PIM.jpg

In this way the responsibility to accurately identifying the product identity is split between PIM system and operational systems. Operational systems track the elapsed time span, whereas the PIM system will hold the business rule and reveal accurate product identity at given point in time.

 

SAP MDM Solution Components

 

For sake of simplicity and to illustrate the subject that is being discussed in this paper, other complexities are removed and avoided.

 

Primary Product Catalog (Food Product) holds various products. For simplicity this is considered for only food retailer purpose. Typically such catalog would have multiple types of products including food, non food, grocery, toys etc for a typical retailer. Food Product holds the details of various physical characteristics and as well as additional details of the products.

 

The Food Product is organized by Primary Product Hierarchy (Food Hierarchy). This organizes food products into various hierarchical characteristics.

 

Transformation Catalog holds the transformations to be applied on to time variant products. Transformations are associated with starting product at the beginning of transformation, target product which is a product resulting after the transformation and associated transformation rule.

 

Transformation Rule defines the rules associated with various transformations. These rules could be time variant or time independent. Natural progression is one of the type of time variant transformation rule.


Transformation Rule Type defines the taxonomy and associated category specific attributes that further defines the characteristics of specific transformation rule. Natural Progression types of rules are defined by the elapsed days after which the rule is set to trigger specific action. This action could be simply to change the “Product Type” of specific banana product lot from green to yellow bananas.


Logical Data Model.jpg


SAP MDM Configuration


For sake of simplicity, only specific components are illustrated with dummy data elements. Food Product is a catalog to maintain Food products details for ABC Organization. It holds various types of products and their associated attributes. Only limited set of attributes are defined as example.


FoodProductDM.jpg

Food Hierarchy is defined to illustrate various types of products. Third level in hierarchy is illustrated to describe various products like “Apple and Pear”, “C Vitamin Fruits”, “Organic Fruits” and “Bananas” etc. Bananas are further split into “Green Bananas” and “Yellow Bananas”.


Food Hierarchy Data.jpg


Transformation catalog holds various transactions to be applied on Food product in ABC organization. It holds reference to “Start Product” which is the product at the beginning of the transformation. Whereas “Target Product” is the product that resulted after the transformation. It also hold the reference to transformation rule which is maintained in other catalog. Other vital details are also maintained as part of the “Transformation” that includes but not limited to name of the transformation and transformation identify etc.


TransformationDM.jpg

Transformation Rules are the rules that define actual transformation. Transformation Rules are referenced by Transformations. Transformation Rule hold key basic information like Transformation Rule name and Transformation Rule ID. Transformation Rules are classified in hierarchy that defines attributes associated with specific Transformation Rules.


TransformationRuleDM.jpg

Transformation Rule Type taxonomy defines various types of rules and attributes definition associate with specific type of rules.

 

Transformation Rules are classified in various possible ways the food products can be transformed. Broadly it could be time based transformation where transformations are bound to happen after specific time span. It could be further split into natural progression of transformation or manually introduced transformations. Change in bananas from green bananas to yellow bananas are natural progression transformations. Whereas seasonal variance of price of the product is manually introduced time based transformation. Time independent transformation are one time transformations that are driven by changing business environment. It could include change of the sales geographical location of the specific product to address to certain uptick in product demand in those specific geographical locations.

 

As illustrated, “Days Life” attribute is associated with Natural Progression type. Banana rules illustrated further are mapped to this taxonomy and hence characterized by the numbers of days after that this rule is set to trigger specific action.


TransformationRuleTypeData.jpg

For example, “Banana 6” rule is type of “Natural Progression” and is defined to trigger action after 6 days of elapsed time.

 

TransformationRuleData.jpg

 

To illustrate the example, let us consider that Brand A, Brand B and Brand C bananas are defined across their green and yellow types. ABC Organization sells both green and yellow bananas for Brand A and Brand C.


BrandAGreenBananaData.jpg



Two transformations are defined for Brand A and for Brand C  to transform respective green bananas into respective brand yellow bananas. Each of these transformations are mapped to specific transformation rules. For example Brand A transformation is mapped to “Banana 6” rule. It also specifies that this transformation will transform the product from Brand A green banana to Brand A yellow banana.


BrandATransformationData.jpg



Similarly Brand C is associated with transformation which is further mapped to “banana 8” rule.


BrandCTransformationData.jpg


Defining the service is out of scope for this paper. However it would be straight forward to define a service that would reference to Food Products catalog and Transformation Rules to identify the current point in time Product type for any time variant product inventory.



Summary


Product information is split across Product Master Data Management and with various operational systems. This creates a challenge to effectively handle the time variant products that change physical characteristic of product over the period of time and results into a new salable product.  It is the responsibility of both Product Master Systems and as well operational systems in the landscape to handle time variant products.  With perfect information synchronization between these two types of systems, the time variant product scenario can be effectively handled.


Related Content

SAP MDM Console Guide

SAP MDM Data Manager Guide

Key Capabilities of MDM



BOE 4.x dswsbobje deployment on JBoss Application Server

$
0
0
Business Objects EnterpriseBO 4.2 Full Build
JBoss Application ServerEnterprise Application Platform (EAP) 6.4 [Will also work on JBoss AS 7.2.0]

 

 

Making webservices work on JBoss 6.4 requires a few steps.


Step 1:

Once BOE is installed, locate the "wdeploy\rsa_module" directory.


Copy all files from the following WDeploy RSA module directory:

Path : “<BOE_INSTALL_DIR>\SAP BusinessObjects Enterprise XI 4.0\wdeploy\rsa_module”

 

(Below image is just a reference install on Windows.)

step1_copyfiles.png

 

 

 

Step 2:

On installed JBoss application server,

Create a “com\rsa\main” directory under  this “modules” directory.

Path : “<JBOSS_INSTALL_DIR>\modules\"

 

Paste all files copied in step#1 above.

Path: “<JBOSS_INSTALL_DIR>\modules\com\rsa\main”

Certification opportunities for SAP S/4HANA, on-premise edition 1511

$
0
0

SAP S/4 HANA, on-premise edition 1511 has been released on November 11 and SAP ICC offers the following certification scenarios:

 

 

  • S/4-ABAP 1511
  • S/4-HCM-LOC 1511
  • S/4-B2B-OCI 1.0
  • S/4-HR-PDC 1.0
  • S/4-LE-IDW 1.0
  • S/4-PP-PDC 1.0
  • S/4-QM-IDI 1.0
  • S/4-TAX-US 1.0
  • S/4-WM-LSR 1.0

 

 

The functional scope and the pricing for the certification service will remain the same as for the corresponding scenario offered for SAP Business Suite. To learn more about this just visit the corresponding scenario page, like HR-PDC for S/4-HR-PDC. You can get an overview of all scenarios here.

 

 

Scenarios which require a SAP NetWeaver standalone installation only, are not affected. Here re-certification is only required if an integration scenario has been changed from SAP NetWeaver 7.40 to 7.50

 

 

Because SAP S/4HANA is a brand new product, no existing application specific certification will be valid for S/4HANA, so a re-certification will be required for the above mentioned scenarios.

 

 

SAP S/4HANA is SAPs next-generation business suite, it is not a legal successor of any SAP Business Suite product. It is a new product completely built on one of the most advanced in-memory platform today - SAP HANA - and modern design principles with the SAP Fiori user experience (UX). SAP S/4HANA delivers massive simplifications (customer adoption, data model, user experience, decision making, business processes, and models) and innovations (Internet of Things, Big Data, business networks, and mobile-first) to help businesses Run Simple in the digital economy.

 

 

In the approach to build SAP S/4HANA, SAP is re-architecting its solution for modern business processes demanded by an increasing digitization of the world. Re-architecting a solution that has been growing over the past 25 years means and sometimes evolved into different data structures and architectures means as well that we have to decide on one data structure and architecture moving forward. This is the only way how we can prepare the solution for more simplicity and faster innovation cycles.

 

 

More detailed information on these changes can be found here:

- http://help.sap.com/s4hana_op_1511, then go to Simplification List

- How to analyze and adjust Custom code for S/4HANA

 

 

Certified products will get the following logo:

 

(Will be updated Soon)

 



If you are looking for more information or are already interested in obtaining a S/4HANA integration certification service please contact us: ICC

 

 

 

      

OData 4.0 Services (CRUD) using Olingo(JSON supported): Part-1

$
0
0

1) Import the following  jars for OLINGO

odata-commons-api-4.0.0.jar

odata-commons-core-4.0.0.jar

odata-server-core-4.0.0.jar

slf4j-api-1.7.11.jar

commons-codec-1.9.jar

slf4j-simple-1.7.7.jar

jackson-dataformat-xml-2.4.2.jar

jackson-databind-2.4.2.jar

odata-server-api-4.0.0.jar

jackson-annotations-2.4.2.jar

antlr4-runtime-4.5.jar

stax2-api-3.1.4.jar

org.abego.treelayout.core-1.0.1.jar

jackson-module-jaxb-annotations-2.4.2.jar

commons.lang3-3.3.2.jar

jackson-core-2.4.2.jar

aalto-xml-0.9.10.jar

 

2) Create Provider that extends CsdlAbstractEdmProvider


  1. 1.Define Namespace, Container, EntityType names, EntitySet names.
  2. a. DEFINING NAMESPACE :

publicstaticfinal String NAMESPACE = "OData.Demo";

 

  1. b. DEFINING CONTAINER :

 

publicstaticfinal String CONTAINER_NAME = "Container";

publicstaticfinal FullQualifiedName CONTAINER = new FullQualifiedName(NAMESPACE, CONTAINER_NAME);

 

  1. c. DEFINING ENTITY TYPE NAMES :

publicstaticfinal String ET_STUDENT_NAME = "Student";

publicstaticfinalFullQualifiedNameET_STUDENT_FQN = newFullQualifiedName (NAMESPACE, ET_STUDENT_NAME);

 

publicstaticfinal String ET_SCHOOL_NAME = "School";

publicstaticfinalFullQualifiedNameET_SCHOOL_FQN =FullQualifiedName(NAMESPACE, ET_SCHOOL_NAME);

 

  1. d. DEFINING ENTITY SETS :

publicstaticfinal String ES_STUDENTS_NAME = "Students";

publicstaticfinal String ES_SCHOOLS_NAME = "Schools";

 

  1. e. DEFINING NAVIGATIONS:

 

publicstaticfinal String NAV_TO_SCHOOL = "School";

publicstaticfinal String NAV_TO_STUDENTS = "Students";

 

  1. 2. Override getEntityType, getEntitySet, getEntityContainerInfo, getEntityContainer, getSchemas methods .
  2. a. OVERRIDING getEntityType:

@Override

  public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) {

 

    // this method is called for each EntityType that are configured in the Schema

    CsdlEntityType entityType = null;

 

    if (entityTypeName.equals(ET_STUDENT_FQN)) {

      // create EntityType properties

      CsdlProperty stu_id = new CsdlProperty().setName("stu_id")

          .setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());

      CsdlProperty stu_name = new CsdlProperty().setName("stu_name")

          .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

 

      // create PropertyRef for Key element

      CsdlPropertyRef propertyRef = new CsdlPropertyRef();

      propertyRef.setName("stu_id");

 

      // navigation property: many-to-one, null not allowed (student must have a school)

      CsdlNavigationProperty navProp = new CsdlNavigationProperty().setName(NAV_TO_SCHOOL)

          .setType(ET_SCHOOL_FQN).setNullable(false).setPartner("Students");

      //add all the navigation properties to a list

      List<CsdlNavigationProperty> navPropList = new ArrayList<CsdlNavigationProperty>();

      navPropList.add(navProp);

      

      // configure EntityType

      entityType = new CsdlEntityType();

      entityType.setName(ET_STUDENT_NAME);

      entityType.setProperties(Arrays.asList(stu_id, stu_name));

      entityType.setKey(Arrays.asList(propertyRef));

      entityType.setNavigationProperties(navPropList);

 

    } elseif (entityTypeName.equals(ET_SCHOOL_FQN)) {

      // create EntityType properties

      CsdlProperty school_id = new CsdlProperty().setName("school_id")

          .setType(EdmPrimitiveTypeKind.Int32.getFullQualifiedName());

      CsdlProperty school_name = new CsdlProperty().setName("school_name")

          .setType(EdmPrimitiveTypeKind.String.getFullQualifiedName());

 

      // create PropertyRef for Key element

      CsdlPropertyRef propertyRef = new CsdlPropertyRef();

      propertyRef.setName("school_name");

 

      // navigation property: one-to-many(a school can have many students)

      CsdlNavigationProperty navProp = new CsdlNavigationProperty().setName(NAV_TO_STUDENTS)

          .setType(ET_STUDENT_FQN).setCollection(true).setPartner("School");

\

      //add all navigation properties to a list

      List<CsdlNavigationProperty> navPropList = new ArrayList<CsdlNavigationProperty>();

      navPropList.add(navProp);

 

      // configure EntityType

      entityType = new CsdlEntityType();

      entityType.setName(ET_SCHOOL_NAME);

      entityType.setProperties(Arrays.asList(school_id, school_name));

      entityType.setKey(Arrays.asList(propertyRef));

      entityType.setNavigationProperties(navPropList);

    }

    returnentityType;

 

  }

 

  1. b. OVERRIDING getEntitySets:

 

@Override

  public CsdlEntitySet getEntitySet(FullQualifiedName entityContainer, String entitySetName) {

 

    CsdlEntitySet entitySet = null;

 

    if (entityContainer.equals(CONTAINER)) {

 

      if (entitySetName.equals(ES_STUDENTS_NAME)) {

 

        entitySet = new CsdlEntitySet();

        entitySet.setName(ES_STUDENTS_NAME);

        entitySet.setType(ET_STUDENT_FQN);

 

        // navigation

        CsdlNavigationPropertyBinding navPropBinding = new CsdlNavigationPropertyBinding();

        navPropBinding.setTarget("Schools"); // the target entity set, where the navigation property points to

        navPropBinding.setPath("School"); // the path from entity type to navigation property

        //add all navigation property bindings to a list

List<CsdlNavigationPropertyBinding> navPropBindingList = new ArrayList<CsdlNavigationPropertyBinding>();

        navPropBindingList.add(navPropBinding);

        entitySet.setNavigationPropertyBindings(navPropBindingList);

 

      } elseif (entitySetName.equals(ES_SCHOOLS_NAME)) {

 

        entitySet = new CsdlEntitySet();

        entitySet.setName(ES_SCHOOLS_NAME);

        entitySet.setType(ET_SCHOOL_FQN);

 

        // navigation

        CsdlNavigationPropertyBinding navPropBinding = new CsdlNavigationPropertyBinding();

        navPropBinding.setTarget("Students"); // the target entity set, where the navigation property points to

        navPropBinding.setPath("Students"); // the path from entity type to navigation property

      //add all navigation property bindings to a list

List<CsdlNavigationPropertyBinding> navPropBindingList = new ArrayList<CsdlNavigationPropertyBinding>();

 

        navPropBindingList.add(navPropBinding);

        entitySet.setNavigationPropertyBindings(navPropBindingList);

      }

    }

 

    returnentitySet;

  }

 

  1. c. OVERRIDING getEntityContainerInfo

 

@Override

  public CsdlEntityContainerInfo getEntityContainerInfo(FullQualifiedName entityContainerName) {

 

    // This method is invoked when displaying the service document at

    // eg: http://localhost:8088/school_stu_teachers/DemoService.svc/

    if (entityContainerName == null || entityContainerName.equals(CONTAINER)) {

      CsdlEntityContainerInfo entityContainerInfo = new CsdlEntityContainerInfo();

      entityContainerInfo.setContainerName(CONTAINER);

      returnentityContainerInfo;

    }

 

    returnnull;

  }

 

  1. d. OVERRIDING getSchemas

 

@Override

  public List<CsdlSchema> getSchemas() {

    // create Schema and set the namespace to schema

    CsdlSchema schema = new CsdlSchema();

    schema.setNamespace(NAMESPACE);

 

    // add EntityTypes

    List<CsdlEntityType> entityTypes = new ArrayList<CsdlEntityType>();

    entityTypes.add(getEntityType(ET_STUDENT_FQN));

    entityTypes.add(getEntityType(ET_SCHOOL_FQN));

    schema.setEntityTypes(entityTypes);

 

    // add EntityContainer

    schema.setEntityContainer(getEntityContainer());

 

    // finally add current schema to the list of schemas

    List<CsdlSchema> schemas = new ArrayList<CsdlSchema>();

    schemas.add(schema);

 

    returnschemas;

  }

 

  1. e. DEFINING getEntityContainer

@Override

  public CsdlEntityContainer getEntityContainer() {

 

    // create EntitySets

    List<CsdlEntitySet> entitySets = new ArrayList<CsdlEntitySet>();

    entitySets.add(getEntitySet(CONTAINER, ES_STUDENTS_NAME));

    entitySets.add(getEntitySet(CONTAINER, ES_SCHOOLS_NAME));

    // create EntityContainer

    CsdlEntityContainer entityContainer = new CsdlEntityContainer();

    entityContainer.setName(CONTAINER_NAME);

    entityContainer.setEntitySets(entitySets);

 

    returnentityContainer;

  }

}

 

 

 

 

 

 

 

Metadata:

3)Create processor (for Entity) that implements Entityprocessor:

  1. a. Create readEntity method that gets called on ‘GET’ request

/**

        * This method is invoked when a single entity has to be read. In our

        * example, this can be either a "normal" read operation, or a navigation:

        *

        * Example for "normal" read operation:

        * http://localhost:8080/school_stu_teachers/DemoService.svc/Students(1)

        *

        * Example for navigation

        * http://localhost:8080/school_stu_teachers/DemoService.svc/Students(1)/School

*/

publicvoid readEntity(ODataRequest request, ODataResponse response,UriInfouriInfo, ContentType responseFormat)throws ODataApplicationException, SerializerException {

 

       EdmEntityType responseEdmEntityType = null; // we'll need this to build

                                                                                          //the ContextURL

       Entity responseEntity = new Entity(); // required for serialization of theresponse body

       EdmEntitySet responseEdmEntitySet = null; // we need this for building

 

              // 1st step: retrieve the requested Entity: can be "normal" read

              // operation, or navigation (to-one)

       List<UriResource> resourceParts = uriInfo.getUriResourceParts();

       intsegmentCount = resourceParts.size();

 

       UriResource uriResource = resourceParts.get(0); // in our example, the

                                                                                                // first segment is the

                                                                                                // EntitySet

       if (!(uriResourceinstanceof UriResourceEntitySet)) {

              thrownew ODataApplicationException("Only EntitySet is supported",

                                  HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(),

                                  Locale.ENGLISH);

              }

 

       UriResourceEntitySet uriResourceEntitySet = (UriResourceEntitySet) uriResource;

       EdmEntitySet startEdmEntitySet = uriResourceEntitySet.getEntitySet();

 

              // Analyze the URI segments

       if (segmentCount == 1) {

              // no navigation

       responseEdmEntityType = startEdmEntitySet.getEntityType();

       responseEdmEntitySet = startEdmEntitySet; // since we have only one

                                                                                                                     //http://localhost:8088/school_stu_teachers/DemoService.svc/Schools('psg')

                        if(responseEdmEntityType.getName().equals(DemoEdmProvider.ET_SCHOOL_NAME))

                        {

List<UriParameter> keyPredicates = uriResourceEntitySet.getKeyPredicates();

//get the school entity that has name psg

                                  responseEntity=storage.readEntityDataFromDatabase(responseEdmEntitySet,keyPredicates);

                        }

                      

                            

 

       } elseif (segmentCount == 2) {

                     //eg..Students(1)/School

       System.out.println("segment count 2");

                     // navigation

       UriResource navSegment = resourceParts.get(1); //so gets school entity set

       if (navSegmentinstanceof UriResourceNavigation) {

       UriResourceNavigation uriResourceNavigation = (UriResourceNavigation) navSegment;

       EdmNavigationProperty edmNavigationProperty = uriResourceNavigation.getProperty();

       responseEdmEntityType = edmNavigationProperty.getType();

                           // contextURL displays the last segment

                           //System.out.println(""+startEdmEntitySet.getEntityType());

       responseEdmEntitySet = Util.getNavigationTargetEntitySet(

                                         startEdmEntitySet, edmNavigationProperty);

 

                         

       List<UriParameter> keyPredicates = uriResourceEntitySet.getKeyPredicates();

                           // fetch the data from backend.

                           // e.g. for Students(1)/School we have to find first  Students(1)

                           Entity sourceEntity = storage.readEntityData(startEdmEntitySet,keyPredicates);

 

                           // now we have to check if the navigation is

                           // a) to-one: e.g. Students(1)/School

                           // b) to-many with key: e.g. Schools('psg')/Students(5)

                           // the key for nav is used in this case:

                           // Schools('psg')/Students(5)

List<UriParameter> navKeyPredicates = uriResourceNavigation.getKeyPredicates();

                         

if (navKeyPredicates.isEmpty()) { // e.g. DemoService.svc/Students(1)/School

                                       

responseEntity = storage.getRelatedEntity(sourceEntity,

                                                responseEdmEntityType);

} else { // e.g. DemoService.svc/Schools(3)/Students(5)

                                                                     responseEntity = storage.getRelatedEntity(sourceEntity,

                                                responseEdmEntityType, navKeyPredicates);

                           }

                     }

              } else {

                     // this would be the case for e.g.

                     // Students(1)/School/Students(1)/School

                     thrownew ODataApplicationException("Not supported",

                                  HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);

              }

 

              if (responseEntity == null) {

                     // this is the case for e.g. DemoService.svc/Schools('psg') or

                     // DemoService.svc/Schools('psg')/Students(999) where student with id 999 not exists

                     thrownew ODataApplicationException("Nothing found.",

                                  HttpStatusCode.NOT_FOUND.getStatusCode(), Locale.ROOT);

              }

 

              SelectOption selectOption = uriInfo.getSelectOption();

              ExpandOption expandOption = uriInfo.getExpandOption();

              // in our example: http://localhost:8080/school_stu_teachers/DemoService.svc/Schools('psg')/$expand=Students

              // or http://localhost:8080/school_stu_teachers/DemoService.svc/Students(1)?$expand=Schools

              if(expandOption != null) {

                     //since more than 1 expand option eg. students,teachers

                     for(inti=0;i<expandOption.getExpandItems().size();i++)

                     {

                     // retrieve the EdmNavigationProperty from the expand expression

                     // Note: in our example, we have only one NavigationProperty, so we can directly access it

                     EdmNavigationProperty edmNavigationProperty = null;

                   

                     ExpandItem expandItem = expandOption.getExpandItems().get(i);

                     if(expandItem.isStar()) {

                           List<EdmNavigationPropertyBinding> bindings = responseEdmEntitySet.getNavigationPropertyBindings();

                           // we know that there are navigation bindings

                           // however normally in this case a check if navigation bindings exists is done

                           if(!bindings.isEmpty()) {

                                  //since we have more than 1 nav bindings

                                  EdmNavigationPropertyBinding binding = bindings.get(i);

                                  EdmElement property = responseEdmEntitySet.getEntityType().getProperty(binding.getPath());

                                  // we don't need to handle error cases, as it is done in the Olingo library

                                  if(propertyinstanceof EdmNavigationProperty) {

                                         edmNavigationProperty = (EdmNavigationProperty) property;

                                  }

                           }

                     } else {

                           // can be 'School' or 'Students', no path supported

                           UriResource expandUriResource = expandItem.getResourcePath().getUriResourceParts().get(0);

                           // we don't need to handle error cases, as it is done in the Olingo library

                           if(expandUriResourceinstanceof UriResourceNavigation) {

                                  edmNavigationProperty = ((UriResourceNavigation) expandUriResource).getProperty();

                           }

                     }

 

                     // can be 'School' or 'Students', no path supported

                     // we don't need to handle error cases, as it is done in the Olingo library

                     if(edmNavigationProperty != null) {

                           EdmEntityType expandEdmEntityType = edmNavigationProperty.getType();

                           String navPropName = edmNavigationProperty.getName();

 

                           // build the inline data

                           Link link = new Link();

                           link.setTitle(navPropName);

                           link.setType(Constants.ENTITY_NAVIGATION_LINK_TYPE);

        link.setRel(Constants.NS_ASSOCIATION_LINK_REL + navPropName);

 

                           if(edmNavigationProperty.isCollection()) { // in case of Schools('psg')/$expand=Students

                                  // fetch the data for the $expand (to-many navigation) from backend

                                  // here we get the data for the expand

                                  System.out.println("iscollection");

                                  //get students of given school

                                  EntityCollection expandEntityCollection =

              storage.getRelatedEntityCollection(responseEntity, expandEdmEntityType);

                                  link.setInlineEntitySet(expandEntityCollection);

          link.setHref(expandEntityCollection.getId().toASCIIString());

                           } else// in case of Students(1)?$expand=School

                                  // fetch the data for the $expand (to-one navigation) from backend

                                  // here we get the data for the expand

                                  //get school of given student

                                  Entity expandEntity = storage.getRelatedEntity(responseEntity, expandEdmEntityType);

                                  link.setInlineEntity(expandEntity);

          link.setHref(expandEntity.getId().toASCIIString());

                           }

 

                           // set the link - containing the expanded data - to the current entity

                           responseEntity.getNavigationLinks().add(link);

                     }

              }

                           // 3. serialize

              EdmEntityType edmEntityType = responseEdmEntitySet.getEntityType();

              // we need the property names of the $select, in order to build the context URL

              String selectList = odata.createUriHelper().buildContextURLSelectList(edmEntityType, expandOption, selectOption);

              ContextURL contextUrl = ContextURL.with().entitySet(responseEdmEntitySet)

                                         .selectList(selectList)

                                         .suffix(Suffix.ENTITY).build();

 

              // make sure that $expand and $select are considered by the serializer

              // adding the selectOption to the serializerOpts will actually tell the lib to do the job

              EntitySerializerOptions opts = EntitySerializerOptions.with()

                                         .contextURL(contextUrl)

                                         .select(selectOption)

                                         .expand(expandOption)

                                         .build();

 

              ODataSerializer serializer = this.odata.createSerializer(responseFormat);

              SerializerResult serializerResult = serializer.entity(srvMetadata, edmEntityType, responseEntity, opts);

 

              // 5. configure the response object

              response.setContent(serializerResult.getContent());

              response.setStatusCode(HttpStatusCode.OK.getStatusCode());

              response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());

       }

       //if expand null

              else{

              ContextURL contextUrl =

                            ContextURL.with().entitySet(responseEdmEntitySet).suffix(Suffix.ENTITY).build();

                            EntitySerializerOptions opts =

                            EntitySerializerOptions.with().contextURL(contextUrl).build();

                         

                            ODataSerializer serializer =

                            this.odata.createSerializer(responseFormat);

                            SerializerResult serializerResult =

                            serializer.entity(this.srvMetadata,

                            responseEdmEntityType, responseEntity, opts);

                         

                            // 4. configure the response object

                            response.setContent(serializerResult.getContent());

                            response.setStatusCode(HttpStatusCode.OK.getStatusCode());

                            response.setHeader(HttpHeader.CONTENT_TYPE,

                            responseFormat.toContentTypeString());}

                         

       }

  1. b. Create createEntity method that gets called on ‘POST’ request:

publicvoid createEntity(ODataRequest request, ODataResponse response,

                     UriInfo uriInfo, ContentType requestFormat,

                     ContentType responseFormat) throws ODataApplicationException,

                     DeserializerException, SerializerException {

              List<StudentDto> studList=new ArrayList<StudentDto>();

       EdmEntityType responseEdmEntityType = null; // we'll need this to build

                                                                                         // response body

       EdmEntitySet responseEdmEntitySet = null; // we need this for building

                                                                                         // the contextUrl

 

              // 1st step: retrieve the requested Entity: can be "normal" read

              // operation, or navigation (to-one)

       List<UriResource> resourceParts = uriInfo.getUriResourceParts();

       intsegmentCount = resourceParts.size();

 

       UriResource uriResource = resourceParts.get(0); // in our example, the

first segment is the EntitySet

              if (!(uriResourceinstanceof UriResourceEntitySet)) {

                     thrownew ODataApplicationException("Only EntitySet is supported",

                                  HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(),

                                  Locale.ENGLISH);

              }

 

              UriResourceEntitySet uriResourceEntitySet = (UriResourceEntitySet) uriResource;

              EdmEntitySet startEdmEntitySet = uriResourceEntitySet.getEntitySet();

 

              // Analyze the URI segments

              if (segmentCount == 1) { // no navigation

                     responseEdmEntityType = startEdmEntitySet.getEntityType();

                     responseEdmEntitySet = startEdmEntitySet; // since we have only one

if (responseEdmEntityType.getName().equals(DemoEdmProvider.ET_STUDENT_NAME))

                      {

                   

                   

                            EntityCollection ec=new EntityCollection();

                                  //get data(body)  from post

                                  InputStream requestInputStream = request.getBody();

                                  InputStream is = null;

                                  try {

                                         ObjectMapper mapper = new ObjectMapper();

                                  //     convert inputstream to json

                                         List<Map<String, Object>> jsonmap = mapper.readValue(

                                                       requestInputStream,

                                                       new TypeReference<List<Map<String, Object>>>() {

                                                       });

 

for (Map<String, Object> a : jsonmap) {

       SchoolDto s=new SchoolDto();

       SchoolDo d=new SchoolDo();

       List<Map<String, Object>> stdo=new ArrayList<Map<String, Object>>();

       Map<String, Object> b=new HashMap<String, Object>();

                                  String school_name=(String) a.get("school_name");

                                  s=dao.readSchoolData(school_name);

                                  d=s.getEntity(s);

                                   System.out.println(a.get("studentsDto"));

              stdo= (List<Map<String, Object>>) a.get("studentsDto");

                                  System.out.println(stdo.size());

                                  for(Map<String, Object> i:stdo)

                                  {

                                          StudentDto stuDto=new StudentDto();

                                          ServiceDao dao = new ServiceDao();

                                          StudentDo stuDo=new StudentDo();

                           b.put("stu_name", i.get("stu_name"));   

                           String mapAsJson = new ObjectMapper().writeValueAsString(b);

                                  //Converting json string to java object

                                   StudentDto stud= (StudentDto) fromJson(mapAsJson);

                                

                                   //get studentdo from dto

                                   stuDo=stuDto.getEntity(stud);

                                   stuDo.setSchoolIdRef(d);

                                   dao.create(stuDo);

                                  }

                                  }

                                

                                  }

                                  catch(Exception e)

                                  {System.out.println(e.getMessage());}

                   

                     // 4. configure the response object

              //     response.setContent(serializedResponse.getContent());

                     response.setStatusCode(HttpStatusCode.CREATED.getStatusCode());

                     response.setHeader(HttpHeader.CONTENT_TYPE,

                                  responseFormat.toContentTypeString());

                      }

                      elseif(responseEdmEntityType.getName().equals(DemoEdmProvider.ET_SCHOOL_NAME))

                      {

 

                     InputStream requestInputStream = request.getBody();

                     try {

                           ObjectMapper mapper = new ObjectMapper();

                     //read data (body of post) and convert it to list of maps

                           List<Map<String, Object>> jsonmap = mapper.readValue(

                                         requestInputStream,

                     new TypeReference<List<Map<String, Object>>>() {

                                         });

                   

Map<String, Object> b=new HashMap<String, Object>();

for (Map<String, Object> a : jsonmap) {

                                  // Set<String> b = a.keySet();

 

                                  for (String i : a.keySet()) {

                                         System.out.println("key " + i + " value " + a.get(i));

                                  }

                                

                                  b.put("school_id", a.get("school_id"));

                                  b.put("schoolName", a.get("school_name"));

                                  b.put("studentsDto", a.get("studentsDto"));

                                  b.put("teachersDto", a.get("teachersDto"));

                                  String mapAsJson = new ObjectMapper().writeValueAsString(b);

                                  //Converting json string to java object

                                   SchoolDto scho= (SchoolDto) fromJson1(mapAsJson);

                                  

                                   //create an object in DB

                                   SchoolDto schoolDto=new SchoolDto();

                                   SchoolServiceDao dao = new SchoolServiceDao();

                                   SchoolDo schoolDo=new SchoolDo();

                                   List<SchoolDo> schoolDoList =new ArrayList<SchoolDo>();

                                   //get schooldo from dto

                                   schoolDo=schoolDto.getEntity(scho);

                                   schoolDoList.add(schoolDo);

 

                                  try {

                                         System.out.println(mapAsJson);

                                  } catch (Exception e) {

                                         System.out.println("Exception:"+e.getMessage());

                                  }

                                  System.out.println("hao");

                                  dao.create(schoolDoList);

 

                           }

 

                     } catch (Exception e1) {

                           System.out.println("Exception1:"+e1.getMessage());

                     }

 

            

 

                     // 4. configure the response object

              //     response.setContent(serializedResponse.getContent());

                     response.setStatusCode(HttpStatusCode.CREATED.getStatusCode());

                     response.setHeader(HttpHeader.CONTENT_TYPE,

                                  responseFormat.toContentTypeString());

                    

                      }

                          

              } elseif (segmentCount == 2) {

                     thrownew ODataApplicationException("Not implemented",

                                  HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);

              } else {

                     // this would be the case for e.g.

                     // Students(1)/School/Students(1)/School

                     thrownew ODataApplicationException("Not supported",

                                  HttpStatusCode.NOT_IMPLEMENTED.getStatusCode(), Locale.ROOT);

              }

 

 

       }

OData 4.0 Services (CRUD) using Olingo(JSON supported): Part-2

$
0
0
  1. c. Create updateEntity method that gets called on ‘PUT’ method

publicvoid updateEntity(ODataRequest request, ODataResponse response,

                     UriInfo uriInfo, ContentType requestFormat,

                     ContentType responseFormat) throws ODataApplicationException,

                     DeserializerException, SerializerException {

//eg..http://localhost:8088/school_stu_teachers/DemoService.svc/Schools('gct')

               List<UriResource> resourcePaths = uriInfo.getUriResourceParts();

// Note: only in our example we can assume that the first segment is the EntitySet

UriResourceEntitySet uriResourceEntitySet = (UriResourceEntitySet) resourcePaths.get(0);

//get entityset

EdmEntitySet edmEntitySet = uriResourceEntitySet.getEntitySet();

EdmEntityType responseEdmEntityType = edmEntitySet.getEntityType();

if(responseEdmEntityType.getName().equals(DemoEdmProvider.ET_SCHOOL_NAME))

{

                        intschool_id;

                        //get school name

                         List<UriParameter> keyPredicates = uriResourceEntitySet.getKeyPredicates();

                         for(UriParameter a:keyPredicates)

                         {

                            System.out.println(a.getText().replaceAll("'",""));

                         }

              InputStream requestInputStream = request.getBody();

              try {

                     //convert data(from post) to list of maps

                     ObjectMapper mapper = new ObjectMapper();

                     List<Map<String, Object>> jsonmap = mapper.readValue(

                                  requestInputStream,

                                  new TypeReference<List<Map<String, Object>>>() {

                                  });

            

Map<String, Object> b=new HashMap<String, Object>();

for (Map<String, Object> a : jsonmap) {

 

                           for (String i : a.keySet()) {

                                  System.out.println("key " + i + " value " + a.get(i));

                           }

                         

                           b.put("school_id", a.get("school_id"));

                           b.put("schoolName", a.get("school_name"));

                           b.put("studentsDto", a.get("studentsDto"));

                                                       String mapAsJson = new ObjectMapper().writeValueAsString(b);

                           //convertjson string to dto

                           //ie..convert json object to java object

                            SchoolDto scho= (SchoolDto) fromJson1(mapAsJson);

                                                       SchoolDto schoolDto=new SchoolDto();

                            SchoolServiceDao dao = new SchoolServiceDao();

                            SchoolDo schoolDo=new SchoolDo();

                            schoolDo=schoolDto.getEntity(scho);

                         

 

                           try {

                           } catch (Exception e) {

                                  System.out.println("Exception:"+e.getMessage());

                           }

                           //get school entity

                           Entity school_entity = storage.readEntityData(edmEntitySet, keyPredicates);

                           school_id=(int)school_entity.getProperty("school_id").getValue();

                           //update schoolDo with input Do by matching id

                     dao.update1(schoolDo,school_id);

                     }

 

              } catch (Exception e1) {

                     System.out.println("Exception1:"+e1.getMessage());

              }}

 

               }

  1. d. deleteEntity method that gets called on ‘DELETE’ request

       publicvoid deleteEntity(ODataRequest request, ODataResponse response,

                     UriInfo uriInfo) throws ODataApplicationException {

               // 1. Retrieve the entity set which belongs to the requested entity

       List<UriResource> resourcePaths = uriInfo.getUriResourceParts();

// Note: only in our example we can assume that the first segment is the EntitySet

       UriResourceEntitySet uriResourceEntitySet = (UriResourceEntitySet) resourcePaths.get(0);

       EdmEntitySet edmEntitySet = uriResourceEntitySet.getEntitySet();

       EdmEntityType responseEdmEntityType = edmEntitySet.getEntityType();

          if(responseEdmEntityType.getName().equals(DemoEdmProvider.ET_SCHOOL_NAME))

{

String school_name="";

List<UriParameter> keyPredicates = uriResourceEntitySet.getKeyPredicates();

for(UriParameter a:keyPredicates)

{

//eg. http://localhost:8088/school_stu_teachers/DemoService.svc/Schools('psg')

//here,'psg' is keypredicate

System.out.println(school_name=a.getText().replaceAll("'",""));

}

// storage.deleteEntityData(edmEntitySet, keyPredicates);

SchoolServiceDao dao = new SchoolServiceDao();

//delete entry from db

                     dao.delete(school_name);

 

response.setStatusCode(HttpStatusCode.OK.getStatusCode());

                              }

          else

if(responseEdmEntityType.getName().equals(DemoEdmProvider.ET_STUDENT_NAME))

{

       String student_id="";

                         // 2. delete the data in backend

List<UriParameter> keyPredicates = uriResourceEntitySet.getKeyPredicates();

                         for(UriParameter a:keyPredicates)

                         {

                            //String name=a.getName();

                            System.out.println(student_id=a.getText());

                         }

                       // storage.deleteEntityData(edmEntitySet, keyPredicates);

                        SchoolServiceDao dao = new SchoolServiceDao();

                           dao.delete1(Integer.parseInt(student_id));

                         //dao.delete(4);

                         //3. configure the response object

                         response.setStatusCode(HttpStatusCode.OK.getStatusCode());

                                     }

                   

            

       }

 

3)Create processor (for Entity Collection) that implements EntityCollectionprocessor:

  1. a. Create readEntityCollection method that gets called on ‘GET’ request

/*

   * This method is invoked when a collection of entities has to be read.

   * In our example, this can be either a "normal" read operation, or a navigation:

   *

   * Example for "normal" read entity set operation:

   * http://localhost:8080/DemoService/DemoService.svc/Categories

   *

   * Example for navigation

   * http://localhost:8080/DemoService/DemoService.svc/Categories(3)/Products

   */

  publicvoid readEntityCollection(ODataRequest request, ODataResponse response,

      UriInfo uriInfo, ContentType responseFormat)

      throws ODataApplicationException, SerializerException {

SerializerResult serializerResult=null;

List<UriResource> resourceParts = uriInfo.getUriResourceParts();

              intsegmentCount = resourceParts.size();

              System.out.println("segment count"+segmentCount);

// 1st: retrieve the requested EntitySet from the uriInfo (representation of the parsed URI)

List<UriResource> resourcePaths = uriInfo.getUriResourceParts();

// in our example, the first segment is the EntitySet

UriResourceEntitySet uriResourceEntitySet = (UriResourceEntitySet) resourcePaths.get(0);

EdmEntitySet edmEntitySet = uriResourceEntitySet.getEntitySet();

// 2nd: fetch the data from backend for this requested EntitySetName and deliver as EntitySet

EntityCollection entityCollection = storage.readEntitySetDataFromDatabase(edmEntitySet);

List<UriParameter> keyPredicates = uriResourceEntitySet

                           .getKeyPredicates();

       

System.out.println("segment c");

 

if(segmentCount==1){

//eg..http://localhost:8088/school_stu_teachers/DemoService.svc/Schools

         //  EntityCollection entityCollection = storage.readEntitySetData(edmEntitySet);

EntityCollection modifiedEntityCollection = new EntityCollection();

List<Entity> modifiedEntityList = new ArrayList<Entity>();

modifiedEntityList.addAll(entityCollection.getEntities());

                   

                     // 3rd: Apply system query option

              // The system query options have to be applied in a defined order

                     // 3.1.) $filter

       

modifiedEntityList = applyExpandQueryOption(modifiedEntityList, edmEntitySet, uriInfo.getExpandOption());

// 3.8.) $select

SelectOption selectOption = uriInfo.getSelectOption();

 

// Set the (may) modified entityList to the new entity collection

modifiedEntityCollection.getEntities().addAll(modifiedEntityList);

 

// 4th: create a serializer based on the requested format (json)

ODataSerializer serializer = odata.createSerializer(responseFormat);

                   

// we need the property names of the $select, in order to build the context URL

                     EdmEntityType edmEntityType = edmEntitySet.getEntityType();

String selectList = odata.createUriHelper()

.buildContextURLSelectList(edmEntityType, uriInfo.getExpandOption(), selectOption);

ContextURL contextUrl = ContextURL.with().entitySet(edmEntitySet).selectList(selectList).build();

 

// adding the selectOption to the serializerOpts will actually tell the lib to do the job

final String id = request.getRawBaseUri() + "/" + edmEntitySet.getName();

EntityCollectionSerializerOptions opts = EntityCollectionSerializerOptions.with()

.contextURL(contextUrl)

.count(uriInfo.getCountOption())

.select(selectOption)

.expand(uriInfo.getExpandOption())

                                                                                     .id(id)

.build();

serializerResult = serializer.entityCollection(srvMetadata, edmEntityType,

entityCollection, opts);

  }

if(segmentCount==2){

//eg..http://localhost:8088/school_stu_teachers/DemoService.svc/Schools('psg')/Students

//in this case get(1) represents schools entity set

                        UriResource navSegment = resourceParts.get(1);

                        UriResourceNavigation uriResourceNavigation = (UriResourceNavigation) navSegment;

                           EdmNavigationProperty edmNavigationProperty = uriResourceNavigation

                                         .getProperty();

                           EdmEntityType targetEntityType = edmNavigationProperty.getType();

                           // contextURL displays the last segment

                           //System.out.println(" "+startEdmEntitySet.getEntityType());

                           EdmEntitySet TargetEntitySet = Util.getNavigationTargetEntitySet(

                                         edmEntitySet, edmNavigationProperty);

//in this case keypredicates is 'psg'

if(keyPredicates.size()!=0 && keyPredicates!=null)

{

//get school that has name 'psg'...ie) get school entity

Entity entity = storage.readEntityDataFromDatabase(edmEntitySet,keyPredicates);

                      

                        //here, get students for the related school ie) students of school psg

entityCollection=storage.getRelatedEntityCollection(entity, targetEntityType);

}

ODataSerializer serializer = odata.createSerializer(responseFormat);

ContextURL contextUrl = ContextURL.with().entitySet(TargetEntitySet).build();

final String id = request.getRawBaseUri() + "/" + TargetEntitySet.getName();

EntityCollectionSerializerOptions opts = EntityCollectionSerializerOptions.with()

                    .contextURL(contextUrl)

                    .count(uriInfo.getCountOption())

                    .id(id)

                    .build();

serializerResult = serializer.entityCollection(srvMetadata, targetEntityType,

entityCollection, opts);   

}

// and serialize the content: transform from the EntitySet object to InputStream

        

InputStream serializedContent = serializerResult.getContent();

// 5th: configure the response object: set the body, headers and status code

response.setContent(serializedContent);

response.setStatusCode(HttpStatusCode.OK.getStatusCode());

response.setHeader(HttpHeader.CONTENT_TYPE, responseFormat.toContentTypeString());

         }

  1. b. Method for ‘expand’ query option

  private List<Entity> applyExpandQueryOption(List<Entity> modifiedEntityList,

EdmEntitySet edmEntitySet, ExpandOption expandOption) {

// in our example: http://localhost:8088/school_stu_teachers/DemoService.svc/Schools?$expand=Students

// or http://localhost:8088/school_stu_teachers/DemoService.svc/Students?$expand=School

if (expandOption != null) {

//since we have more than 1 navigation property ie..students and teachers,we use loop

//http://localhost:8088/school_stu_teachers/DemoService.svc/Schools?$expand=Students,Teachers

              for(inti=0;i<expandOption.getExpandItems().size();i++){

// retrieve the EdmNavigationProperty from the expand expression

 

EdmNavigationProperty edmNavigationProperty = null;

ExpandItem expandItem = expandOption.getExpandItems().get(i);

if (expandItem.isStar()) {

List<EdmNavigationPropertyBinding> bindings = edmEntitySet.getNavigationPropertyBindings();

// we know that there are navigation bindings

// however normally in this case  check if navigation bindings exists

if (!bindings.isEmpty()) {

//since we have more than 1 navigation binding ie. for teachers,for students

EdmNavigationPropertyBinding binding = bindings.get(i);

EdmElement property = edmEntitySet.getEntityType().getProperty(binding.getPath());

// we don't need to handle error cases, as it is done in the Olingo library

if (propertyinstanceof EdmNavigationProperty) {

                   edmNavigationProperty = (EdmNavigationProperty) property;

}

}

} else {

// can be 'School' or 'Students', no path supported

UriResource uriResource = expandItem.getResourcePath().getUriResourceParts().get(0);

// we don't need to handle error cases, as it is done in the Olingo library

if (uriResourceinstanceof UriResourceNavigation) {

edmNavigationProperty = ((UriResourceNavigation) uriResource).getProperty();

}

}

 

          // can be 'School' or 'Students', no path supported

// we don't need to handle error cases, as it is done in the Olingo library

if (edmNavigationProperty != null) {

String navPropName = edmNavigationProperty.getName();

EdmEntityType expandEdmEntityType = edmNavigationProperty.getType();

 

for (Entity entity : modifiedEntityList) {

Link link = new Link();

link.setTitle(navPropName);

link.setType(Constants.ENTITY_NAVIGATION_LINK_TYPE);

link.setRel(Constants.NS_ASSOCIATION_LINK_REL + navPropName);

 

if (edmNavigationProperty.isCollection()) { // in case of Schools/$expand=Students

                   // fetch the data for the $expand (to-many navigation) from backend

EntityCollection expandEntityCollection = storage.getRelatedEntityCollection(entity, expandEdmEntityType);

                   link.setInlineEntitySet(expandEntityCollection);

                   link.setHref(expandEntityCollection.getId().toASCIIString());

} else { // in case of Students?$expand=School

// fetch the data for the $expand (to-one navigation) from backend

                   // here we get the data for the expand

                   Entity expandEntity = storage.getRelatedEntity(entity, expandEdmEntityType);

                   link.setInlineEntity(expandEntity);

                   link.setHref(expandEntity.getId().toASCIIString());

}

 

// set the link - containing the expanded data - to the current entity

entity.getNavigationLinks().add(link);

}

}

}

}

returnmodifiedEntityList;

         }

OData 4.0 Services (CRUD) using Olingo(JSON supported): Part-3

$
0
0

4)Create a class ‘Storage.java’

  1. a. readEntitySetDataFromDatabase

/* This method is called from readEntityCollection

   * It is used to fetch the list of students /schools from database

   * depending on the entityset provided

*/

 

public EntityCollection readEntitySetDataFromDatabase(EdmEntitySet edmEntitySet)

{

        EntityCollection entityCollection = new EntityCollection();

        if (edmEntitySet.getName().equals(DemoEdmProvider.ES_STUDENTS_NAME)) {

              // entityCollection = getStudents();

               List<SchoolDo> SchoolDoList = dao.readAll();

Entity entity =null;

 

for(SchoolDo Do:SchoolDoList)

{

for(StudentDo a:Do.getStudentsDo())

{

entity = new Entity();

entity.addProperty(new Property(null, "stu_id", ValueType.PRIMITIVE, a.getStu_id()));

entity.addProperty(new Property(null, "stu_name", ValueType.PRIMITIVE,a.getStu_name()));

 

           entity.setType(DemoEdmProvider.ET_STUDENT_FQN.getFullQualifiedNameAsString());

entity.setId(createId(entity, "stu_id"));

// schoolList.add(entity);

entityCollection.getEntities().add(entity);

                     }

System.out.println("testing1 students");

}

 

 

}

elseif (edmEntitySet.getName().equals(DemoEdmProvider.ES_SCHOOLS_NAME)) {

List<SchoolDo> SchoolDoList = dao.readAll();

Entity entity =null;

 

for(SchoolDo Do:SchoolDoList)

{

entity = new Entity();

entity.addProperty(new Property(null, "school_id", ValueType.PRIMITIVE, Do.getSchool_id()));

entity.addProperty(new Property(null, "school_name", ValueType.PRIMITIVE,Do.getSchoolName()));

 

           entity.setType(DemoEdmProvider.ET_SCHOOL_FQN.getFullQualifiedNameAsString());

entity.setId(createId(entity, "school_name"));

System.out.println(entity.getId());

// schoolList.add(entity);

entityCollection.getEntities().add(entity);

System.out.println("testing1 schools");

}

 

//System.out.println("hai");

//schoolList);

}

        returnentityCollection;

}

  1. b. readEntityData

/* This method is called from readEntity or updateEntity

* */

  public Entity readEntityData(EdmEntitySet edmEntitySet, List<UriParameter> keyParams) {

    Entity entity = null;

 

    EdmEntityType edmEntityType = edmEntitySet.getEntityType();

 

      entity =readEntityDataFromDatabase(edmEntitySet, keyParams);

 

   

 

    returnentity;

  }

  1. c. readEntitySetDataFromDatabase

/* This method is called from readEntityData

* */

 

public Entity readEntityDataFromDatabase(EdmEntitySet edmEntitySet, List<UriParameter> keyParams) {

       

Entity entity = new Entity();

 

EdmEntityType edmEntityType = edmEntitySet.getEntityType();

 

if (edmEntityType.getName().equals(DemoEdmProvider.ET_STUDENT_NAME)) {

entity = getStudent(edmEntityType, keyParams);

} elseif (edmEntityType.getName().equals(DemoEdmProvider.ET_SCHOOL_NAME)) {

      

String school_name=null;

                for(UriParameter a:keyParams)

                            {

                                  school_name=a.getText().replaceAll("'", "");

                                                              }

              List<SchoolDo> SchoolDoList = dao.readAll();

              for(SchoolDo Do:SchoolDoList)

       {

             

              if(Do.getSchoolName()!=null){

              if(Do.getSchoolName().equalsIgnoreCase(school_name))

              {

                                  

                  entity.addProperty(new Property(null, "school_id", ValueType.PRIMITIVE, Do.getSchool_id()));

                  entity.addProperty(new Property(null, "school_name", ValueType.PRIMITIVE,Do.getSchoolName()));

               

           entity.setType(DemoEdmProvider.ET_SCHOOL_FQN.getFullQualifiedNameAsString());

                 entity.setId(createId(entity, "school_id"));

              }}

       }

}

 

returnentity;

         }

  1. d. getStudent

/* This method is called from readEntitySetDataFromDatabase

This method for eg..fetches the required student from the list of students from database */

  private Entity getStudent(EdmEntityType edmEntityType, List<UriParameter> keyParams) {

String stu_id=null;

    // the list of entities at runtime

         for(UriParameter w:keyParams)

         {

               stu_id = w.getText();

         }

    EntityCollection entityCollection = getStudentsFromDatabase(Integer.parseInt(stu_id));

 

    /* generic approach to find the requested entity */

    return Util.findEntity(edmEntityType, entityCollection, keyParams);

  }

  1. e. getStudentsFromDatabase

 

/* This method is called from getStudent

This method returns all the students from database */

 

private EntityCollection getStudentsFromDatabase(intstu_id)

{

       Entity entity=null;

EntityCollection collect=new EntityCollection();

       Session session = MySessionFactory.getConnection().openSession();

       SchoolDto dto=new SchoolDto();

              //List<SchoolDto> listDto=new ArrayList<SchoolDto>();

              Criteria c= session.createCriteria(StudentDo.class);

              c.add(Restrictions.eq("stu_id", stu_id));

              List<StudentDo> list = c.list();

              for(StudentDo ldo:list)

              {

                     entity=new Entity();

                     entity.addProperty(new Property(null, "stu_id", ValueType.PRIMITIVE, ldo.getStu_id()));

entity.addProperty(new Property(null, "stu_name", ValueType.PRIMITIVE, ldo.getStu_name()));

entity.addProperty(new Property(null, "schoolIdRef", ValueType.PRIMITIVE, ldo.getSchoolIdRef()));

entity.setType(DemoEdmProvider.ET_STUDENT_FQN.getFullQualifiedNameAsString());

entity.setId(createId(entity, "stu_id"));

 

                     collect.getEntities().add(entity);

              }

returncollect;

}

  1. f. getRelatedEntity

/*This method is called from applyExpandQueryOption

which in turn calls getRelatedEntityCollection

* */

public Entity getRelatedEntity(Entity entity, EdmEntityType relatedEntityType) {

    EntityCollection collection = getRelatedEntityCollection(entity, relatedEntityType);

    if (collection.getEntities().isEmpty()) {

      returnnull;

    }

    returncollection.getEntities().get(0);

  }

/*This method is called from readEntity

which in turn calls getRelatedEntityCollection

* */

public Entity getRelatedEntity(Entity entity, EdmEntityType relatedEntityType, List<UriParameter> keyPredicates) {

 

    EntityCollection relatedEntities = getRelatedEntityCollection(entity, relatedEntityType);

    return Util.findEntity(relatedEntityType, relatedEntities, keyPredicates);

  }

 

  1. g. getRelatedEntityCollection

/*This method is called from getRelatedEntity

* This method returns all the students/schools depending upon the targetEntityType

* if targetEntityType is students then it returns all the students of the

* corresponding sourceEntity(eg..schools(‘psg’))

* */

public EntityCollection getRelatedEntityCollection(Entity sourceEntity, EdmEntityType targetEntityType) {

    EntityCollection navigationTargetEntityCollection = new EntityCollection();

    Entity entity=null;

    FullQualifiedName relatedEntityFqn = targetEntityType.getFullQualifiedName();

    String sourceEntityFqn = sourceEntity.getType();

 

    if (sourceEntityFqn.equals(DemoEdmProvider.ET_STUDENT_FQN.getFullQualifiedNameAsString())

        && relatedEntityFqn.equals(DemoEdmProvider.ET_SCHOOL_FQN)) {

       System.out.println("get related entity collection method");

       navigationTargetEntityCollection.setId(createId(sourceEntity, "stu_id", DemoEdmProvider.NAV_TO_SCHOOL));

       intstu_id = (int) sourceEntity.getProperty("stu_id").getValue();

      

      

       for(SchoolDto sdto:dao.readStudentData(stu_id))

       {

              entity = new Entity();

              System.out.println("stu id is"+sdto.getSchool_id());

           entity.addProperty(new Property(null, "school_id", ValueType.PRIMITIVE, sdto.getSchool_id()));

           entity.addProperty(new Property(null, "school_name", ValueType.PRIMITIVE, sdto.getSchoolName()));

          

           entity.setType(DemoEdmProvider.ET_SCHOOL_FQN.getFullQualifiedNameAsString());

           entity.setId(createId(entity, "school_name"));

           navigationTargetEntityCollection.getEntities().add(entity);

       

       }

    } elseif (sourceEntityFqn.equals(DemoEdmProvider.ET_SCHOOL_FQN.getFullQualifiedNameAsString())

        && relatedEntityFqn.equals(DemoEdmProvider.ET_STUDENT_FQN)) {

  1. navigationTargetEntityCollection.setId(createId(sourceEntity, "school_name", DemoEdmProvider.NAV_TO_STUDENTS));

      // relation Category->Products (result all products)

String school_name = (String) sourceEntity.getProperty("school_name").getValue();

  1. System.out.println("school name inside storage java"+school_name);

SchoolDto dto=new SchoolDto();

SchoolServiceDao dao=new SchoolServiceDao();

dto=dao.readSchoolData(school_name);

  1. System.out.println("hee");

for(StudentDto sdto:dto.getStudentsDto())

{

       entity = new Entity();

       System.out.println("stu id is"+sdto.getStu_id());

    entity.addProperty(new Property(null, "stu_id", ValueType.PRIMITIVE, sdto.getStu_id()));

    entity.addProperty(new Property(null, "stu_name", ValueType.PRIMITIVE, sdto.getStu_name()));

   

    entity.setType(DemoEdmProvider.ET_STUDENT_FQN.getFullQualifiedNameAsString());

    entity.setId(createId(entity, "stu_id"));

    navigationTargetEntityCollection.getEntities().add(entity);

}

 

    elseif (sourceEntityFqn.equals(DemoEdmProvider.ET_SCHOOL_FQN.getFullQualifiedNameAsString())

            && relatedEntityFqn.equals(DemoEdmProvider.ET_TEACHER_FQN)) {

       TeacherDto dto_tea=new TeacherDto();

    navigationTargetEntityCollection.setId(createId(sourceEntity, "school_name", DemoEdmProvider.NAV_TO_TEACHERS));

          // relation Category->Products (result all products)

    String school_name = (String) sourceEntity.getProperty("school_name").getValue();

    System.out.println("school name inside storage java"+school_name);

    SchoolDto dto1 = new SchoolDto();

    SchoolServiceDao dao=new SchoolServiceDao();

    dto1=dao.readSchoolData(school_name);

    System.out.println("school dto1 size"+dto1);

    for(TeacherDto tdto:dto1.getTeachersDto())

    {

       entity = new Entity();

       System.out.println("TEACHER id is"+tdto.getTeacher_id());

        entity.addProperty(new Property(null, "teacher_id", ValueType.PRIMITIVE, tdto.getTeacher_id()));

        entity.addProperty(new Property(null, "teacher_name", ValueType.PRIMITIVE, tdto.getTeacher_name()));

       

        entity.setType(DemoEdmProvider.ET_TEACHER_FQN.getFullQualifiedNameAsString());

        entity.setId(createId(entity, "teacher_id"));

        navigationTargetEntityCollection.getEntities().add(entity);

    }}

    if (navigationTargetEntityCollection.getEntities().isEmpty()) {

      returnnull;

    }

 

    returnnavigationTargetEntityCollection;

  }

  1. h. createId

/*This method is creates id(uri) by appending entityset name followed by navigation name

* */

public URI createId(Entity entity, String idPropertyName) {

    return createId(entity,idProperName,null);

  }

 

  private URI createId(Entity entity, String idPropertyName, String navigationName) {

    try {

      StringBuilder sb = new StringBuilder(getEntitySetName(entity)).append("(");

      final Property property = entity.getProperty(idPropertyName);

      sb.append(property.asPrimitive()).append(")");

      if(navigationName != null) {

        sb.append("/").append(navigationName);

      }

      returnnew URI(sb.toString());

    } catch (URISyntaxException e) {

      thrownew ODataRuntimeException("Unable to create (Atom) id for entity: " + entity, e);

    }

  }

 

  1. i. getEntitySetName

/*This method is called from createId method

*Returns entitySetName for the required entity

* */

private String getEntitySetName(Entity entity) {

    if(DemoEdmProvider.ET_SCHOOL_FQN.getFullQualifiedNameAsString().equals(entity.getType())) {

      return DemoEdmProvider.ES_SCHOOLS_NAME;

    } elseif(DemoEdmProvider.ET_STUDENT_FQN.getFullQualifiedNameAsString().equals(entity.getType())) {

      return DemoEdmProvider.ES_STUDENTS_NAME;

    }

    returnentity.getType();

  }

  1. j.createEntityData,createSschool,createStudent

/*This method is called from createEntity method in processor

*which inturn calls createSchool/createStudent based on entity set name

* */

public Entity createEntityData(EdmEntitySet edmEntitySet, Entity entityToCreate) {

 

EdmEntityType edmEntityType = edmEntitySet.getEntityType();

 

// actually, this is only required if we have more than one Entity Type

if (edmEntityType.getName().equals(DemoEdmProvider.ET_STUDENT_NAME)) {

return createStudent (edmEntityType,entityToCreate);

}

if (edmEntityType.getName().equals(DemoEdmProvider.ET_SCHOOL_NAME)) {

System.out.println("school name matched");

                    return createSchool(edmEntityType, entityToCreate);

}

returnnull;

         }

 

/*This method is called from createEntityData method

*This method gets school entity,creates new school_id and add to schools list

* */

  private Entity createSchool(EdmEntityType edmEntityType, Entity entity) {

       // TODO Auto-generated method stub

         intnewId = 1;

while (schoolIdExists(newId)) {

newId++;

}

 

Property idProperty = entity.getProperty("school_id");

if (idProperty != null) {

idProperty.setValue(ValueType.PRIMITIVE, Integer.valueOf(newId));

} else {

// as of OData v4 spec, the key property can be omitted from the POST request body

entity.getProperties().add(new Property(null, "school_id", ValueType.PRIMITIVE, newId));

}

entity.setId(createId(entity, "school_id"));

this.schoolList.add(entity);

 

returnentity;

 

}

 

/*This method is called from createEntityData method

*This method gets student entity,creates new student_id and add to students list

* */

 

private Entity createStudent(EdmEntityType edmEntityType, Entity entity) {

 

// the ID of the newly created product entity is generated automatically

intnewId = 1;

while (studentIdExists(newId)) {

newId++;

}

 

Property idProperty = entity.getProperty("stu_id");

if (idProperty != null) {

idProperty.setValue(ValueType.PRIMITIVE, Integer.valueOf(newId));

} else {

// as of OData v4 spec, the key property can be omitted from the POST request body

entity.getProperties().add(new Property(null, "stu_id", ValueType.PRIMITIVE, newId));

}

entity.setId(createId(entity, "stu_id"));

this.studentList.add(entity);

 

returnentity;

 

         }

 

  1. k. studentIdExists

/*This method is called from createStudent

*This method checks if the student id already exists in database

* */

privateboolean studentIdExists(intid) {

 

for (Entity entity : this.studentList) {

Integer existingID = (Integer) entity.getProperty("stu_id").getValue();

if (existingID.intValue() == id) {

returntrue;

}

}

 

returnfalse;

         }

 

 

 

 

/*This method is called from createSchool

*This method checks if the school id already exists in database

* */

privateboolean schoolIdExists(intid) {

 

  for (Entity entity : this.schoolList) {

                    Integer existingID = (Integer) entity.getProperty("school_id").getValue();

                    if (existingID.intValue() == id) {

                      returntrue;

                    }

}

 

returnfalse;

                }


Featured Content for SAP on Oracle Solaris

$
0
0
The  Oracle Solaris operating system supported on over 1000 x86 and SPARC platforms delivers the performance, stability, and security your users and customers demand. With thousands of applications available on Solaris, one OS can span your entire enterprise: the web tier, the data warehouse, and the most demanding technical compute applications. Moving to Solaris 11 is easy, whether you're upgrading from an older Solaris release or migrating from another OS.
Sun and SAP have been working together since 1993 to provide a scalable, reliable, secure, flexible, and open computing infrastructure for customers around the globe. Over time our joint efforts have paid off, helping Sun to consistently achieve many SAP Sales and Distribution standard application benchmark world records. In 2010, Sun Microsystems was acquired by Oracle Corporation, which is continuing the cooperation with SAP running Solaris.

 

Performance Improvements with PBO-Optimised SAP Kernels New!

The PBO-optimised SAP kernels for 742 and 745 on Solaris SPARC are now available on SAP Support Portal and downloadable as part of the disp+work package. They are valid for 742 as of patch level 27 and for 745 as of patch level 313. For more information, see SAP Note 2246204 Profile-Based Optimization on Oracle Solaris.

You can find the kernels on the SAP Support Portal here:

  • SAP Support Portal -> Support Packages and Patches - K" -> SAP KERNEL 64-BIT UNICODE" -> SAP KERNEL 7.45 64-BIT UNICODE -> Solaris on SPARC 64bit -> Database independent -> dw_27-80000780.sar
  • SAP Support Portal -> Support Packages and Patches - K" -> SAP KERNEL 64-BIT UNICODE" -> SAP KERNEL 7.42 64-BIT UNICODE -> Solaris on SPARC 64bit -> Database independent -> dw_314-20012206.sar

You can find information on whether PBO is used in "Output" of disp+work in the line "compiled on". This information is valid for 742 and 745 as well as for 721_EXT as of PL 618 and for 722_EXT as of PL 20.

 

New White Paper "Using the Oracle Solaris Compliance Tool for SAP Installation" New!

This paper provides instructions and best practices for a new Oracle Solaris 11 feature, the compliance report. Organizations such as banks, hospitals, and governments have specialized compliance requirements. Auditors, who are unfamiliar with an operating system, can struggle to match security controls with requirements. Therefore, tools that map security controls to requirements can reduce time and costs by assisting auditors. The simple-to-use Oracle Solaris tool provides users with not only reporting but also simple instructions on how to mitigate any compliance test failure, and also provides compliance report templates. You can download the white paper here.

 

New White Paper "Virtualization Monitoring in Oracle Solaris Zones"

Many SAP customers who run SAP on Solaris are using Zones as a flexible and efficient way to virtualize their IT infrastructure. Now we have a new white paper on how to manage and monitor Zones, written by an expert with an SAP background. You can download it here.

 

Solaris FAQ Published as SAP Note 2136441

To answer the most common questions about SAP on Oracle Solaris 11, we have created SAP Note 2136441 - SAP on Solaris 11: FAQ, which has links to relevant SAP Notes or documentation.
This is not an exhaustive list of all topics concerning SAP on Oracle Solaris. If you cannot find satisfactory answers to your questions here, you can search for other SAP Notes or contact your support representative.

 

Best Practices for Using ZFS Snapshot and Rollback with SAP Applications

There is a new white paper available for download describing Solaris best practices for using ZFS snapshot and rollback with SAP applications. This paper provides instructions and best practices on how to create and manage ZFS snapshot and rollback within the local zone on Oracle Solaris 10 and 11. ZFS snapshot and rollback is the best way to revert to a stable setting of deployments and applications after any system modification.

You can download the new white paper here.

 

SAPOSCOL on Oracle Solaris Enhanced with New Features

SAPOSCOL has been enhanced to better detect OVM virtualization and Oracle Solaris Zones (previously only Zones were detected). This enhancement is available with SAP HOST AGENT 7.20 SP188 for Solaris x86 and SPARC. For more information, see SAP Note 2031893 Collection of Virtualization Configuration in SAPOSCOL on Solaris.

 

Two New Oracle White Papers on Security Available

Awareness about the topic of security among business and IT teams did not start with the NSA scandal – Oracle Solaris already comes with built-in security features as standard. You just have to know how to use them. So to help customers make better use of these existing features, we have released two white papers:

 

Recently Featured Content

Here you can find entries that were previously shown here but have since been removed to make way for new content.

 

SAP on Oracle Solaris News Archive

Check our SAP on Oracle Solaris News Archive for older items.

SAP Mobile Documents - Product Overview

SAP S/4HANA Cookbook: What is SAP S/4HANA

$
0
0

SAP S/4HANA Cookbook

S4_logo.png

 

The SAP S/4HANA Cookbook covers the most important aspects of implementing SAP Business Suite 4 SAP HANA (SAP S/4HANA).

It consists of a small set of HTML landing pages that provide abstracts for specific topics, along with links to further deep-dive information.

 

The content on these pages follows an iterative approach and will be updated regularly.

Comments are disabled on this page to keep it lean.

Please use the SAP S/4HANA forum to raise questions about SAP S/4HANA.

For comments regarding the cookbook itself, please use the accompanying blog.

 

Table of Contents


1. What is SAP S/4HANA (this page)

  • Overview
  • What is available now ?
  • Further capabilities in context of SAP S/4HANA
  • Transition Options
  • Extensibility & Adaptation
  • Best Practices & Enablement by SAP


2. SAP Simple Finance, On-Premise Edition 1503: Implementation Information

  • This first on-premise version of SAP S/4HANA was released in March 2015. Since this version currently has the highest implementation figures, there is a separate page on it in the cookbook.


3. Transition to SAP S/4HANA: Know your options in detail

  • Planned for Q4/2015 (see 'What is SAP S/4HANA > Transition Options' for currently available overview)


Note: For access to SAP Notes and roadmap information, an 'S-user' is required (see here).


SAP S/4HANA: Overview

 

Context & SummaryRead on



Getting Started with SAP S/4HANA


SAP S/4HANA,the next generation business suite designed to help you run simple in the digital economy.

This new suite is built on our advanced in-memory platform, SAP HANA, and offers a personalized user experience with SAP Fiori.

Deployable in the cloud or on-premise, SAP S/4HANA is built to drive instant value across lines of business and industries with the ultimate in sophistication: simplicity.






 




 

 

Overview Presentation

 

 

Product Roadmap

> Product road maps > Cross Topics > SAP S/4HANA ('S-User' is required)

 

Frequently Asked Questions


Explore SAP S/4HANA along selected use cases


This series of blogs explains the possibilities of SAP S/4HANA along 'typical' use cases - tackled from both a business and a technical angle.

  • Next Generation Logistics (biz / tech)
  • Next Generation Inventory Management (biz / tech)
  • Marketing to a Segment of One (biz / tech)
  • Increase Financial Business Performance (biz / tech)
  • Engage Talent Across the Organization (biz / tech)

 

 

openSAP course on SAP S/4HANA use cases



SAP S/4HANA: What is available now ?

 

Context & SummaryRead on

 

SAP S/4HANA, On-Premise Edition 1511

The most recent and comprehensive version of the SAP S/4HANA on-premise edition


With SAP S/4HANA (SAP Business Suite 4 SAP HANA), on-premise edition, SAP is providing a new product and a next generation of business applications. With the delivery in November 2015 ('1511'), enterprises can benefit from innovative use cases in core financial and operational areas e.g. Materials Management & Operations.

 

Key innovations include:

  • Optimized working capital with new accounts payable and receivable cockpits
  • Decreased stock buffers with simplified data model in inventory management for real-time, high-volume processing
  • Increased visibility with real-time stock and material flow insight
  • Reduced manufacturing cycle time with streamlined material flow for internal requirements (MRP)
  • Augmented reactivity with real-time monitoring of production orders regarding flow and critical issues
  • Improved operational decisions with easy simulation of supply alternatives
  • Lower procurement costs with standard integration to the Ariba Business Network
  • Better customer service with new sales order fulfillment cockpit for instantly identifying bottlenecks and issues

 

 

 

 

Flipbook about SAP S/4HANA on-premise edition 1511

(New, Nov 20)

 

'Product Scope Guide' for mapping S/4HANA 1511 innovations to product map (presentation / blog)

(New, Nov 30)

 

SAP S/4HANA, on-premise edition 1511: Functional scope in details

(New, Nov 26)

 

help.sap.com for SAP S/4HANA on-premise edition 1511

(New, Nov 20)


SAP Simple Finance, On-Premise Edition 1503

The on-premise edition of SAP S/4HANA solely focusing on financial scenarios


'SAP Simple Finance, on-premise edition' marked the first step in the SAP S/4HANA on-premise roadmap for customers. It solely focuses on financial scenarios such as SAP Accounting, SAP Cash Management, SAP Integrated Business Planning for Finance and SAP Central Finance.

 

The initial version was released in March 2015 (1503) followed by support package stacks in May (1505), August (1508) and November (1511).

Since this version currently has the highest implementation figures, we offer a separate page with detailed implementation information around it. You will find a substantial list of assets on the 'Read on' page on the right.

 

‘SAP Simple Finance, on-premise edition 1503’ and 'SAP S/4HANA, on-premise edition 1511' both contain financials scenarios (SAP S/4HANA 1511 additionally contains Materials Management & Operations).

However, they are delivered as two different products. Customers who are interested into financial innovations can either start with SAP Simple Finance 1503 and transition to SAP S/4HANA 1511 at a later point in time, or they can start with SAP S/4HANA 1511 directly.

 

Note: The terms 'SAP S/4HANA Finance' and ‘SAP Simple Finance’ are often used interchangeably especially in introductory documents. However, in Help Portal, Software Download Center, etc. you will find distinctions between the two.





 

 

 

SAP Simple Finance, On-Premise Edition 1503: Implementation Information

Try it out for yourself:

There is a 30-day trial hosted on Amazon Web Services (AWS) that lets you create a dedicated on-premise instance of SAP Simple Finance 1503 and explore the trial system with administrator rights.

The SAP license is waived for this period, AWS hosting fees apply.

SAP Simple Finance 1503, 30-day trial


SAP S/4HANA, Cloud Edition 1511

The current cloud edition in detail


The current cloud edition of S/4HANA was released in November 2015 and comprises three different sub-editions:

  1. SAP S/4HANA, cloud marketing edition
  2. SAP S/4HANA, cloud project services edition
  3. SAP S/4HANA, cloud enterprise edition


1 & 2 focus on line-of-business scenarios (marketing, professional services), 3 offers a generic ERP scope with enterprise-wide scenarios. All cloud editions are hosted by SAP.

 

Note: You might also find references to older cloud edition releases (e.g. 1506) on SAP web pages since we’re keeping this information for some time as reference for existing customers.



 




Scope overview (PPT) for SAP S/4HANA, cloud edition 1511

New (Dec 14)

 


Scope details (documentation) for SAP S/4HANA, cloud edition 1511

New (Dec 14)



Try it out for yourself:

In the free trial of SAP S/4HANA, cloud edition, you can experience SAP S/4HANA in a guided tour at your own pace. It covers both line-of-business and generic enterprise scenarios.

 

Cloud Edition: SAP S/4HANA Free Trial




Further capabilities in context of SAP S/4HANA

 

Context & SummaryRead on

 

SAP PLM, SAP HR, SAP CRM

 

Finance and logistics are the first major areas that are addressed within SAP S/4HANA.
Other products areas of the SAP portfolio will move into SAP S/4HANA going forward or can be closely integrated with it.The linked blog gives an overview and further information on roadmap and strategy for the products mentioned in the headline at the current point in time (this might be changed in the future without prior notice).

 

 

 

 

SAP S/4HANA and solutions of the SAP Suite: strategy and roadmap

 

Hybrid scenarios and SaaS integration capabilities

 

Both the on-premise and cloud editions of SAP S/4HANA offer integration capabilities with other cloud-based SaaS products. This can be SAP solutions such as Ariba, SuccessFactors, Fieldglass, Concur, Hybris, SAP Cloud for Costumer, SAP Financial Services Network, or other third-party solutions depending on the detailed interfaces to those.

The read-on documents list the cloud integration capabilities by line-of-business (integration into SAP S/4HANA for Ariba, FSN, SuccessFactors (latter on-premise) are available, other products to follow) and provide some generic information on integration scenarios.

 

 

 

 

Cloud integration capabilities by line-of-business

(New, Nov 3)

 

Technical information on cloud integration (Blog / White Paper)


 

 


SAP S/4HANA: Transition Options


Context & SummaryRead on

 

Your transition options in a nutshell

 

SAP S/4HANA can be deployed on-premise or in the cloud, offering customers a choice what fits best for them.

 

Besides the decision what target infrastructure fits best, also the starting point of a project may vary.

There are basically three different implementation scenarios how a customer can move to SAP S/4HANA (you might even find combinations of those within the same customer):

  1. System Conversion : Existing SAP customers who want to move a complete SAP Business Suite system to SAP S/4HANA
  2. Landscape Transformation: Existing SAP customers who want to optimize their system landscape and move to SAP S/4HANA
  3. New Implementation: Customers who want to move from non-SAP legacy systems to SAP S/4HANA (new and existing SAP customers)

 

 

 

The linked documents explain the possible roads to SAP S/4HANA along typical customer scenarios, and give an overview how to technically deploy SAP S/4HANA and move data into the new infrastructure.

The blog focuses on the on-premise edition of SAP S/4HANA for existing customers (i.e. 1. in the list above).

The white paper takes a more comprehensive look on all three scenarios above for both on-premise and cloud deployments.





 


 

 

White Paper:
The Road to SAP S/4HANA

 

 

Blog:
The road to SAP S/4HANA on-premise edition for existing customers

 

 

System Conversion to SAP S/4HANA, on-premise edition 1511: Technical procedure and semantic adaption tasks
(New, Nov 20)

 

 

 

 


 


SAP S/4HANA: Extensibility & Custom Code Adaptation

 

Context & SummaryRead on

Extending SAP S/4HANA (side-by-side or in-app)

 

Extensibility covers a broad spectrum of topics that allows customers and partners to adapt standard business software to their business needs. It ranges from business configuration; layout adaptation of user interface (UI), forms, and reports; custom fields and logic; integration; and custom terminology and translation to customer-specific applications.

Extensibility in the SAP® S/4HANA suite can be categorized into two main parts: side-by-side extensibility through SAP HANA® Cloud Platform, and in-app extensibility through built-in capabilities.


 


Overview blog about extending SAP S/4HANA

 

 

 

White Paper: Extensibility for Customers and Partners


Custom Code Assessment & Adaptation


As an existing SAP customer, you may have developed ABAP custom code in your source system.

When converting your system to SAP S/4HANA, you need to assess and possibly adapt this custom code. This activity is mainly valid for on-premise transitions, since custom code can not be carried over that way into a cloud infrastructure.

Many of the steps for custom code assessment and adaptation are similar compared to moving to SAP HANA in general. Specific steps for SAP S/4HANA will be detailed out as SAP S/4HANA evolves.

 

 

 

Converting an existing SAP system to SAP S/4HANA: What you need to consider for your custom code(Update, Nov. 6)

 


 

Best Practices & Enablement by SAP

 

Context & SummaryRead on

SAP Activate

 

SAP Activate expedites SAP S/4HANA implementations throughout the customer lifecycle. It offers ready-to-run best practice content, guided configuration, and an implementation methodology.

 

SAP Best Practices packages provide ready-to-run digitized business and technical processes optimized for SAP S/4HANA. They allow you to leverage SAP’s expertise and experience for standard processes and spend more time focused on innovation.

Guided configuration is the content lifecycle management tool for configuring and testing your chosen SAP Best Practices. It is available to assist in your implementation and to support ongoing innovation.

SAP Activate methodology offers a consistent approach for any SAP S/4HANA deployment type – cloud, on-premise, hybrid, or mobile.

 

 

 

SAP Activate overview

(New, Nov 20)


Best Practices for SAP S/4HANA in a nutshell

(New, Nov 20)

 

SAP Education Offerings

 

openSAP is SAP’s learning platform for Enterprise MOOCs (Massive Open Online Courses). Register for free and get access to learning materials about SAP S/4HANA and other SAP software.

 

openSAP course: SAP S/4HANA in a Nutshell

 

openSAP course: SAP S/4HANA - Deep Dive

 

openSAP course: SAP S/4HANA use cases

 

 

SAP Learning Hub provides immediate, cloud-based access to a vast selection of SAP learning content – and to our interactive learning rooms (subscription fee applies).

 

 

SAP Learning Hub

Search for S/4HANA

 

Classroom trainings for SAP S/4HANA from SAP Education (training fee applies)

 

SAP S/4HANA Training & Certification Curriculum

 


 

 

Comments are disabled on this page. Please use the forum to raise questions, comments, or ideas.

Leading the Game Through Living up an Excellent Partnership

$
0
0
SAP On-Site Billing Solution – Empower Utilities Customers With Mobile Solutions
Integrating partners in the complete sales and service cycle is SAPs strategy for successfully taking business to another level. For more than two years SAP Brasil and PROLOGA GmbH have lived up to this new motto through a close and cooperative partnership – and the success proves them right.

The secret behind is not really one – while both partners focus on their respective strengths, they align them for the customer’s benefit.

In terms of SAP Brasil and PROLOGA this means that the SAP team contributes their closeness to the local customers on the Latin American Market, their in-depth knowledge of the SAP ISU solutions as well as excellent project management capabilities. PROLOGA, on the other hand, scores with its expert knowledge of the SAP technology, some 15 years in developing mobile solutions and their know-how of implementing product standards within the SAP environment. This combination finally culminates in product implementations that stand out not only due to lower costs for maintenance but particularly due to their versatile usability. Applying technical software plug-ins, the products can easily and cost-efficiently be adapted to new markets and customer requirements.

But a successful partnership is not necessarily a "pas de deux". Particularly when it comes to specific functions or processes, SAP and PROLOGA try to integrate reliable local service providers. So, it is for example possible to outsource the device management of the customer to a service provider with a broad service network. This enables SAP and PROLOGA to concentrate on their core competence such as tariff changes, contracting, meter reading and development of mobile apps.

Let us have a closer look at the On-site Billing solution that enables SAP customers to optimize their billing processes by creating meter reading bills directly on-site of the meter reading.

In October 2013 SAP Brasil and PROLOGA announced a second successful go-live of a mobile project in Brasil. The solution focuses on periodic and aperiodic meter readings. The customer, Neoenergia S.A. (the third-largest Brazilian-based utility holding company taking care of about 8.000.000 meters), benefited not only from a well-established cooperation of the service providers SAP Brasil and PROLOGA but also from a sound solution. The mobile application that comes with the solution is able to differentiate between an online and offline mode for meter readings. If the device hosting the mobile application is connected to the internet, the data changes will automatically be synchronized with SAP IS-U in the background while the meter reader is doing his work in the field. Next to planning the actual meter readings and supporting the mobile meter reading itself, the solution comes with a calculation and on-site printing function. The invoice can thus easily be presented to the customer right after the reading. The mobile invoicing function is a further enhancement to the already well-established meter reader planning. By configuring an additional view on the data, the integrated planning tool set supports utilities companies in an efficient roll-out of their smart meters. Moreover, sitting on SAP Netweaver Gateway the solution is ready for SAP´s multichannel strategy.

But what about performance? The readings of millions of meters create a lot of data, not to mention the planning or invoicing of such readings. Customers for sure do not only want to support their business processes with mobile software because it is fancy but expect clear advantages in their daily operations. For example, AES Eletropaulo, the first pilot in Brasil implementing the SAP On-Site Billing solution, challenged the teams with the requirement to create an invoice within 20 seconds. Only in this way it is possible to create roundabout 300,000 invoices per day after the complete roll-out in 2013 (approx. 1.200 meter reader).
The solution: the nightly settlement runs are performed during the day thereby freeing up system capacities for maintenance runs and batch processes. The system turns upside down today’s standard process of creating invoices in the backend. This is possible since the mobile solution integrates all relevant meter reading and invoicing checks of SAP IS-U. If a problem or error occurs during a meter reading tour, the respective workflows in SAP IS-U are automatically triggered. Moreover, tariff changes are automatically synchronized between SAP IS-U and the mobile devices. This reduces the effort of device administration immensely having a positive influence on the TCO. A clear advantage of the SAP products compared to other providers of such solutions.
On the plus side as well, the distribution of computing time.

The following illustration shows the process in an overview.

OSB_Picture.jpg
The current numbers of the two Brazilian customers speak for themselves.
AES:
  • Status: Roll out company-wide finished
  • 1300 mobile workers live
Neoenergia:
  • Go-live for 3 companies within 3 days – all controlled and monitored by one central system
  • Status: Roll out company-wide finished
  • 3500 mobile workers live

     

In the meantime, PROLOGA has worked on improving the solution according to the SAP road map and the customer needs:
  • Since November 2013 the solution is also available on SAP HANA.
  • Since 2014 a analytic toolset for monitoring, alerting and reporting the meter reading and onsite billing process is provided based on SAP HANA.
  • Since Q1/2015 the mobile application is supporting as well Android as the operating system of the mobile devices.
  • In Q2/2015Dynamic Periodic Control (DPC) as well as DEMAND billing was added to the product.


If you have any questions, please don’t hesitate to reach out to Stefan Engelhardt, IBU Utilities.


SAP Brasil and PROLOGA – a success story to be continued…

Performance: On demand mode for dropdown list boxes

$
0
0

When analyzing traces in Web UI you may see expensive calls of V Getter methods. Often the reason is an expensive logic

to determine the content of a dropdown list box. See screen shot below for a real world example. In this case the runtime to populate the listbox is 300 milliseconds. If the logic is expensive and for example involves an authority check, it could be even much worse.


pic1.png


Now the content of a dropdown list box really only needs to be known when the user clicks on it. Therefore the Web UI framework provides a functionality, which is not widely known, to read the dropdown values to this point so that not each roundtrip suffers from the increased runtime.


The functionality and how to implement it is described in below consulting note.


https://service.sap.com/sap/support/notes/0001964254

Basic explanation on PP strategies.

$
0
0

Explanation on most widely used strategies in sap pp.

Featured Content for SAP ICC

$
0
0

Certification opportunities for SAP S/4HANA, on-premise edition

For the new SAP S/4HANA products,  SAP Integration and Certification Center has announced the availability of integration scenarios for SAP S/4HANA, on-premise edition 1511. Please find more details on the blog published at http://scn.sap.com/docs/DOC-69711.

 

 

New certification scenario: Third party SDK Extension for SAP Business Objects Design Studio SDK (BI-DSTUDIO 1.0.).

Third party business intelligence software vendors can build an extension dashboards and BI applications using SAP Design Studio SDK and submit for certification. With the SAP Business Objects Design Studio, application designers will have the tools and flexibility to create visualizations, dashboards, and business intelligence applications, all supporting a highly interactive mobile or desktop experience. In addition to the standard palette of components in Design Studio, which are used to visualize data and enable user interaction, third party vendors can develop their SDK extension with the Design Studio SDK  and enhance their analysis applications with custom components. Know more.

 

 

SAP HANA Cloud Platform – Certifications opportunities for Partner Solution

SAP HANA Cloud Platform, the in-memory Platform-as-a-Service offering from SAP, enables customers and developers to build, extend, and run applications on SAP HANA in the cloud. With flexible subscription models and optional services for apps, database, and infrastructure, it provides instant access to the full power of SAP HANA.  SAP HANA Cloud Platform is ideal for the creation of innovative, consumer grade, enterprise or IoT applications, and for the extension of cloud and on premise applications. HCP offers features that enable the realtime, secure applications required to succeed in today’s always-on, mobile, social and data driven world. It includes support for integration, analytics, mobile, portals and collaboration. SAP ICC is inviting all partners, ISVs and start-ups to certify their SAP HCP apps as "SAP-Certified Built on SAP HANA Cloud Platform" to increase awareness and recognition for the apps. Read more


Hosting an SAP CodeJam Event

$
0
0

SAP CodeJam: A time to learn, network and have fun.

 

SAP CodeJam is a 5 to 6 hours hands-on coding and networking event where attendees share their knowledge and collaboratively develop with SAP technologies, platforms and tools in a fun and casual environment. The events are developer community focused and supported by SAP, exploring technologies available through theSAP Developer Center.

 

Event topics include the following, each event is based on a single topic around several of SAP technologies, critical is that each technology has a trial or developer edition available and that each attendee is able to continue working after they leave the event - this is also why the list does not encompass "all" technologies from SAP. Several primary technologies are of course focused on but if you have an additional request and we have a trial/developer edition available please reach out to us!


Within these technologies we have several focus areas for the CodeJam events:

 

 

Anyone can host an SAP CodeJam. To run an event in your city, please follow these guidelines.

 

6-8 Weeks Before the Event

Screen Shot 2015-03-17 at 18.45.27.png

  1. To request a CodeJam event in your city, submit an email request to the following email address: sapcodejam@sap.com. In the email, please include the name and email of the main contact person for the event, country and city in which the event will take place, estimated number of attendees, address of the location the event will be held, topic of the event and at least 3 possible dates for the event to take place. Be sure to include a bio of yourself and WHY you want to host a CodeJam event. The following criteria should be meet in order to have a request approved.

 

    • The event is low key and causal. This is not a workshop or training.
    • You should be able to provide a location for the event, internet access (this should be unrestricted access) as well as power.
    • 25 to 40 attendees, now we don't expect you to provide them all but as these events are local we do expect you to help find those attendees and provide at least a few yourselves.
    • No giveaways or gifts should be given out or included nor will SAP provide these items. It is acceptable to give pads of paper, pens, etc for use during the event.


    You’ll be contacted within 1 to 2 days of submitting your request by an SAP CodeJam team member who will help guide you through the rest of the process.

     

    5 Weeks Before the Event

    1. SAP will create a registration link for the event that will be provided to the host and then made public for sign ups.
    2. The host/requester should send an email to sapcodejam@sap.com with the following information:
      • Copies of quotes to process the funding request
      • Information about any possible security concerns for the location such as pre-registration or listing of hardware ID tags, etc.
    3. SAP will be to market and promote the event on a global level through SCN/Events space, SAP newsletters, etc. The host/requester will be responsible for promoting the event at a local level.
    4. SAP will secure access to the systems needed/required for the event.
    5. SAP will inform the host/requester of the name of the SAP expert once their availability has been secured.

     

    3-4 Weeks Before the Event

     

    1. SAP and the host/requester should continue to promote the event through your networks and social media channels (Google+, Twitter, Facebook, LinkedIn, blogs, etc.) – Don’t forget to include the registration link.

     

    1 Week Before the Event

     

    1. SAP will send out an email to the people registered for the event with the list of links to materials that will help them get prepared (e.g. tutorials, videos, requests for trial licenses, etc.).
    2. Two days before the event, SAP will send an event reminder notification to all attendees.

     

    During the Event

     

    1. The host/requester should ensure that all attendees are “checked in” either via the online application or via a check in list.
    2. Any attendee not previously registered should be added with the following information: Name, Email, Company Name - this information along with the check in information should be sent to sapcodejam@sap.com within 24hrs concluding the event.
    3. SAP expert and host/requester should ensure that all attendees have the information they need and aware of the location of the bathrooms, food, etc.
    4. SAP should take pictures of the attendees and the activities during the event for publication on various online channels.

     

    A Week After the Event

     

    1. Post a blog about the experience on SCN (include pictures if possible) and share the link to the blog on the Facebook SAP CodeJam page (www.facebook.com/sapcodejam).
    2. SAP should receive the full attendee list of the event.
    3. Host/requester should either provide the invoice for the food and drinks or bill SAP directly (where applicable)

    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:Schema

    Schemas 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
    schema-version0000

    A non-negative number indicating the version of the schema. This can be considered a sub/minor version of the service version. It should be incremented whenever additive changes are made in a subsequent shipment of the same service version, and it can be used by clients to detect whether the service meets their minimal data provisioning needs.

    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-node-external-key-for-A property holding the external key of a hierarchy node includes this attribute. The external key is a human-readable identification of a node. 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.
    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.
    hierarchy-node-descendant-count-for-A property holding the descendant count for a hierarchy node includes this attribute. The descendant count of a node is the number of its descendants in the hierarchy structure of the result considering only those nodes matching any specified $filter and $search. 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 descendant counts has an integer data type.
    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 a 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="Address_fc" />

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

              sap:field-control="Address_fc" />

    <Property Name="Address_fc" 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 fc, the attribute value is a path relative to the parent of the annotated property, e.g. sap:field-control="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.

    SAP on Microsoft Azure

    $
    0
    0

    With Microsoft Azure cloud, you can run SAP applications in an "Infrastructure as a Service" environment, which is part of a public cloud offering. Microsoft and SAP collaborate in support of specified SAP applications in a selected matrix of VM instance types, operating system and database versions.

     

    For more information on the prerequisites for the operation of your SAP applications in a public cloud (IaaS) environment, check Support of SAP Applications, Operating Systems, and Databases in Public Cloud (IaaS) Environments.

     

    Recent News

     

     

    Documents regarding Microsoft Azure

     

    SAP Notes Related to Microsoft Azure

    For a list of SAP Notes that are related to the use of SAP applications on Windows with Microsoft Azure, see SAP Notes for Windows in Public Cloud (IaaS) Environments.

     

    Supported SAP Applications

    With Microsoft Azure, SAP supports all applications that are listed in SAP Note 1928533.

    These are specified versions of:

    • Applications running on Application Server(s) ABAP and/or Java as part of SAP NetWeaver
    • SAP BusinessObjects Planning and Consolidation on NetWeaver (BPCNW)
    • SAP BusinessObjects Business Intelligence (SAP BI): see also SAP Note 2145537
    • TREX
    • SAP Content Server

     

    Supported VM Instance Types

    With Microsoft Azure, SAP supports its applications only on the VM types that are listed in SAP Note 1928533.

     

    Supported Guest Operating Systems by SAP

    The table below provides a short overview on supported guest operating systems. For detailed information on your SAP product, check the Product Availability Matrix and SAP Note 1928533.

                        SAP Application
    Guest OS
    Applications based on
    SAP NetWeaver AS, BPCNW, TREX
    SAP BI
    Windows Server 2003not supported
    Windows Server 2008not supported
    Windows Server 2008 R2supportedsupported (*1)
    Windows Server 2012supportedsupported (*1)
    Windows Server 2012 R2supportedsupported (*1)
    Red Hat Enterprise Linux (RHEL)not supported
    SUSE Linux Enterprise Server (SLES)not supported

    (*1) for versions and constraints, see SAP Note 2145537

     

    Supported Databases

    The table below provides a short overview on supported databases. For detailed information on your SAP product, check the Product Availability Matrix and SAP Note 1928533.

                        SAP Application
    Database
    Applications based on
    SAP NetWeaver AS, BPCNW, TREX
    SAP BI
    SAP HANAnot supported

    supported (*5)

    IBM DB2not supported
    MaxDB, liveCachesupported (*1)
    Microsoft SQL Serversupported (*2)
    Oracle Databasesupported (*3)
    SAP ASEsupported (*4)

    (*1) only for specified MaxDB and liveCache versions, see SAP Note 1928533

    (*2) released as of MS SQL Server 2008 R2 or higher, see SAP Note 1928533. Please consider the new Microsoft SQL Server Use Terms as outlined in SAP Note 2139358.

    (*3) only for specified Oracle Database and guest OS versions, see SAP Note 2039619

    (*4) released as of SAP ASE 16.0 PL02 or higher, see SAP Note 1928533

    (*5) released on all RDBMS that are listed in the Product Availability Matrix (PAM) for SAP BI

     

    Frequently Asked Questions

    For a list of frequently asked questions for the operation on SAP applications with Azure, check Frequently Asked Questions: Azure.

    SAP HANA Database Campus – Open House 2016 in Walldorf

    $
    0
    0

    The SAP HANA Database Campus invites students, professors, and faculty members interested in database research to join our third Open House at SAP's headquarters. Throughout your day, you will get an overview of database research at SAP, meet the architects of SAP HANA and learn more about academic collaborations. There are a couple of interesting presentations by developers and academic partners. Current students and PhD candidates present their work and research. For external students and faculty members it is a great chance to find interesting topics for internships and theses.


    The event takes place on June 2nd, 2016, during 09:3016:00 in Walldorf, Germany. Free lunch and snacks are provided for all attendees. The entire event is held in English.

     

    Register here

     

     

    Looking forward to seeing you in Walldorf,

    The SAP HANA Database Campus

    students-hana@sap.com

     

     

    Location:

    • SAP Headquarters,WDF03, Robert-Bosch-Str. 30, 69190, Walldorf, Germany
    • Room E4.02, Check-In Desk in the lobby of WDF03

     

    Agenda:

    • 09:00-09:30 Arriving
    • 09:30-10:00 Check-In
    • 10:00-10:15 Opening
    • 10:15-11:00 Keynote
      • Speaker and Topic will be announced
    • 11:00-12:00 Poster Session Part 1 & Career Booth
    • 12:00-12:45 Lunch
    • 12:45-13:00 Office Tour
    • 13:00-14:00 Session 1 – Academic
      • Prof. Anastasia Ailamaki (EPFL) Topic will be announced [30 min]
      • SAP HANA PhD Student Speaker and Topic will be announced [15 min]
      • SAP HANA PhD Student Speaker and Topic will be announced [15 min]
    • 14:00-15:00 Poster Session Part 2, Career Booth & Coffee Break
    • 15:00-15:45 Session 2 – SAP
      • SAP HANA Developer Speaker and Topic will be announced [20 min]
      • SAP HANA DeveloperSpeaker and Topic will be announced [20 min]
    • 15:45-16:00 Best Student/PhD-Student Poster & Open House Closing

     

     

    Archive of previous events


    By participating you agree to appear in photos and videos taken during the event and published on SCN and CareerLoft.

    Tips & Tricks using SAP BW Modeling Tools (BWMT) in Eclipse

    $
    0
    0

    Eclipse provides a great set of features out of the box which can  be used with the SAP BW Modeling Tools.

    This document summarizes the most important and most valuable tips you should be aware of and will be constantly updated!

    We are also looking for your ideas, feedback and tips. Please feel free to comment or to reach out to me.


    For more implementation details please also referto this document.

     

    • Efficient Tab Handling
      • Enlargeand minimize individual tabs by double clicking:

    1.png

      • Drag a tab to out of the eclipse window will create an open a pop up window for the specific object:

    2.png

    • Configure Problems View that only active and object related messages appear (View menu -> Show) :

    3.png

      • More you can add a timestamp to the problem view (View menu -> Configure Columns) :

    4.png

    • Link BW Search with BW Repository and it will highlight the search result in the tree:

    5.png

    • Use BW Search to find inactive objects (either Search -> Search or via the Search Icon):

    6.png

    • Input Help by pressing STRG+SPACE for Search fields (possible whenever the "lamp" is shown next to the field):

    7.png

    • Open the History View (to see and restore previous versions, e.g. to switch from active to delivered versions

    8.png

      • By double click on the table entry you can open e.g. the "active" version and compare the differences

    9.png

    • Save the view of a perspective, this will save how you configured and positioned the different panels

    10.png

    11.png

      • Resetting a perspecitve will restore the default layout of the perspective:

    12.png

    • Attach HANA System to link the BW and HANA repository. This will e.g. allow you to search and add HANA Views in a CompositeProvider

    13.png

    • Helpful shortcuts when working in eclipse  

     

    TaskShortcut
    Refresh active editor F5
    Save objectCTRL + S
    Undo last change  CTRL + Z
    Apply last change again CTRL + Y
    Create new object CTRL + N
    Search for BW object CTRL + H
    Open BW object      CTRL + Shift + D
    Close Editor CTRL + W
    Check selected BW objectCTRL + F2
    Switch between open editors           ALT + Left-Arrow
    Viewing all 2380 articles
    Browse latest View live


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