Quantcast
Channel: SCN : Blog List - SAP Gateway
Viewing all 245 articles
Browse latest View live

Steps to access the gateway service from one system to another system.

$
0
0

Business Scenario

  • The odata service is created in one system (ex: development system), and this service has to be accessed in other system (EX: sap gateway system)  .
  • When the development system and the gateway service system are different this process is helpful.

 

Step-by-Step Procedure


Configuration on SAP NetWeaver Gateway System

This activity needs to be done in the system where software component IW_FND is installed

This Setting has to be done in the system where you have to access the odata service (in my case gateway system)


1. Manage RFC Destination

Create RFC Connection to the SAP Business Suite backend system.

  • In transactionSPROopen the SAP Reference IMG and navigate to:SAP NetWeaver->Gateway->OData Channel->Configuration ->Connection Settings->SAP NetWeaver Gateway to SAP System->Manage RFC Destinations->and click the Activity icon.

 

2. Manage SAP System Aliases

  • In transactionSPROopen the SAP Reference IMG and navigate to:SAP NetWeaver->Gateway->OData Channel->Configuration ->Connection Settings ->SAP NetWeaver Gateway to SAP System->Manage SAP System Aliases->and click the Activity icon.
  • ChooseNew Entries.
  • Enter the following details for the system alias:

Field

Description

SAP System Alias

Name of the system alias, for exampledev_001

Description

Descriptive text for the system alias.

Local GW

Leave unchecked if the Backend system is not on the same system as the SAP NetWeaver Gateway system.

For Local App

Check if IW_BEP add-on is deployed on the SAP NetWeaver Gateway hub system.

RFC Destination

Specify the RFC destination that you created in the step above.

WS Provider

Leave it blank.

Software Version

ChooseDefault.

  • Save your settings.

system alias.PNG


Creating the service

1. Go to transaction /iwfnd/maint_service

2. Click on add service

3. Enter the system alias, Technical service name and version of a service.

· System alias which was created in spro.

· Technical service name – Enter the gateway service name which is present in other system

( ZLEAVELOGIN_SRV).

· Specify the version (in my case it is 1).

                         

After this you can use the service


SAP Gateway and API Management Footprints at TechEd Berlin and Outlook for the Final Day

$
0
0

If you haven’t seen the TechEd Berlin keynote from Bernd Leukert, definitely check out the replay. 42 minutes into the keynote Bjoern Goerke – EVP of Technology and Innovation demonstrated an insurance claim app creation with exposing OData service from ERP (via Gateway) with our brand new SAP API Management solution on the fly. That was a really impressive app up and running on various mobile devices in just few minutes!

 

Our code review sessionCR704 “SAP Gateway - Tune your OData Services”took placetoday in this small white tent which was called "Code Review Arena". Youfelt a little bit like in a real arena. People really enjoy being inside of this mini arena . The session was conducted by SAP Gateway runtime architect Olaf Tennie and Product Manager Andre Fischer. They showed amongst others the latest improvements inSAP Gateway SP09. You can see how packed and cozy the arena was during this session.

 

codeReviewWP_20141112_018.jpg

CodeReviewWP_20141112_020.jpg

 

Our customer Cornelia Wanders fromAOK Systems presented today “Mobile B2E/B2C Apps Using SAP Mobile Platform and SAP NetWeaver Gateway” which was well received. Her presentation covered the implementation of mobile B2E and B2C applications. Both scenarios cover the OData service development in SAP NetWeaver Gateway as well as the development of mobile applications using the SAP Mobile Platform. She showed cool mobile app for young people to receive benefits from their health insurance based on SAP Gateway and SMP which will be available shortly.

AOKonStage.png

 

 

 

Our famous book“OData and SAP NetWeaver Gateway” is prominently featured and sold on the front row at TechEd Berlin as well.

 

GWBook_WP_20141112_009.jpg

 

Another jump packed session was our 4 hours Hands-on Session INT260 Develop an E2E Integration Scenario with SAP Gateway, SAP HANA, and SAPUI5. In this hands-on session, you could develop an SAP Fiori-style app in an end-to-end scenario. Thomas Meigen (Chief Product Owner), Olaf Tennie and Andre Fischer walked through the development and extension of an SAP Gateway OData service consisting of SAP HANA-based views and other data sources. Participates could generate and extend an SAP Fiori-styled app with SAPUI5 and the new SAP WEB IDE.
AndreHandsOnSession.png
INT260_handsOn_WP_20141112_003.jpg

We have another exciting day ahead of us. It will be the final opportunity to visit our Demo Pod in the Info Zone (P2.5 / IZ5) Integration Solutions and API Management.

 

Stay tuned for the Live Studio on Thu 11 AM German local time about “Digital Acceleration for 100+ Year Old Companies using API-centric architectures”. Our product manager Carsten Boennen will interview Joe Black - SAP Strategic Partner Lead at Apigee.Here is the replay link.

 

Abstract:
The digital economy is often viewed as the habitat of young, digital native companies. How can established companies compete? One hundred years ago, factory electrification and mass production advanced—and challenged—existing businesses. The survivors of that era now find new challenges and opportunities in today’s digital economy.
Join Apigee and SAP in this SAP Studio chat to learn how Fortune 1000 enterprises are recognizing their digital potential and overcoming challenges to increase business agility and innovation with API-centric architectures.

More about the program and detailed information for the final day is in this blogsneak peek. Additional TechEd Berlin pictures are here.

For further information please see our social media channels too:

 

SAP Gateway               SAP.com|SCN|LinkedIn|Youtube|Twitter|Facebook

SAP API ManagementSAP.com|SCN|LinkedIn|Youtube|Twitter|Facebook

Expand Parent Child Entities in a Single Expansion - GET_EXPANDED_ENTITYSET

$
0
0

Working on first gateway project and being asked to expand the parent child entities linked with Navigation Property with a single expansion or RFC call requires quite a bit of self learning. However, when explored the internet, I could not find blogs/links which explained in detail how to use Expansion Method of the Gateway to expand both Parent and Child Entity in a single RFC call, rather than making call first to parent entity and then to the child using $EXPAND parameter in the Odata Service Link.

 

This scenario is more appropriate for Gateway Hub scenario where in GW(GW_CORE, I_BEP and IW_FND) and ECC are separate systems. An RFC call is made from GW to ECC each time data is requested from UI. Therefore, if the user needs to fetch the Parent Child data using $EXPAND, the gateway framework will first call the entity set for the Parent(SOHeaderSet) and then the entity set for Children(SOItemSet). This results in 2 RFC call to fetch the required data.

 

In this blog, we will learn how we can reduce 2 RFC calls to a single RFC call and expand both the Parent and Child Entities in a single Odata Service Call.

 

In order to implement this, we will re define 'GET_EXPANDED_ENTITYSET' Method of the Data Provider Class.

 

In this example, we will use 2 entities Sales Order Header(SOHeader) and Sales Order Item(SOItem). Both are linked to each other with a navigation property SOHeaderToItem.

Entities.PNG

SOHeader.PNG

SOItem.PNG

Association.PNG

Navigation.PNG

 

Redefine GET_EXPANDED_ENTITYSET as explained in the attached snapshot.

GET_EXPANDED_ENTITYSET.PNG

 

The catch here is that, we have to tell the GW framework that we have expanded both the Header and Item entities in a single entity set call and no need to call the child entity set to fetch the the Sales Order Items. We can do this using parameter ET_EXPANDED_TECH_CLAUSES of GET_EXPANDED_ENTITYSET. Append the Navigation Property Name(SOHEADERTOITEM) in this exporting parameter, which will tell the gate way framework that the child entity has already been expanded and there is no need to call the child entity set.

 

An important point to not here is that the structure of the output entity set should have a field with Name same as Navigation Property Name(SOHEADERTOITEM). This field has to be a Table Type to support Header and Item relationship structure. Check structure below.

Structure.PNG

 

 

When you will call the Odata Service from the Client with $EXPAND, only the Header Entity Set will be called and no call is made to the Item Entity Set.

https://<Host Server:Port>/sap/opu/odata/sap/ZEXPAND_PARENT_CHILD_SRV/SOHeaderSet?$expand=SOHeaderToItem

 

 

In normal expansion scenario with $EXPAND, the gateway framework would first call SOHeaderSet and then the corresponding SOItemSet.

 

Thanks!!!!

Multi-Level Expansion with GET_EXPANDED_ENTITYSET

$
0
0

This blog is based on the idea of expanding Entities linked with Multi-Level Navigation Properties(A->B->C->D) in a single Gate Way  framework call.

 

To get an idea of expanding multiple entities linked with Navigation property in a single ENTITYSET call with $EXPAND, refer to my recent blog at Expand Parent Child Entities in a Single Expansion - GET_EXPANDED_ENTITYSET.

 

Consider below entity relation ship ENTITY A -> ENTITY B-> ENTITY C linked with Navigation properties Entity A to Entity B = AB and Entity B to Entity C = BC. With this blog I am trying to fetch data for all the entities A, B and C in a single call of the gateway framework using below URI call where A is linked to B and B is linked to C via a navigation property. This is like an INNERJOIN on the interrelated Entities linked via navigation properties:

/sap/opu/odata/sap/zmultilevel_exp_srv/EntitySetA?$expand=AB/BC,

this would return data for entity A, B and C in a single Gateway Framework Call which would otherwise be achieved with below 2 Odata Calls:


/sap/opu/odata/sap/zmultilevel_exp_srv/EntitySetA?$expand=AB

/sap/opu/odata/sap/zmultilevel_exp_srv/EntitySetB?$expand=BC


In above entity expansion, you could always use filters based on the entities A and B, However, the way you access the various properties of entities A and B is slightly different.


Say you want to filter data result on the basis of property X of entity A, the above link would be represented as /sap/opu/odata/sap/zmultilevel_exp_srv/EntitySetA?$expand=AB/BC&$filter=X eq <Filter Value>.


However, if you want to filter result set based on property Y of entity B, the link would be represented as

/sap/opu/odata/sap/zmultilevel_exp_srv/EntitySetA?$expand=AB/BC&$filter=AB/Y eq <Filter Value>.


We will consider above situations with the help of Sales Order Data linked with entity relations SalesOrder Header -> Sales Order Items ->Sales Order Schedule Lines


Consider below Entity Structures and Navigation Properties:

Entities.PNG

SOHeader.PNG

SOItem.PNG

SO Item Schedule Lines.PNG

 

   Associations.PNG

Navigation.PNG

Item to Schedule Lines.PNG

 

Redefine GET_EXPANDED_ENTITYSET as explained in the attached snapshot.

Code1.PNG

 

Code2.PNG

The catch here is that, we have to tell the GW framework that we have expanded the Header, Item and Schedule Line entities in a single entity set call and no need to call the child entity set to fetch the the Sales Order Items and Sales Order Schedule Lines. We can do this using parameter ET_EXPANDED_TECH_CLAUSES of GET_EXPANDED_ENTITYSET. Append both the Navigation Property Name(SOHEADERTOITEM/SOITEMTOSCHDLN) in this exporting parameter, which will tell the gate way framework that the child entity has already been expanded and there is no need to call the child entity sets.

 

An important point to not here is that the structure of the output entity set should have fields with Name same as Navigation Property Name(SOHEADERTOITEM and SOITEMTOSCHDLN).  Check structure below.

SOHeaderItemsScheduleLines.PNG

 

Access Scheduel lines data along with Header and Line Items:
https://vmw4462.wdf.sap.corp:44362/sap/opu/odata/sap/ZMULTILEVEL_EXPAND_SRV/SOHeaderSet?$expand=SOHeaderToItem/SOItemToS…

 

With filter on base entity(SOHeader)

https://vmw4462.wdf.sap.corp:44362/sap/opu/odata/sap/ZMULTILEVEL_EXPAND_SRV/SOHeaderSet?$expand=SOHeaderToItem/SOItemToSchdLn&$filter=Vbeln%20eq%20%271%27&$format=json

 

FilterOnHeader_Property_Vbeln.PNG

With filter on Items Entity (SOItem): The catch here is that, you have to fetch the filter from the filter string from IO_TECH_REQUEST_CONTEXT->MO_FILTER->MV_FILTER_STRING.


https://vmw4462.wdf.sap.corp:44362/sap/opu/odata/sap/ZMULTILEVEL_EXPAND_SRV/SOHeaderSet?$expand=SOHeaderToItem/SOItemToS…

SOHeaderToItem_Filter_Vbeln.PNG

 

Kindly share your inputs and thoughts on this.

Are the SAP Gateway Addons non modifiable?

$
0
0

Last week a customer that planned to start with SAP Fiori asked for an SAP official statement whether the SAP Gateway Addons are non modifiable.

 

Strangely enough ...

 

I wasn't able to find such an official statement.

 

 

We therefore changed our central SAP Note 1569624  - Installation/Delta Upgrade of SAP NW Gateway 2.0 accordingly which now finally states:

"All the Gateway 2.0 parts are non-modifying components ( GW_CORE 200,IW_CNT 200 IW_CBS 200 IW_FND 250 IW_BEP 200 and IW_SCS 200 )and can also be installed on a Netweaver 700 EHP3 systems or Netweaver 730 EHP1 system based on the import conditions."

 

 

Please note that with SAP NetWeaver 7.40 the SAP Gateway functionalities GW_CORE, IW_FND and IW_BEP are shipped with the software component SAP_GWFND which is part of SAP Basis of SAP NetWeaver 7.40. As a result no separate statement like the one mentioned above is needed anymore for 7.40 based systems.

 

So if your customer are also asking (this very valid) question you can refer them to the note that I have mentioned above.

 

Best Regards,
Andre

 

Convert XSTRING of CSV to Internal Table for mass actions

$
0
0

Hi All,

 

To perform mass operations, one of the most popular method is to upload an excel or csv file. Although we have GUI_UPLOAD function module to upload a file and get the data in the internal table but this is limited to SAP GUI only. In cases where the file is getting uploaded from UI5 front end, we get xstring file in the back end. We need to parse this file and extract data from it. There is some limitations in terms of converting the data of excel file(xstring) into internal table (explored on SCN and found out that we cannot easily convert the xstring of .xls into internal table while its easy in case of .csv) so we are restricted to use CSV files.

 

The scope of this blog does not contain the process of file uploading from UI5 front end and receiving it in the Gateway service. This part you can easily achieve using by these references:

1) Gateway service part: How To Upload and Download Files Using SAP NW Gateway SP06

2) File Uploading part: Uploading files to SAP using HTML5 /AJAX/Gateway media links with real-time progress bar

 

I am gonna cover only the conversion part of that csv to any internal table using dynamic internal table concept. Once you get the data in your internal table you can use it in any way.

 

Once you get the xstring of csv file in back-end, you can use the below FM to extract data. The input and output parameters are as below:

Import.PNG

table.PNG

In input parameters, you need to pass remove_header flag as 'X' if the first line of your csv file contains header field names. In tables, you can pass any internal table for getting the data. I am using dynamic internal table for this.

The code is:

FUNCTION zui5_csv_to_itab.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(FILE_CONTENT) TYPE  XSTRINGVAL OPTIONAL
*"     VALUE(REMOVE_HEADER) TYPE  CHAR1 DEFAULT 'X'
*"  TABLES
*"      DATA_TABLE OPTIONAL
*"----------------------------------------------------------------------   DATA struct_descr TYPE REF TO cl_abap_structdescr.   FIELD-SYMBOLS:     <comp_descr> LIKE LINE OF cl_abap_structdescr=>components,     <comp> TYPE any.   DATA: ls_string TYPE string,          it_line TYPE TABLE OF string,          wa_line TYPE string,          it_line2 TYPE TABLE OF string,          wa_line2 TYPE string,          l_regex TYPE string.   DATA : l_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.   CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'     EXPORTING
*     FROM_CODEPAGE = '8500'       in_xstring    = file_content
*     OUT_LEN       =     IMPORTING       out_string    = ls_string.   SPLIT ls_string AT cl_abap_char_utilities=>cr_lf INTO TABLE it_line.   TRY.       struct_descr ?= cl_abap_typedescr=>describe_by_data( data_table ).     CATCH cx_sy_move_cast_error.       RETURN.   ENDTRY.   LOOP AT it_line INTO wa_line.     IF sy-index = 1 AND remove_header = 'X'.     ELSE.       REPLACE ALL OCCURRENCES OF       REGEX ',(?=(?:[^"]*$)|(?:[^"]*"[^"]*"[^"]*)*$)'       IN wa_line WITH l_tab.       REPLACE FIRST OCCURRENCE OF         REGEX '^"'         IN wa_line WITH ' '.       CONCATENATE '"' l_tab '"|"' l_tab '|' l_tab '"' INTO l_regex.       REPLACE ALL OCCURRENCES OF         REGEX l_regex                         "    '"l_tab"|"l_tab|l_tab"'         IN wa_line WITH l_tab.       REPLACE ALL OCCURRENCES OF '""' IN wa_line         WITH '"'.    "Added during testing       REPLACE ALL OCCURRENCES OF REGEX '"$' IN wa_line         WITH ' '.       SPLIT wa_line AT l_tab INTO TABLE it_line2.       LOOP AT struct_descr->components ASSIGNING <comp_descr>.         ASSIGN COMPONENT <comp_descr>-name                OF STRUCTURE data_table TO <comp>.         READ TABLE it_line2 INTO <comp> INDEX sy-tabix.       ENDLOOP.       APPEND data_table TO data_table.       REFRESH it_line2.     ENDIF.   ENDLOOP.
ENDFUNCTION.

Reference: ABAP RegEx met CSV and said 'I'll keep a Tab on you' | &amp;#169; Passionate about SAP - A Blog

Show your cards, please!

$
0
0

                                                                      sheldoncards.jpg

Let me tell a short story.


Imagine a SAP customer having a webapplication using SAPUI5. The architecture is a typical transactional Fiori-like application.

Meaning: SAPUI5, connecting to SAP Gateway via OData. The services are implemented in the ECC backend via ABAP OO.

In our case leveraging the SAP PM/CS module. This is working perfectly fine. Like this:

                                                                            Drawing standard as-is2.png

 

HANA

 

Due to new requirements, HANA as platform came into scope as well. Searches do have to stay fast even if the amount of data will grow on our ECC system. Another reason was to be able to search in ‘legacy’ data. ECC Tables will now be replicated to HANA enterprise. Also the legacy (read-only) data will be loaded into HANA. Search services are implemented here via OData as well, in this case via xsodata. So a 2nd OData source come into play.

Pictured it in mind? Great! Let’s draw it.

So our new picture would ideally be like this.

                                  Drawing incl HANA.png

                                                     

SAP Gateway as our central access point for services. Meaning we can still to tracing/ logging as we are used to have with our initial architecture with the SAP Gateway to ECC setup. See response times, trace activity for a limited amount of time. And have a single and central access point for all our services. Ideally as well, since we have to deal in SAPUI5 with the 'same origin policy' issue. Also for other applications later on which have to benefit from these services, can benefit from a single access point.


As Sheldon Cooper, would say:


                                          bazinga2.png

 

All set... Or not?


External OData source


When we want to use SAP Gateway as our route to HANA, means we have to call an external OData source (HANA) via SAP Gateway.


Let me explain; Calling external OData services (in our case HANA) via SAP Gateway can be done, it is called OSCI. It is explained here. So we did. We run the wizard, and ….. it failed. “Metadata cannot be loaded”. It turns out a ‘http://’ deep down in the class is missing. No worries, when adding this via the debugger, luckily we could continue. Generation was successful. The metadata could now be loaded. All fine? Actually no, when testing our ‘new’ service via the gateway client, it failed. It had a different interpretation of 'nullable'. Meaning all records with empty values failed, The default of Nullable is differently interpreted in Gateway. Nothing to worry as well, I guess we can fix that by making our definitions more explicit on the HANA side.


What was unexpected is, a complete new service is generated in Gateway. A completely new set of classes. Doing all the logic as you would have when generating a Gateway service using an ECC backend via an RFC. Meaning it parses the incoming request and check for validity against the metadata. Especially responses are completely parsed. Not only it takes time (we run 60.000 records through it, and it took >1,5 minute before a parse error came up). But parsing and validating the response would anyway be done in the source system, in our case HANA.


Sheldon is over-reacting when hearing this news.

                                                     sheldon ohno.png

Of course there are reasons for this, and there are great teams working at SAP, who must have a very good reason to implement it like this. In our scenario it is a bit unexpected, and behavior which is actually not required.


Our requirement would be fulfilled with having a proxy behavior. Proxying requests to HANA. With Gateway as proxy, but still enabling logging, tracing and response time measuring. A pure representation of a proxy is shown below.

 

                                                    proxy.png

 

What does Fiori do?

 

How does standard Fiori do this, when calling HANA OData services from a Fiori application. Is Gateway being leveraged here as a central point of access? Is it using OSCI?

This picture is directly from SAP documentation. The "Setup of SAP Fiori System Landscape with SAP HANA XS". It describes the architecture for an analytical application. A SAPUI5 application consuming OData services from HANA.



ppt_img.gif



What do we see? The webdispatcher. The good‘ol webdispatcher. This does mean it will do simple proxying, this also means it will not be consuming time in reading and validating and parsing the response. Great? Yes, sure it is acting a proxy. But remember, we want to have full tracing, and logging options. To be able to see if a request has failed. To turn on a trace for 2 hours and watch what happens (for a particular user). To quickly spot the services which have high response times, and possibly cause time-outs.


Solutions


We could implement our solution with bypassing SAP Gateway for HANA OData services. Since we are serving the SAPUI5 from a Java stack (Gateway is not our frontend server). We implemented a proxy here by using a Java proxyservlet, to route requests to HANA. However we do not have the routing and logging, handy tracing options and response times measuring in (one) place. It can be build and implemented here, sure, but it’s not standard.


It could be, that our future architecture will be a even more Fiori-like landscape. Gateway, ECC, HANA. The Gateway server being the frontend server, this stack running the Launchpad and offering the SAPUI5 applications. Meaning it might grow towards an architecture without the Java stack, this means we cannot do the proxying anymore here.


Roadmap

            roadmap.jpg


What is SAP’s roadmap here? In scenario's with more OData sources being consumed in one or in more applications.

Is the webdispatcher the final solution, as in the Fiori analytical landscape? Monitoring and managing is less advanced here as the customer would prefer.

Is there another way to route and monitor and manage these different API’s via one solution. Will SAP Gateway get proxy functionality?

Or is this why SAP started a partnership with ApiGee?

 

Although it seems to be more focused on cloud based solutions, will this also be available for on premise usages as API management for all (SAP) OData sources?

 

Please SAP, show your cards!

 

               cards.jpg

 

Thanks for making it onto the end of this blog. Please share your comments!


Book Analogy to understand Central Hub and Embedded Scenario

$
0
0

Hello Folks,

 

Target Audience: Beginners in SAP Gateway.

 

Introduction:

Here I am going to explain the deployment scenario of SAP gateway with relating it to the books.

There are 4 objects here: customer, publisher, printer and papers(or raw materials). Suppose the customer wants 50 copies of some novel 'Novel ABC'. Here is the process:

  • The customer requests this to Publisher of the novel.
  • The publisher checks who is the printer for this novel and asks the printer to print 50 copies.
  • The printer checks for the raw material and if the raw material is not available, it asks for the raw material.
  • As soon as the printer receives the papers(or raw materials), it prints the copies and send it to the publisher.
  • The publisher receives the copies and send the requested copies to the customer.

Book analogy.PNG

Relate it with Gateway scenarios:

Lets relate the above scenario with gateway.

 

Books AnalogyCustomerPublisherPrinterPapers (Raw Material)
Gateway ScenariosBrowserFront End ComponentsBack-End ComponentsData (ECC)

 

 

The process is:

  • The browser requests it to the front end system. (Where service is registered)
  • The front end checks that the requested service is registered against which system. (checks the back-end system which registered the service and where all the classes are presented)
  • The back-end receives the request, checks and asks for the data. (control comes to the classes of the service and asks for the data)
  • When the back-end gets the data, it sends the data back to the front-end system.
  • The front end system sends the response to the browser.

gateway.PNG

Thus

  • Creating the service = Printing the book
  • Registering the service  = Publishing the book
  • Getting the data or calling the FM =  getting the papers

 

For deployment options, we can check the SAP help page Embedded Versus Hub Deployment - SAP NetWeaver Gateway Master Guide - SAP Library

 

Scenario A: Central Hub Deployment — Development in SAP Business Suite Backend System

                                                                           =

                              When Printing Press has the papers or raw materials

This approach suggests that the printing press has papers i.e. the backend system has the classes/methods of created service as well as data.

This means that Publishing house does not have the capability of printing the book i.e. the gateway service is developed at the backend system and only registered at front end hub system.

So we will have front end components(GW_CORE, IW_FND) at the Hub system and backend system will have IW_BEP copmonents.

book A.PNG

ch a.PNG

 

Scenario B: Central Hub Deployment — Development in SAP NetWeaver Gateway System

                                                                   =

                              When Publishing House also prints the book

This approach suggests that the Publishing House also has Printing Press but not the papers i.e. the front end system has the classes/methods of created service but not the data.

This means that Publishing house does have the capability of printing the book i.e. the gateway service is developed at the front end system and only data is fetched from ECC system.

So we will have front end components as well as backend components (GW_CORE, IW_FND & IW_BEP) at the Hub system.

 

book B.PNG

ch B.PNG

 

Scenario C: Embedded Deployment — Development in SAP Business Suite Backend System

                                                                    =

                    When publishing house prints the book as well as has the papers

This approach suggests that the Publishing House, Printing Press as well as papers or raw materials are at one place i.e. everything is in one system.

This means that Publishing house does have the capability of printing the book and also have the papers i.e. the gateway service is developed at the backend system, registered at the same system and data is also fetched from same system.

So we will have front end components as well as backend components (GW_CORE, IW_FND & IW_BEP) at the backend system.

book embeded.PNGembedded.PNG

 

Hope this helps in understanding the concept of Central Hub and Embedded deployment scenarios.


Test POST request to Gateway with SoapUI

$
0
0

This blog describes how to make POST calls containing CSRF tokens to Gateway using SoapUI.

 

The testcase contains 3 steps, and a property named CSRF,

Setup.png

 

Check field "Maintain HTTP session" under testcase options, this will make sure that the cookies set in the GET request are reused in the POST request,

TestCase Options.png

 

 

1: Get CSRF

This will fetch the token via a GET request, add header "X-CSRF-Token" and value "Fetch"

Get CSRF.png

 

 

2: Groovy Script

The script will take the token from the GET request and store it in the testcase "CSRF" property

Groovy.png

 

''

def headerValue = testRunner.testCase.getTestStepByName("Get CSRF").httpRequest.response.responseHeaders["x-csrf-token"];

 

log.info( headerValue[0] );

 

testRunner.testCase.setPropertyValue( "CSRF", headerValue[0] );

''

 

 

3: POST

The actual request using the token, add header "X-CSRF-Token" with value "${#TestCase#CSRF}", set content type according to input data

POST.png

SAP Gateway and API Management Coming to TechEd && D-Code Bangalore

$
0
0

Since SAP and Apigee entered thepartnership agreementand released the new product offering called “SAP API management” Sep. 2014 there has been tremendous customer interest on this solution. 

 

Want to see this new solution in action or chat with our experts on Gateway and API management face to face? If you are attending TechEd && d-code in Bangalore (March 11- 13 in Bangalore International Exhibition Centre) you will have the perfect opportunity to get the latest updates on SAP API management and SAP Gateway.


               SAP API management Technical insides

 

One of the easiest ways to find the experts besides at the sessions is stopping by at our demo Pod in the info zone. Besides the SAP API management topic our experts onsite will offer a series of sessions about SAP Gateway as well which is a technology that enables a simple way to connect devices, environments and platforms to SAP software based on OData standard. SAP Gateway is one of the important API sources that work seamlessly with the API management solution. Below is an overview of how SAP API management integrates with the SAP product family including SAP Gateway.

 

APIMgtArchitecture.png

 

Here is what our team offers at TechEd Vegas:
1. Lectures and hands-on sessions on SAP API management and Gateway:


Session ID


Session Type


Dur


Title


Track


Speakers


Session Date/Time

INT204

Lecture

1 h

Cutting-Edge SAP API management leveraging REST

Orchestration, and Intelligent  Processes

Balakrishna

Gottipati

Fri/

15:15 - 16:15 pm

INT802

Product Roadmap

1 h

Road map Q&A: SAP Gateway - On Premise and in the cloud

Integration on SAP HANA Cloud

Balakrishna

Gottipati

Wed/

14:00 - 15:00 pm

Thu/

12:00 -

1:00 pm

INT263

Hands-on

2 h

Consuming SAP Data in Google Apps by leveraging SAP
  Gateway

Orchestration, and Intelligent  Processes

Chandan V.A,

Balakrishna

Gottipati,

Vinayak Adkoli

Wed/

16:00 - 18:00 pm

INT260

Hands-on

4 h

Develop an E2E integration scenario with SAP Gateway, SAP HANA and SAPUI5

Orchestration, and Intelligent  Processes

Amit Nigam,

Rashimi BR,

Atanu Mallik,

Ashwani Mulpuru

Thu/

9:45 - 11:45 am

DEV360

Hands-on

2 h

Advanced OData Service Development with SAP Gateway

Development and extension
  platform for HANA and Cloud

Vinayak Adkoli,

Kranti Khilari,

Arun Bhaskaran Nair

Wed/

13:30 - 15:30 pm

CR704

Code review

30min

SAP Gateway – Tune Your OData Services

Development and extension  platform for HANA and Cloud

Arun Bhaskaran Nair

Thu/

9:45 - 10:15 am

 

2. Code Jam sessions with access to Gateway experts and Gateway tools

 


Session

ID


Session Type


Dur


Title


Track


Speakers


Session Date/Time 

CJ605

Mini codejam

1 h

Let’s have fun with OData and Apache Olingo on the SAP Hana Cloud Platform

Development and Dev and
  extension platform for HANA and Cloud
Chandan V.A

Wed/

13:15 -

14:15 pm

CJ606

Mini codejam

1 h

Development and extension Platform for SAP HANA and Cloud

My first OData Service using SAP Gateway Technology

Kranti Khilari,

Atanu

Mallik

Wed/

17:00 -

18:00 pm

 

3. Relatedlecture and hands-on sessions

 


Session ID


Session Type


Dur


Title


Track


Speakers


Session Date/Time

INT262

Hands-on

2 hOData in SAP HANA Cloud IntegrationOrchestration, and Intelligent Processes

Arun Bhaskaran, Suresh

Pasumarthi,

Rakesh

Roy

Fri/

9:15 -

11:15 am

INT103

Lecture

1 h

OData in SAP Process Orchestration

Orchestration, and Intelligent
  Processes

Vikrant Patil, Suresh

Pasumarthi

Thu/

16:30 -

17:30 pm

 

4. Demo Pod in Info Zone - SAP Integration Solutions and API Management

Our experts will be at the demo Pod in the Info zone with several innovative demos to cover the entire SAP Integration solution portfolio with API management as the featured product. Here are some preview of the demos powered by the brand new SAP API management that you can experience at the pod.

  • SAP API Management technical demo

You can experience the brand new SAP API management system live at the pod.  The on-premise edition is already released and the in-cloud edition is coming soon. Here is a sneakPreview of SAP API Management powered by HANA Analytics in the SAP Cloud.

 

  • Augmented Reality Demo - Visual Showroom (offline)

Through a tablet device  user can see the augmented reality of an interior design item from a catalog and order product real-time powered by SAP API management (joint developed with SAP partner Quantilus).

visualTable.png

  • Google Glass demo – DiscoverSimple Assist (offline)

Google Glass app on hands-free laptop repair scenario with 3D or video instruction and online inventory checking / ordering powered by SAP API Management and Gateway (joint developed with SAP partner Quantilus).


5. Social Media Program

On top our social media program will be very active during the entire TechEd && d-code in Bangalore. Whether you are onsite or remote, you can find the latest about SAP API management and Gateway on the following social media channels!


SAP Gateway                 SAP.com | SCN| LinkedIn |Youtube |Twitter |Facebook
SAP API Management   SAP.com |
SCN| LinkedIn |Youtube |Twitter |Facebook

 

SAP API management and Gateway Product Management Team

How to save text(PR Approver comments) in header level.

$
0
0

Hi,

 

the Blog describes how to save text(PR Approver comments) in header level for Standard fiori PR App.

 

  • Enhancements :-
    • Ø Implicit Enhancement for Collective Approve Action (SET_DECISION_REL_COLLECTIVE).
    • Ø Implicit Enhancement for Collective Reject Action (SET_DECISION_REJECT_COLLECTIVE).

 

  • Implicit Enhancement - SET_DECISION_REL_COLLECTIVE:-

Execute SE80-> choose Package-> specify package name ‘GBAPP_APV_PR’.

               img1.png

Expand ‘Class Library->Classes’, double click on class ‘CL_GBAPP_APV_PR_API’.img2.png   

Find the method ‘SET_DECISION_REL_COLLECTIVE’, double click on the method.img3.png

Once get into the method click on the Enhance (Shift + F4) button from tool bar.

               img4.png

Right click on the method at starting line, choose ‘Enhancement Operations -> Show Implicit Enhancement Options’. It will show like below arrow at both start & end of the the method.

img5.PNG

Right click at the end of the method, choose 'Enhancement Operations -> Create Implicit Enhancement’. click on 'Code' button.

img6.PNG

'Select or Create Enhancement Implementation' popup will come.It will ask you the Enhancement name & Short description. click on Enter.

img7.PNG

Implement custom logic(Logic provide below) between ENHANCEMENT and ENDENHANCEMENT. Save and activate it.

 

  • Implicit Enhancement - SET_DECISION_REJECT_COLLECTIVE:-

  Same as ‘Implicit Enhancement - SET_DECISION_REL_COLLECTIVE’.

 

  • Custom Logic:-
    1. Check whether the Document Type is not equal to RV (Contract Requisition) or not.
    2. If Document Type is not RV, then initiate the text (FM: INIT_TEXT) with Id = ‘B01’, Name = ‘PR No.’ and Object = ‘EBANH’.
    3. Loop the Item text table and append to the other table (Which is the input table of SAVE_TEXT function module).
    4. Pass the Header details (Id + Name + Object) and Text table to the SAVE_TEXT fm.

Code:


DATA : l_thead      TYPE thead,

        lt_tline     TYPE STANDARD TABLE OF tline INITIAL SIZE 30,

        l_tline      TYPE tline,

        l_txfunction TYPE cdupdkz.

DATA : lv_bsart TYPE bbsrt.

 

IF NOT iv_approval_text IS INITIAL.

   SELECT SINGLE bsart

     FROM eban

     INTO lv_bsart

     WHERE banfn = iv_pr_number.

   IF lv_bsart <> 'RV'.

   

     l_thead-tdid = 'B01'.

     l_thead-tdname = iv_pr_number.

     l_thead-tdobject = 'EBANH'.

   

* initialize text

     CALL FUNCTION 'INIT_TEXT'

       EXPORTING

         id       = l_thead-tdid

         language = sy-langu

         name     = l_thead-tdname

         object   = l_thead-tdobject

       IMPORTING

         header   = l_thead

       TABLES

         lines    = lt_tline

       EXCEPTIONS

         OTHERS   = 1.

 

     LOOP AT lt_text INTO ls_text.

       l_tline-tdformat = ls_text-tdformat.

       l_tline-tdline   = ls_text-tdline.

       APPEND l_tline TO lt_tline.

     ENDLOOP.

 

     CALL FUNCTION 'SAVE_TEXT'

       EXPORTING

         header   = l_thead

       IMPORTING

         function = l_txfunction

       TABLES

         lines    = lt_tline

       EXCEPTIONS

         OTHERS   = 1.

   ENDIF.

ENDIF.


Regards,

Kiran.

TechEd Bangalore, 2015: My First OData Service Using SAP Gateway Technology(CJ606)

$
0
0

Wow! TechEd is knocking at our door again. TechEd opens the 'gateway' to meet new people and also people with similar interests. As always, I am excited to participate in one of the biggest technology events.  Undoubtedly, it is a world of opportunity for everyone to learn something excitingly new in this event.

 

 

Like they say “There is a Gateway for that”, I am thrilled to share that there is aSAP Gateway session for you as well. In fact there are several sessions catering to different target groups. The sessions will cover interesting topics like, OData in SAP HANA Cloud Integration, OData in SAP Process Orchestration and Cutting-Edge SAP API Management Leveraging REST. You can find more about all the sessions related to SAP Gateway in this SAP Gateway and API Management Coming to TechEd && D-Code Bangalore.

 

 

It is my privilege to announce that we shall be conducting a Mini Code Jam session on “My First OData Service Using SAP Gateway Technology (CJ606)”.


In recent times, I am happy to see many people showing interest in SAP Gateway. Though, we have good amount of resourceful materials available at the Gateway SCN, I have heard that learners find it difficult to kick start their learning process. So, here is an opportunity for beginners to get enlightened with concepts of OData and Gateway in this session. In this session you will be able to understand the important role played by SAP Gateway in the mobility world. The session will start with an overview of OData and SAP Gateway, then we will guide you to construct OData URIs to access different information from the backend. At the end of the session, you will be able to create a simple OData service with QUERY-CREATE-READ-UPDATE-DELETE operations using the code based approach.


If you have never created any OData service before, do not worry we shall help you to create your first OData service. We would also help you to get your doubts cleared. 



So, if you are a newbie or an enthusiast, here is a chance to venture into SAP Gateway.



I am excited to meet you, see you there …



How to create a SAP Netweaver Gateway Project to Expose RFC as OData Services

$
0
0

Dear All,

 

I am writing this blog specifically for SMP 3.0 as from SMP 3.0 onwards the entire architecture is based on OData Framework. Be it any backend datasource, there is a concept of Entity Data Model (EDM) to expose your backend data in OData.

For SAP Backend systems, there are two ways to consume data from RFC(Remote Function Modules).

1. Expose the RFC as a SOAP Service using SOAP Manager and create Data Models on Eclipse IDE with SAP OData Plugins

2. Create a Gateway Service Project on Netweaver Gateway and import the service into your Eclipse IDE with SAP OData Plugins.

 

For method 2, the pre-requisite is to have an SAP Netweaver Gateway installed either in an Central Hub Deployment or Embedded Deployment

Central Hub Deployment of SAP Netweaver Gateway has SAP NW Gateway Server installed in a different instance then the SAP ERP instance whereas Embedded Deployment has all the components of SAP Netweaver Gateway installed in the same instance.

 

For this blog post we are going to follow method 2 and are using an Embedded Deployment model of SAP Netweaver Gateway.

 

Log in to you SAP Server Instance and go the the transaction SEGW

 

(If you are missing any roles, capture the SU53 logs and get in touch with your basis person to provide you with the required authorization. The basic authorization required would be of the Gateway Developer Role)

 

Once you log in to SEGW you would see the below screen

 

1.PNG

 

2.PNG

 

Click on the Create Button to create a new Project.

It will prompt you to enter the Project name, Description and the Package name if you wish to Transport the project to QAS. Else you can just create it

inside the Local Temp ($TMP) Directory by clicking Local Object button

 

3.PNG  4.PNG

 

Now we will create a Data Model Directly from the RFC,

 

I have an RFC made by name Z_SMP_PM_NOTIFICATION

 

which has two input parameters and returns a list as an output

 

35.PNG

 

36.PNG

 

So inside our project Right Click on Data Model and click on Import --> RFC/BOR Interface

 

5.png

Give the name of the Entity and the Destination RFC.

 

Here we will give the name of the Entity as NotificationList and the destination RFC as Z_SMP_PM_NOTIFICATION.

 

37.PNG

 

Click on Next to define the Fields that we require in our entity. For my RFC to work i need the REQ_INTERFACE_NAME as the input as the LT_NOTIF_LIST as output parameter so i would select only those fields.

 

6.PNG

 

Click on Next to define a key. You can also change the name of the fields under the name column. Defining a key for an entity is mandatory

 

38.PNG

 

Click on Finish to create the entity.

 

Next we will create an EntitySet which will be of the datatype the Entity that we created.

 

Double Click on the Entity Sets node and click on the Create Icon

11.PNG to create a new entity. Give the name of the Entity Set and the Entity Type name as the name of the Entity that we just created

 

12.PNG

 

Once this is done you would see an entry under the Service Implementation node with the same name as the Entity Set.

Expand it to see you will see 5 operations along with every entity set

Create - This operation will be used if you want to create any data within SAP from the webservice. for e.g Creating a new Employee in the master table

Delete  - This operation is used to delete existing entry within SAP from the webservice. for eg Deleting a particular Employee within the master table

GetEntity(Read) - This operation is used if you want to retrieve a single record against a key from SAP for e.g Retrieving details of a particular employee

GetEntitySet(Query) - This operation is used to retrieve a list of records from SAP against a query or without a queryfor e.g Retrieving list of employees or retrieving a list of employees with Country Code IN etc

Update - This operation is used to update the existing data of a record within SAP For e.g Updating contact details of a particular employee.

 

Since for this example our RFC returns a list of Notifications so we will proceed for defining a GetEntitySet(Query) Operation on our EntitySet.

Right Click on the GetEntitySet(Query) node and select Map to Datasource.

 

You can either map the fields manually or click on Propose Mapping button on the top to map it automatically

 

39.PNG

 

If your input parameter has any constant value then you can directly define it over here with ' ' quotes.

 

Once this is done we are done with the development of the Entity set and Mapping. Next this is we will Generate the Runtime Objects which all the Gateway Services require for operating.

Gateway Services based on Model Provider and Data Provider Classes.


Click on the Generate Runtime Objects button 19.PNG


If there are not errors you will see a below message that all these classes are created with a green box on their side.


23.PNG


Once all the classes are made, next thing we will do is to register this service against the SAP Netweaver Gateway Server so that we can access it.


The pre requisite for this would be that you create Destination for the Systems. If the destinations are not maintained you can make those using the TCODE SM59 and then create an alias using SPRO->SAP Netweaver-->Gateway-->OData Channel-->Configuration-->ConnectionSettings-->SAP Netweaver Gateway to SAP System--> Manage SAP System Alias and create a new Entry there against the RFC Destination.


Double Click on the Service Maintenance Node and you should see all the Destinations that you have created.

Select the Destination and click on Register Service.


21.PNG


Click on Register Button and it will ask you for a prompt


22.PNG


It will open a new page, Do not change any values, Within the package Assignment give the Package name if you wish to transport or

you can store it as a Local Object.


Click on the green tick to register the service.

Once the service is registered and deployed you will see a green box against the destination.


25.PNG

 

We have now deployed the service on the SAP Netweaver Gateway Server.

 

Next we will proceed to testing the Service that we just deployed. Go to the transaction /IWFND/MAINT_SERVICE

 

Here you will see a list of services

 

26.PNG

 

Select our service and click on the Gateway Client button

 

 

27.PNG

 

It will open up a new window

 

28.PNG

 

click on the 30.PNG and you will see the list of Entity Sets that we created under this Service

 

31.PNG

 

If you have any input parameters then you can give it after the Entity Set name. The RFC that we created had one input parameter which was a constant so i defined the constant value during mapping itself. If you have any input values for query operation you can supply it as follows

 

/sap/opu/odata/sap/ZTESTNOTIFICATION_SRV/NotificationCollection?$filter=parametername eq 'value'

 

Once you add this click on the 32.PNG button to test the service.

It should return with a HTTP Request code 200 and with the data

 

34.PNG

 

This way you can develop multiple entity sets and test it.

 

Hope this helps you all.

 

For more info on SMP, follow SMP Developer Center

 

Thanks,

Rakshit Doshi

Simple steps to perform Batch Operations in SAP Gateway Services.

$
0
0

Hi All,


This blog is continuation ofSimple Step-by-Step SAP-Gateway Service Guide ,

 

In above mentioned blog you'll find all structures,tables,entities,entity sets,association and all basic operations(CRUD), Once you done with basic operations, When the requirement is as follows.. you can continue with this blog


Again this is for beginners,not for experts 


In some cases, business entity instances may logically belong together and need to be handled or processed together in the same logical unit of work. For example, on a sales order, an update of two or more related item entries could be required and must be processed together in a single request (all or none).


SAP Net Weaver Gateway can be used to process such scenarios with its capability to execute multiple operations in a single request.


Starting with SP 04, SAP Net Weaver Gateway provides the capability for client applications to batch multiple operations into a single HTTP request, allowing for a series of retrieve operations and/or modifying operations to be executed using one request.


O Data Batch requests allow the grouping of multiple operations into a single HTTP request payload. The components of a batch request, how the request is handled, and the components of the batch response have some significant differences from components and processing of a normal, single-operation OData request.


Batch Requests are submitted as a single HTTP POST request to the batch endpoint of a service.


Initial (Mandate) Steps :


     1. Go to transaction SEGW.

                    SEGW.PNG

     2.Expand  Project(which we created in above mentioned blog) -> Run time Artifacts.

     3.Right click on class ends with DPS_EXT.

     4. Select Go to ABAP Workbench.

               Workbench.png

     5. Go to edit mode.

                    Edit_Mode.PNG

     6. Redefine methods.

          a.       /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN.

          b.       /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_END.

          Steps:

          a.       Click on /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_BEGIN   and click redefine button.

          b.       Click on /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CHANGESET_END      and click redefine button.

               redefine.PNG

           Only redefine and comment the code inside.

               Changeset_begin.PNG

               changeset_end.PNG

     7.Activate the service.

     8. Go to gateway client .(Please referSimple Step-by-Step SAP-Gateway Service Guide).

---------------------------------------------------------------------------------------------------------


Batch Read :

     Steps:-


    1.  Check HTTP Method as POST.

    2.  Request URI -> Append /$batch at the end of the service name.

          ------------/sap/ZEMPLOYEE_INFO_SRV/$batch

    3.  Click on Add Header.

         AddHeader.png

    4.  Enter Content-Type as

multipart/mixed; boundary=batch

    PopUpContentType.PNG

    5.     Paste the code in http request body.

   

--batch
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 GET EmpDetailsSet('76')?$format=xml HTTP/1.1
 --batch
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 GET  EmpDetailsSet('77')?$format=xml HTTP/1.1
 --batch—

     6. Replace Entity Set and Values according to yours.

     Batch_Read_Request _final.PNG

    7. Click Execute.

        BatchReadSuccess.PNG

         You’ll get two records in HTTP Response body.

---------------------------------------------------------------------------------------------------------


Batch Create :

    Steps :-


Follow steps 1- 4 of Batch Read.

    1.  Paste the code in http request body.


--batch
 Content-Type: multipart/mixed; boundary=changeset
 --changeset
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 POST EmpDetailsSet HTTP/1.1
 Content-Type: application/atom+xml
 Content-Length: 588<?xml version="1.0" encoding="utf-8" standalone="yes"?><atom:entry xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
 xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><atom:content type="application/xml"><m:properties><d:DETAILS m:type="ZEMPLOYEE_INFO_SRV.Details"><d:Street1>Pai Layout</d:Street1><d:Street2>Bangalore</d:Street2><d:City>BANGALORE</d:City><d:Country>INDIA</d:Country></d:DETAILS><d:EMP_ID>76</d:EMP_ID><d:NAME>ARSHAD SHAIKH CREATE</d:NAME><d:ADDRESS>BANGALORE</d:ADDRESS><d:SALARY>100000000</d:SALARY></m:properties></atom:content></atom:entry>
 --changeset
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 POST EmpDetailsSet HTTP/1.1
 Content-Type: application/atom+xml
 Content-Length: 588<?xml version="1.0" encoding="utf-8" standalone="yes"?><atom:entry xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
 xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><atom:content type="application/xml"><m:properties><d:DETAILS m:type="ZEMPLOYEE_INFO_SRV.Details"><d:Street1>Pai Layout</d:Street1><d:Street2>KR Puram</d:Street2><d:City>BANGALORE</d:City><d:Country>INDIA</d:Country></d:DETAILS><d:EMP_ID>77</d:EMP_ID><d:NAME>LK SONI CREATE</d:NAME><d:ADDRESS>BANGALORE</d:ADDRESS><d:SALARY>100000000</d:SALARY></m:properties></atom:content></atom:entry>
 --changeset--
 --batch—

     6. Click Execute.

          BatchCreateRequest.PNG


          Your No of records maintained in above request body will be created.

---------------------------------------------------------------------------------------------------------

 

Batch Update :

     Steps:-


Follow steps 1- 4 of Batch Read.

   5    . Paste the code in http request body.


    

--batch
 Content-Type: multipart/mixed; boundary=changeset
 --changeset
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 PUT EmpDetailsSet('76') HTTP/1.1
 Content-Type: application/atom+xml
 Content-Length: 588<?xml version="1.0" encoding="utf-8" standalone="yes"?><atom:entry xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
 xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><atom:content type="application/xml"><m:properties><d:DETAILS m:type="ZEMPLOYEE_INFO_SRV.Details"><d:Street1>Pai Layout</d:Street1><d:Street2>Bangalore</d:Street2><d:City>BANGALORE</d:City><d:Country>INDIA</d:Country></d:DETAILS><d:EMP_ID>76</d:EMP_ID><d:NAME>ARSHAD SHAIKH UPDATE</d:NAME><d:ADDRESS>BANGALORE</d:ADDRESS><d:SALARY>100000000</d:SALARY></m:properties></atom:content></atom:entry>
 --changeset
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 PUT EmpDetailsSet('77') HTTP/1.1
 Content-Type: application/atom+xml
 Content-Length: 588<?xml version="1.0" encoding="utf-8" standalone="yes"?><atom:entry xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
 xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><atom:content type="application/xml"><m:properties><d:DETAILS m:type="ZEMPLOYEE_INFO_SRV.Details"><d:Street1>Pai Layout</d:Street1><d:Street2>KR Puram</d:Street2><d:City>BANGALORE</d:City><d:Country>INDIA</d:Country></d:DETAILS><d:EMP_ID>77</d:EMP_ID><d:NAME>LK SONI UPDATE</d:NAME><d:ADDRESS>BANGALORE</d:ADDRESS><d:SALARY>100000000</d:SALARY></m:properties></atom:content></atom:entry>
 --changeset--
 --batch—

     6. Click Execute.

          BatchUpdateRequest.PNG

 

          Your No of records maintained in above request body will be updated.

---------------------------------------------------------------------------------------------------------


Batch Delete :

     Steps:-


Follow steps 1- 4 of Batch Read.

    5    .Paste the code in http request body.


--batch
 Content-Type: multipart/mixed; boundary=changeset
 --changeset
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 DELETE EmpDetailsSet('76') HTTP/1.1
 --changeset
 Content-Type: application/http
 Content-Transfer-Encoding: binary
 DELETE EmpDetailsSet('77') HTTP/1.1
 --changeset--
 --batch—

    6.Click Execute.

                         BatchDeleteRequest.PNG

         Your No of records maintained in above request body will be Deleted.


  Thanks,

Arshad Shaikh --

OData Model Naming Conventions

$
0
0

Hi Friends,

 

I thought of sharing the naming conventions I follow to improve the readability of my OData service for UI developers and other consumers.

 

General rules for all artefactsNo "ALL CAPS"
Use Camel case
No Underscores
Use English Names
No SAP technical names
Entity NamesOnly Nouns
Only Singulars
Not to contain operation names
examplesSalesOrderHeader, SalesOrderItem, Address, CostCenter
examples:SALES_ORDER, PO_CREATE, Orders, CostCenterF4, Bukrs, PurchaseOrderList
Complex TypeWhenever you have too many fields in your entity, improve the readability of your Entity by grouping fields into Complex Types
examples

Complex Type "Address" for complex properties "DeliveryAddress", "PostalAddress"

Complex Type "CompensationDetail" for complex properties "OldCompDetail", "NewCompDetail"

Entity SetsPlural of Entity name. Or add 'Set' at the end of Entity name
examples:SalesOrderHeaders, SalesOrderItems, Addresses, CostCenters, Currencies, CurrencySet
NavigationsSame as Entity name if the target cardinality is 1
Same as EntitySet name if the target cardinality is M
Reasoning:

Consider two self explanatory, related entities, SalesOrderHeader and SalesOrderItem. Consider the navigation between them named as "SalesOrderItems". Now, to navigate from header to item, we can use a self explanatory URL as below.

..............<ServiceName>/SalesOrderHeader('DummyKey')/SalesOrderItems

If you had named the Navigation as say "Header_Item", then you would have called URL

..............<ServiceName>/SalesOrderHeader('DummyKey')/Header_Item

which is not at all consumer friendly.

Function ImportsName should clearly Indicate the operation getting performed
examples:ReleasePO, ApproveLeave, BlockSalesOrder, GetReleaseStatus

 

Let me know your views and if you follow any other best practices.


SAP Gateway Hands-on sessions in Bagalore TechEd 2015

$
0
0

Here are a few highlights from a few SAP Gateway Hands-On session conducted in the ongoing TechEd 2015 in Bangalore.

 

Session: DEV360 - Advanced OData Service Development with SAP Gateway

 

With the Buzz around S4/HANA, it was clear that there will be a renewed need to supplant Business Suite capabilities either as HCP extensions or ABAP extensions for Public cloud and Managed Cloud / On-premise installations respectively.

 

The Advanced OData Service Development with SAP Gateway Hands-on Session on the day of the keynote couldn’t have been scheduled on a better slot. 

The session saw a packed house and we were concerned that more than a handful of participants might not find a vacant desktop to occupy!

 

20150311_133414.jpg

 

 

Arun started with a quick recap of Gateway concepts and explaining the salient features of our Design Time tools via segw.

  

After getting developers on boarded onto their systems and sampling out the exercise files, Kranti took over and explained framework features of $expand and how self-expand could be utilized and backed up with some perceivable improvements in response time.

 

Arun then went to speak about Server Side caching capabilities via Soft State, its relevance and guided the audience with the exercise files.

 

It was my turn to put Client Side caching into perspective via ETag support for Conditional Read and Update requests.

 

In a nutshell it was a well-balanced distribution between ‘slide talk’ and actual hands-on . At the end of two hours as we were winding up, we were glad to see happy faces leave the hall having completed the exercises and hopefully after having added a trick or two to their knowhow of OData Service Development

 

 

Session: INT263 - Consuming SAP data in Google Apps leveraging SAP Gateway

 

As an exciting day 1 was drawing to a close and we were skeptical of how many people would show up for the hands-on session for Consuming SAP data in Google Apps leveraging SAP Gateway which was coincidentally timed exactly around the afternoon snacks interval.

 

But our fears were put to rest as participants started pouring in and it was just a matter of time before all seats were taken, so much so that we had to create additional backend users to account for the deluge of participants.

 

20150311_160942.jpg

 

 

 

Balu began with an overview of SAP Gateway, brief architecture and its relevance for user centric applications.

 

Soon Chandan got onto the fore and started off the exercises to create a backend entity via Gateway tools and after having dealt with that portion satisfactorily, we started the much awaited segment of weaving a consumption story around Google APIs.

 

I started off with a context around Google Apps Script and showed a few example with Gmail and Forms integration and we then lead the participants round it up with a SpreadSheet App that fetched Business Partner and Sales Order data from the Gateway service.

 

Understandably, with questions and queries pouring in, we soon ran out of time and thankfully were able to extend the session by a good 15 minutes before we wound up an interesting day at TechEd2015.

 

 

 

-Vinayak Adkoli

 

 

 

 

SAP API Management at SAP TechED Bangalore 2015

$
0
0

Friday was the day for SAP API Management.

 

The day started with Balakrishnan Gottipati interviewed Chee Keong Law, Director Channel and Alliances, APJ from APIgee on SAP TechTV Live.You can see the replay by 14th March 12:00AM IST here. I would encourage all to watch the replay to understand the digital economy and the market perspective.

 

IMG_20150313_095732.jpg

 

 

The API Management demo session was from 11:00 to 13:00 and the session was always full with people wanting to see the product and getting their queries answered. Sreeharsha had a very interactive and engaged audiences.

DSC_0087.JPG



Experience Sharing: TechEd 2015 Mini CodeJam - My First OData Service Using SAP Gateway Technology (CJ606)

$
0
0

I would like to share the experience of Mini CodeJam on ‘My First OData Service Using SAP Gateway Technology(CJ606)’. I conducted the session with Kranti on the first day of TechEd Bangalore, 2015. People were very interested about the topic and as a result the session was ‘Houseful’.

 

The attendees were very energetic. Most of the participants were new to OData and SAP Gateway. Few of them were already aware of the technology (and attended some of my other sessions) but attended the session to brush up the knowledge. Some participants could not get a seat or a workstation for hands on for limited availability. Some of you have been very generous and have shared the workstations with others. Like always, everyone attending the session did not come from similar technical background. No one left the session in between and that showed me your interest in this technology.

 

I consider this session to be very successful for two reasons. The first reason is of course the successful completion of the hands on by ALL of YOU. The second reason is – YOU UNDERSTOOD IT.  This is very important. People asked us so many questions. We ask questions when we understand something and want to understand more. That made the session super interactive. Some of you had more question, but we could not take it due to Demojem announcements.

 

It was a great experience for us to meet all of you. Thank you for attending the session. We shall be glad if you share your feedback/opinion/feelings about CJ606. Here are some pictures from the session.

 

IMG-20150312-WA0000.jpg

 

IMG-20150312-WA0003.jpg

IMG-20150312-WA0005.jpg

 

I met Virinchi, Soumyadeep andDhrubajyoti Rakshitand many others in the event.

 

 

Some of you had asked me to share the materials and the code snippets. Our session was based on blog How to Develop a Gateway Service using Code based Implementation. Please refer to the blog for more details. Some of you asked to share the code snippets for CREATE-UPDATE-DELETE operations. Please refer to the attachments for the snippet. For more, please  refer to our blogs and materials available in SAP Gateway Community in SCN.

How complex are your OData models? Need your Feedback !

$
0
0

Dear community,

 

today I am asking for your help to find out more about the nature of OData services you are working with. We are currently defining the Ux specification for tools that should visualize OData models.

 

We need to understand what is the most common case for customers in  terms of size of OData Models you as a customer work with.

 

  1. How many entity types typically customers work with in one service?
  2. How many entity sets typically customers work with in one service?
  3. How many complex types customer generally use in on model?
  4. How many function imports?
  5. What would be number of properties in each entity set customer would be using?

 

If you can provide some inputs based on the scenarios you have face, it would be helpful for us.

 

You can either post a comment to this message or you can contact me directly.

 

Best Regards,

Andre

Deep Insert - Request payload formats

$
0
0

Hi Everyone,

Below are the payload request details required to post complex business entities( 1 : N records) into gateway framework.

 

Scenario : Header with 1 product and multiple notes

 

XML payload:

 

<?xml version="1.0" encoding="UTF-8"?>

<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<atom:content type="application/xml">

<m:properties>

    <d:Partner>3602102164</d:Partner>

    <d:Category m:null="true"/>   

    <d:CommType m:null="true"/>

    <d:Telephone>9944380099</d:Telephone>

    <d:Email>prabaasokan@gmail.com</d:Email>

</m:properties>

</atom:content>

<atom:link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Products" type="application/atom+xml;type=feed" title="Sales_Products">

<m:inline>

    <atom:feed>

        <atom:entry>

            <atom:content type="application/xml">

            <m:properties>              

             <d:ProductId>G_CLEARSIMPLE</d:ProductId>

              <d:ProductGuid></d:ProductGuid>

                <d:ShortText m:null="true"/>

                <d:BaseCategoryId>4545</d:BaseCategoryId>

                <d:BaseCategoryDesc m:null="true"/>

            </m:properties>

        </atom:content>

    </atom:entry>

</atom:feed>

</m:inline>

</atom:link>

<atom:link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Notes" type="application/atom+xml;type=feed" title="Sales_Notes">

<m:inline>

    <atom:feed>

        <atom:entry>

            <atom:content type="application/xml">

            <m:properties>

                <d:Tdformat>*</d:Tdformat>

  <d:Tdline>[SUMMARY]Please check the functionality and correct the issues in both</d:Tdline>                  

            </m:properties>

        </atom:content>

    </atom:entry>

      <atom:entry>

            <atom:content type="application/xml">

            <m:properties>

                <d:Tdformat>*</d:Tdformat>

  <d:Tdline>the products[SUMMARY][ACTIONS]Please check the functionality and correct</d:Tdline>                  

            </m:properties>

        </atom:content>

    </atom:entry>

    <atom:entry>

            <atom:content type="application/xml">

            <m:properties>

                <d:Tdformat>*</d:Tdformat>

  <d:Tdline>the issues in both the products[ACTIONS]</d:Tdline>                  

            </m:properties>

        </atom:content>

    </atom:entry>

</atom:feed>

</m:inline>

</atom:link>

</atom:entry>

 

 

JSON payload - Navigation property points to a multiple cardinality entity:Header with 1 product and 3 notes.(Separate first 2 notes by comma operator and last entry without comma)

 

{

"Partner":"3602102164",

"CommType":"mobile",

"Telephone":"877845545",

"Email":"prabaasokan@gmail.com",

"Products":[{

"ProductId":"G_CLEARSIMPLE",

"ProductGuid":"0001",

"ShortText":"test",

"BaseCategoryId":"5656",

"BaseCategoryDesc":"" }],

"Notes":[{

"Tdformat":"*",

"Tdline":"[SUMMARY]Please check the functionality and correct the issues in both"

},

{

"Tdformat":"*",

"Tdline":"the products[SUMMARY][ACTIONS]Please check the functionality and correct"

},

{

"Tdformat":"*",

"Tdline":"the issues in both the products[ACTIONS]"

}

]

}

 

JSON payload - Navigation property points to a single cardinality entity:Header with 1 product and 1 note.


{

"BusPartner":"3602102164",

"Telephone":"9944380099",

"Email":"prabaasokan@gmail.com",

"Products":[{

"ProductId":"G_CLEARSIMPLE",

"ProductGuid":"0001",

"ShortText":"Test",

"BaseCategoryId":"5655",

"BaseCategoryDesc":"Utility" }],

"Notes":[{

"Format":"*",

"Line":"[SUMMARY]Please check the functionality and correct the issues in both" }]

}

 

Note: Bold ones are the Navigation properties.

 

Cheers

Viewing all 245 articles
Browse latest View live


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