Quantcast
Channel: SAP Gateway
Viewing all 253 articles
Browse latest View live

GWPAM Appointment Template

$
0
0

This is the third and last blog of my series about the GWPAM Templates. Earlier blogs covered the Contact Template and the Workflow Template. Today I will briefly go over the Appointment Template.

 

In various SAP systems there are business objects that carry calendar-based information, e.g. CRM activities, time recordings, or leave requests.

GWPAM generates Outlook Add-ins bringing calendar-based information into Outlook utilizing OData services. A wizard guides you through a number of choices, similar to the ones of the Contact Template (see my earlier blog for details).

 

Here a sample screenshot of the selections you can make in the wizard:

GWPAM_Appointment_Template_Wizard.jpg

 

Based on the instructions given in the wizard, GWPAM generates an Outlook 2010 Add-in project with the C# coding that can query, create, update and delete Outlook Appointments. The generated coding should be treated as a prototype and can be adjusted to suite your requirements.

 

Watch this video for a demonstration on how to use the GWPAM Appointment Template. For more details, please check out this presentation, which is part of our Self-Paced Learning offering for Gateway PAM.


GWPAM Add SAP Service Reference

$
0
0

In previous blogs I have introduced a feature of GWPAM that generates Outlook Add-ins based on three templates - Contact, Workflow, and Appointment Template.

 

You might be wondering what to do if you want to create solutions other than Outlook Add-ins. Here GWPAM offers the Add SAP Service Reference features.


When should you use this feature?

You want to create Windows applications, of any type, that leverage SAP NetWeaver Gateway OData Services to display and modify SAP data. You can use it for new or existing Visual Studio projects, but they have to be Visual C# projects. For example, if you create add-ins for Microsoft Office applications, like Word, Excel or PowerPoint, then you can benefit from the Add SAP Service Reference feature.

 

You can also use it to extend GWPAM-generated Outlook Add-ins by adding Gateway OData Services that are not included in the out-of-the-box GWPAM templates, e.g. adding a custom value help.


What does it actually do?

It adds a number of new objects to your Visual Studio project:

  • It adds references to GWPAM assemblies - SAP.IW.GWPAM.Common, SAP.IW.GWPAM.OData.Parser, SAP.IW.GWPAM.SSO. These assemblies contain classes that will help with a variety of tasks, e.g. providing Single Sign On capabilities.
  • It generates proxy classes matching the Entity Sets defined in the metadata document of the OData Service.
  • BusinessConnectivityHelper Class: This class handles the connectivity and authentication to the OData endpoint.
  • App.config: This file contains important configuration settings like the URL of the OData service, the authentication mode and logging settings.
  • ADM file: This file can be used to configure your Global Group Policies.
  • Logger Class: This class provides an API to log necessary information to the Event Viewer or local file.

 

Here a sample screenshot of a Windows Forms Application project highlighting objects that have been added by the Add SAP Service Reference feature:

GWPAM_Add_SAP_Service_Reference.jpg


Why should you use this feature?

It helps you to simplify your development right within Visual Studio. You can use the proxy classes to quickly add coding to trigger OData service operations without having to take care of technical specifics like X-CSRF token handling.


You benefit from the enterprise-ready features provided by GWPAM. Out of the box Single Sign On and Connectivity helper classes ensure secure interaction with OData services. The GWPAM Logging feature is integrated with the Proxy Classes. With App.config, ADM file and Global Group Policies you can easily configure your solution and switching from Development to QA to Production environment. Your solution can leverage GWPAM’s integration into Solution Manager for monitoring, end-to-end tracing and supportability.


More Information

Watch this video for a demonstration on how to use the Add SAP Service Reference feature. For more details, please check out this presentation, which is part of our Self-Paced Learning offering for GWPAM.

Day 2 Highlights from TechEd Amsterdam

Extending the generated GWPAM Visual Studio projects

$
0
0

Using the GWPAM Template wizard, .NET developers can quickly create Microsoft Outlook Add-ins within Visual Studio.

 

For example, out of the box GWPAM Contact template can be used to create GWPAM Outlook add-in application in just a few clicks.

GWPAM_Extensibility_1.jpg

The SAP CRM contacts can then be fetched from the SAP system, via the GetAll function, to the Microsoft Outlook Contacts.

GWPAM_Extensibility_2.png

The users can maintain these SAP CRM contacts in Outlook and update the source SAP system.

GWPAM_Extensibility_3.png

For a demonstration of how to use the SAP GWPAM Contact template, refer to this video: SAP GWPAM Demo: Contact Project Template.

 

Although the generated GWPAM Visual Studio project can be used as-is (“code-free” development), it can be modified or extended to address the exact customer requirements. To assist the .NET developers with the extensibility potential of GWPAM generated Outlook add-ins, we have selected a list of commonly used scenarios based on the feedback from our customers. These scenarios can be found in the GWPAM Developer Guide and are intended as examples with step-by-step implementation instructions to facilitate GWPAM development.

 

The GWPAM extensibility examples include:

  • How to extend the generated GWPAM Workflow solution
  • How to consume the GWPAM generated application configuration
  • How to work with complex properties
  • How to extend the GetAll function with filters
  • How to create a custom task pane
  • How to add custom tabs to display Users entities
  • How to add custom tabs to display Associated entities

 

As an illustration, the generated GWPAM Workflow solution can be easily extended to add a custom Value Help to assist the user to select the recipient when forwarding a task in Microsoft Outlook. The custom value help search button triggers a Query operation to the SAP NetWeaver Gateway OData service to retrieve a list of SAP users. A user (e.g. ‘ABBEC’) can be selected as the next agent/approver for the task.

 

GWPAM_Extensibility_4.png

For a demonstration of the step-by-step implementation how to add a custom value help, refer to this video: SAP GWPAM Demo: Add a Custom Value Help.

 

Additional Resources

To learn more about GWPAM, please check out the following resources:

SAP Help Portal

GWPAM Self-Paced Learning

SAP NetWeaver Gateway

Thoughts from TechEd Amsterdam - Microsoft / SAP Interoperability

$
0
0

We had a few people from the NetWeaver Gateway and Duet Enterprise product management and development teams attending and presenting in a lot of sessions during this years SAP TechEd in Amsterdam. My colleague Ella Morgulis already created a great look back (Amsterdam TechEd is closed... stay in touch till we meet next time!), so I do not want to focus too much on the "pure" NetWeaver Gateway related topics. Instead, I want to  concentrate on the Microsoft / SAP specific topics.

 

I have to say I am really amazed. I have been working in the SAP / Microsoft space for quite some time now but during this TechEd I was overwhelmed by the response. My very first Networking Expert session on Microsoft / SAP interoperability attracked easily more than 50 people. And that for a "simple" networking session. The response for the second session was equally great and we always had some very fruitful discussions during and after these session.

 

IMG_0932.JPG

 

In addition to these two networking sessions, we also hosted two customer roundtables for T-Systems and Kaefer Wanner. Here both customers talked about their experience during their latest Duet Enterprise projects. We had scheduled both sessions for 1,5 hours -- but in both cases I think we could have easily extended the time to 2 hours. The interest and discussions were just great.

 

WP_20131106_005.jpg

 

Finally at the pod the traffic was also really good. I had lots of very interesting discussions and the feedback that we got both from customers and partners was very encouraging. Not only Duet Enterprise, but also the new NetWeaver Gateway Productivity Accelerator for Microsoft is very well received.

 

WP_20131106_010.jpg

 

 

We clearly heard that a lot of SAPs customers are using Microsoft Office (and like mentioned in a recent study by Forrester it is not always the latest and greatest Office tool) and are looking for ways to enrich these productivity tools with data from SAP. When I demoed how easy it is to bring workflows, contacts or calendar objects with a few clicks in Outlook, I could see eyes lightening up. All the technical plumbing starting with SSO, Supportability or things like CSRF token handling is already done for you. It is not a fixed scenario, but now you have a great foundation to build applications that are designed for life from the very beginning.

 

GWPAM-BridgingTheGap.png

 

One other interesting fact was the great collaboration that we have with Microsoft. Their pod was only a few meters away from ours and quite often we either asked customers to get additional information from Microsoft, or we got customers who were directed from the Microsoft pod to our demo pod. It was really a great team-work and we also had quite a few discussions together.

 

WP_20131105_016.jpg

 

Of course there were also quite a lot of (similar) questions and I noted them down. Very soon we will publish an FAQ and list down all these questions (and their answers of course :-).

 

In the meantime -- please feel free to reach out to us. We have also scheduled a Webinar for November 12th where we will talk about

NetWeaver Gateway Productivity Accelerator for Microsoft . Feel free to register at:  https://www2.gotomeeting.com/register/617575538

 

Update 23.11.2013:

During TechEd I also had the opportunity to interview William van Strien from The Next View. The Interview is now available on YouTube.

SAP Fiori – Generic Approval - ui5_ca_all_apv

$
0
0

System Details

 

NetWeaver Gateway

 

Component

Ver

SP

Description

SAP_BASIS

731

6

SAP Basis Component

SAP_ABA

731

6

Cross-Application Component

GW_CORE

200

6

SAP GW CORE 200

IW_BEP

200

6

Backend Event Provider

UISAPUI5

100

4

SAP UI5

IW_FND

250

6

SAP IW FND 250

 

SAP Notes of Interest

 

  • 1805831 - Workflow Support Decision options Nature (Positive/Negative)
  • 1884623 - SP04: Fixes and performance improvements for Fiori Home

 

 

Thanks

Thanks to masayuki sekihara for all his support in providing guidance for our Fiori implementation.  He provided the sample BADI implementation for us as well as answering numerous emails and phone calls.

 

 

 

Useful Links

 

 

 

 

 

 

 

Assumptions

 

  • Included some sanity checking with RFC setup etc, this isn’t supposed to be an exhaustive setup guide.  I've assumed you've followed the installation and configuration guide

 

  • I haven’t gone into a great deal of detail in some cases, I’m assuming you know how to do things such as creating a BADI implementation.

 

  • You've installed the correct add-ons on both Gateway and target system such as SRM or ECC.

 

 

Introduction

 

A recent twitter conversation between John Moy and Jocelyn Dart prompted me to do a quick blog about the Fiori Generic Approval application. 

 

The Generic Approval application in Fiori was delivered to provide an Approve / Reject functionality for any SAP workflow with a decision task.  I had a chat to Masa about this and he indicated that the application was also for non-SAP workflow as well ( that would be an interesting blog ).

 

The application name is ui5_ca_all_apv and you will be able to find the application in the BSP repository via SE80.  If you can’t find the app, then it may not be installed.  Check with whoever did the add-on installations in this case.

 

We had recently implemented this at a customer and probably went through the same learning curve as everyone else, I hope you find my experiences useful in your implementations.

 

Apart from the installation of add-ons and making sense of all the SAP Notes ( hardest part ) the Generic Approval ( in our case Leave Request ) was relatively easy to get up and running.

 

I can hear what you’re all saying, “why not use the standard leave app…” yes, but when you’re working with ITS based leave services, the standard Fiori Leave application doesn’t work hence we used the Generic Approval application instead.

 

What I wanted to cover:

 

  • IMG config Gateway + ECC
  • Fiori Catalog and Tile creation
  • PFCG Role Assignment
  • BADI Implementation ( container operation for pushing the workflow along )
  • Adding “approval notes” or “rejection notes”
  • Final Result

 

What I am not going to cover:

 

  • Installation - including the SAP Note list for SP6 for Gateway
  • Workflow Build – Assume you have a workflow decision task and workflow scenario ready to rock

 

Remember, our scenario here is a generic Leave Request approval.  You can apply the same concepts here to other general approval tasks.

 

 

 

 

OData, RFC Setup and Other Sanity Checks

 

At some stage, there were a stack of issues for me ( including security stuff ) where I had to go back and verify the configuration of RFC’s and the IMG activities.

 

This section is just for a sanity check and a place to start looking of things go wrong if your Fiori application starts throwing errors ( such as no RFC destination, OData service errors ).

 

We also used the Gateway services test harness which shows us the return codes and response for OData services.  When they are returning 200 OK codes you're in good shape, there are some other good tools in there as well to help you work out what's going wrong from the OData side.

 

 

 

Security Issues

Run traces in ST01 when getting authorisation errors, 9 times out of 10 for us, it was a missing authorisation object like S_SERVICE or S_RFCACL.

 

Follow the installation guide that describes using role templates and copy them.

 

The other thing to watch out for here is authorisations on the target system.  Ensure your users have the correct authorisations ( e.g. for HR, consider structural auths ).

 

 

 

RFC Entries

  • Check your RFC’s via SM59
  • Ensure that the settings as explained in the installation guide or Masa’s documents are followed.  Take note of the Trust settings

 

RFC_1.png

 

Manage SAP System Aliases

Manage SAP System Aliases SAP NetWeaver->Gateway->OData Channel->Connection Settings->SAP NetWeaver Gateway to SAP System->Manage SAP System Aliases

MANAGEALIASES.png


 

Check entries here:

 

  • Check you have two entries, both will point to the same RFC destination.  The alias ending with "PGW" is used for software version /IWPGW/BWF for business workflow, this is the task provider for ECC in our case.
  • Your naming conventions maybe different but ensure the System ID and Client number are populated ( had to blank them out for this blog )

 

MANAGEALIASES2.png

 

Assign SAP System Aliases to OData Service

SAP NetWeaver->Gateway->OData Channel Development with IW_BEP->Registration->Assign SAP System Aliases to OData Service

 

ODATA 1.png

 

Check the entries here:

 

  • Entry for ZLEAVEAPPROVAL_0001, SAP System Alias will point to the "DEFAULT" software version.
  • Entry for TASKPROCESSING, SAP System Alias will point to the “/IWPGW/BWF" software version.

 

ODATA 2.png

 

 

Activate and Maintain Services

Transaction /IWFND/MAINT_SERVICE SAP NetWeaver->Gateway->OData Channel Development with IW_BEP->Registration->Activate and Maintain Services

 

SERVICES1.png

 

Check your entries here:

 

  • Check ZTASKPROCESSING is pointing to the "/IWPGF/BWF" software version.  The system alias ( in the bottom right corner of the picture ) ends with "_PGW'. 
  • You can also test the service here, which will give you better details and logs if the service fails when called, you’ll have access to the response from the target system too.

 

SERVICES2.png

 

Check entries here:

 

  • For the ZLEAVEAPPROVAL app, make sure the SAP System Alias is pointing to the "DEFAULT" software version, NOT the "/IWPGW/BWF" software version ( see the System Aliases at the bottom right of the picture ).

 

SERVICES3.png

 

 

 

Testing Services

When you test the services, you should be getting 200OK codes to show you the test was successful. If this is not happening ( could be many reasons ) you can now see the Error Log and the Response which will help you track down SAP Notes, Knowledge Articles on SCN or Service Market Place.

 

TESTSERVICES.png

 

 

SICF Activation

As always, there is always someone who doesn’t activate their services via SICF.  Make sure the correct SICF entries are activated for the functionality you require.

 

 

 

Gateway Configuration – SPRO

 

SAP NetWeaver->Gateway Service Enablement->Content->Task Gateway Service->Scenario Definition

 

SCENARIO1.png

 

You have created a Scenario Definition

  • Notice the Technical Service name is pointing to the IWPGW/TASKPROCESSING

 

SCENARIO2.png

 

Set your consumer types

  • Make sure your consumer types DESKTOP / MOBILE / TABLET are set.

 

CONSUMERTYPES.png

 

Assign Task Definition

  • Here check that your SAP System Alias is pointing to the alias with software version "/IWPGW/BWF".
  • Ensure your “TSxxxxxxx” number is correct  This will be the approval task ID in your ECC system.

 

TASK DEFINITION.png

 

 

 

ECC Configuration – SPRO

 

There are a couple of things to check here.

 

SAP NetWeaver->Gateway Service Enablement->Content->Workflow Settings

 

ECC1.png

 

Check Entries here:

 

  • Ensure your Workflow ID is correct
  • Ensure the Step ID of the approval task in the worklow is correct ( validate this in SWDD )
  • You have 2 entries for Decision, Approve / Reject ( remember the keys, it’s important when implementing the BADI ).
  • Ensure you’ve selected the POSTIVE, or NEGATIVE from the drop down list
  • NB: Ensure you’ve installed the correct SAP Notes that provide the extensions necessary to perform this configuration.

 

ECC2.pngECC3.pngECC4.png

 

 

 

Tile Configuration – Fiori Admin Page

 

Here is where we configure the Fiori Tile from the Admin page.  In our implementation we used the catalog ID of SAP_HCM003_HCM_LVRQ_APR only because it already had the appropriate authorisations attached the standard SAP role.  But you can create your own.  Just wanted to explain this because the screen shots may be confusing.

 

Launch the Admin tool:

 

http://<host>:<port>/sap/bc/ui5_ui5/ui2/launchpage/admin/admin.html?sap-client=XXX&sap-language=EN

 

Here is the Catalog page

 

  • You can create your own Catalog here for the generic application
  • We decided to add another one into HCM003_HCM_LVRQ_APR to take advantage of the SAP Standard Security Role. 

 

FIORI1.png

 

  • When you create a new Tile, create via App Launcher (dynamic)

 

FIORI2.png

 

  • Enter Title, Icon, Service URL and Target URL

 

FIORI3.png

FIORI4.png

 

 

Service URL

 

  • URL for OData service to retrieve data, ensure your SCENARIO ID is included here, the apostrophes are important

 

/sap/opu/OData/iwpgw/taskprocessing;mo/ScenarioCollection/?$filter=key eq 'Z_APPROVE_LEAVE'

 

 

 

Target URL

  • URL for navigation, you don’t need the apostrophes here.

 

/sap/bc/ui5_ui5/sap/ui5_ca_all_apv/index.html?backToHome=true&scenarioId=Z_APPROVE_LEAVE

 

You should have a new Catalog with Tile:

 

FIORI5.png

 

 

 

Tile Display via PFCG Role

 

When you want the tile to display for the Generic Approval application, you can follow the installation guide (7.3 Configure Launch Settings for Custom Workflows).

 

The screenshot below shows where the settings are made in transaction PFCG.  Note the Type / Object / Text.

 

  • In object, ensure the PAGEID= <Your Catalog Name>

 

PFCG.png

 

 

 

Launch Page

 

You should be able to test the launch of the application now.  You should see your Generic Approval application displayed as a Tile.

 

  • http://<host>:<port>/sap/bc/ui5_ui5/ui2/launchpage/home.html


You can open the application, but it won’t approve/reject yet as you need to implement the BADI in order to process your workflow task.  If you have approval tasks assigned and the app / OData services are working, you should see the work item count.

 

LAUNCHPAGE.png

 

 

 

BADI Implementation

 

In order to approve/reject your approval task, you need a plug in point to process the decision keys you’ve configured earlier.

 

You can use BADI definition:

/IWWRK/BADI_WF_BEFORE_UPD_IB

 

  • Create your own enhancement implementation and also an implementation class
  • Ensure you enter values for Filter Values STEP_ID and WORKFLOW_ID.  This will ensure the BADI is only executed for your defined workflows and steps.

 

BADI1.png

 

 

Sample Code

In the method “/iwwrk/if_wf_wi_before_upd_ib~before_update” you implement code for handling the workflow decision triggered for the Generic Approval application.

 

Here is some sample code from Masayuki.  I've added in a couple more things like adding attachments.

 

 DATA ls_object          TYPE swr_obj_2.  DATA lv_objtype         TYPE swr_struct-object_typ.  DATA lv_objkey          TYPE swr_struct-object_key.  DATA lv_subrc           TYPE sy-subrc.  DATA lt_container       TYPE TABLE OF swr_cont.  DATA ls_container_line  TYPE swr_cont.  DATA formnumber         TYPE swxformabs-formnumber.  DATA ls_formabs         TYPE swxformabs.  DATA lt_header          TYPE TABLE OF solisti1.  DATA lv_return          TYPE swotreturn.  DATA lt_attachments     TYPE TABLE OF swrsobjid.  DATA ls_attachment      LIKE LINE OF lt_attachments.  DATA lt_messages        TYPE TABLE OF swr_messag.  DATA ls_comments_line   LIKE LINE OF it_wf_container_tab.  DATA ls_attachment_hdr  TYPE swr_att_header.  DATA lv_notes           TYPE string.


**********************************************************************
* ATTACH NOTES AS SOFM DOCUMENT
**********************************************************************
  READ TABLE it_wf_container_tab INTO ls_comments_line WITH KEY element = 'ACTION_COMMENTS'.  IF sy-subrc = 0.    MOVE ls_comments_line-value TO lv_notes.

 ls_attachment_hdr-file_extension = '.htm'.
 ls_attachment_hdr-file_type      = 'T'.    ls_attachment_hdr-language       = 'EN'.
 ls_attachment_hdr-file_name      = 'Approver Comments'.    CALL FUNCTION 'SAP_WAPI_ATTACHMENT_ADD'      EXPORTING
 workitem_id    = is_wi_details-wi_id
 att_header     = ls_attachment_hdr        att_txt        = lv_notes        document_owner = sy-uname        language       = sy-langu        do_commit      = 'X'      IMPORTING
 return_code    = lv_subrc      TABLES
 message_lines  = lt_messages.  ENDIF.  "Read the workflow's container data  CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'    EXPORTING      workitem_id      = is_wi_details-wi_id    IMPORTING      return_code      = lv_subrc    TABLES      simple_container = lt_container.  " Check which decision was selected and set the data  " values appropriately  CASE iv_decision_key.    WHEN 0001. "Approved
 ls_container_line-value = 'A'.
 ls_formabs-procstate = 'A'.    WHEN 0002. "Rejected
 ls_container_line-value = 'R'.      ls_formabs-procstate = 'R'.  ENDCASE.  "ACTUALSTATE is what the workflow keys off to determine  "which path to follow - Approve or Reject path
 ls_container_line-element = 'ACTUALSTATE'.

*  "Modify the workflow's container data - we are updating the row that
*  "holds ACTUALSTATE which will be in the second row of the table  MODIFY lt_container  FROM ls_container_line TRANSPORTING value WHERE element = 'ACTUALSTATE'.
 ls_container_line-element = 'USAPPROVER'.  CONCATENATE 'US' sy-uname INTO ls_container_line-value.  MODIFY lt_container  FROM ls_container_line TRANSPORTING value WHERE element = 'USAPPROVER'.


**********************************************************************
* WRITE CONTAINER AND COMMIT CHANGES
**********************************************************************

  "Write the updated container back to the workflow engine  CALL FUNCTION 'SAP_WAPI_WRITE_CONTAINER'    EXPORTING      workitem_id      = is_wi_details-wi_id      do_commit        = 'X'    IMPORTING      return_code      = lv_subrc    TABLES      simple_container = lt_container.  IF sy-subrc NE 0.    "Handle error  ENDIF.  "Complete the task  CALL FUNCTION 'SAP_WAPI_WORKITEM_COMPLETE'    EXPORTING      workitem_id = is_wi_details-wi_id.  "This task requires a confirm to be fully completed  "and start the next step in the workflow  CALL FUNCTION 'SAP_WAPI_WORKITEM_CONFIRM'    EXPORTING      workitem_id = is_wi_details-wi_id.

 

 

 

 

Adding Rejection / Approval Comments

 

When you approve / reject the workflow item, Fiori pops up a screen to allow the user to enter comments.

 

I couldn’t work out where this was possible to capture for the generic scenario so we used the function 'SAP_WAPI_ATTACHMENT_ADD'.  You can extract the comments from the passed in container with element 'ACTION_COMMENTS'.


The one thing I noticed here, the attachments are created successfully.  What you should see in the Fiori application on the approval page is a purple Icon:

Sometimes the notes are created and the purple Icon displays.  Other times the notes are created and the “paperclip” is show ( a link to a .html document ).

 

I’m still baffled by this and need to look into it further.  If anyone has the answer, please post it in response to this blog.

 

MESSAGES.png

 

 

 

Results

 

You should now be able to approve/reject a workflow task.  When you open your Tile, you’ll see the items waiting to be approved on the left, and some basic details and information on the right.

 

RESULT.png

 

You’ll see there are few screen elements here worthy of explanation:

 

  • Title “Process leave request for …” is from the title of the work item task
  • Description, as the name suggest, is the description you have defined in the workflow task
  • SAP WORKFLOW user.  This is the technical name of the workflow batch user.  This appears here when the item is first generated and pulled into the Fiori application.  I’m still working on figuring out how / why this happens.  After you approve / reject the item, the correct name appears instead.

 

 

 

 

Final Thoughts

 

I hope this blog helps you during the implementation of the Generic Approval application in Fiori.  I know I haven’t covered a bunch of details here however these should be in the installation and configuration guides.

 

The biggest challenge we faced was installing all the of the SAP Notes correctly which would make for a good blog for someone else.

 

Again, the usual suspects need to be checked, SICF and security roles and configuration errors that caused us grief during testing. 

 

I hope some of the sanity checks help you because I had to trawl through all of this for hours to work out what we had done wrong at some point of our implementation.

 

Lastly, if you have any feedback on the content in this blog or would like to see more information added, drop me a line.  Share your experiences with the Generic Approval application so we can build on our collective experience

 

 

 

 

Follow up Blogs

 

Here are some interesting topics I'd like to blog about next, unless someone else in the community wants to tackle them as well:

 

  • Using the Generic Approval application in a Non-SAP environment
  • Using the Generic Approval application with another software version /IWPGW/BPM for example
  • Deep Dive into the Task Gateway Service

 

 

 

 

Questions

 

I'm going to have a look at answering the following questions which I raised while putting the blog together:

 

  • Why does SAP_WAPI_ATTACHMENT_ADD create notes in the task differently, sometimes it appears in Notes, other times as an attachment, what the....

 

 

OData 4.0 is Candidate OASIS Standard

$
0
0

The OASIS OData Technical Committee has approved the latest OData 4.0 Committee Specification as a Candidate OASIS Standard.

 

The revised documents are available at

 

HTML and PDF versions of the documents will be published within the next weeks.

 

The next step towards a full OASIS Standard will be a 60-day public review.

 

I'll keep you posted.

Custom Gateway service with CRUD Operations and Android application through Eclipse Part 3

$
0
0

In Part1 Custom Gateway service with CRUD Operations and Android application through Eclipse Part 1& Part2 Custom Gateway service with CRUD Operations and Android application through Eclipse Part 2 I discussed :

1. RFC function module with PO Number,Creation Date & PO Release indicator as input parameters.

2. Create service in Gateway system with all the CRUD operations.(Create Read Update Delete)

3. Test our service in 'Service Explorer' (Various filter options along with CRUD operations).

 

In Part3 I will be discussing how to :

4. Create Application in Eclipse and test it on Simulator.

 

 

4. Create Application in Eclipse and test it on Simulator.

     Calling our service in eclipse is simple but, we have three input fields(PO number, Date & Release Indicator) for which we need to create a new screen and      write some java code. Actually i do not have knowledge on java/android programming, with help of my friend I copied screens and try to call this screen.

     Below are the steps i will follow to complete our app.

     a. Import service to Eclipse.

     b. Copied login screen, changed default fields and included our required fields.

     c. Add new activity in AndroidManifest.xml.

     d. Add code to SelectionActivity.java

     As I already specified I do not have idea on Android programming, for running my scenario I did above changes (May be android developer will be more      familiar with the steps).

 

     a. Import service to Eclipse.

3.jpg

4.jpg

 

Import service and complete the application.

 

     b. Copied login screen, changed default fields and included our required fields.

         5.jpg

      Include required label and text fields:

6.jpg

     c. Add new activity in AndroidManifest.xml.

7.jpg

      d. Add code to SelectionActivity.java

          Default screens will be: Login screen -> List screen -> Details screen

          Now i included selection screen to enter PO Number/Date/Release Indicator

          After changes screen sequence will be

               Login screen -> Selection screen -> List screen -> Details screen

 

          So, in login screen we need to call Selection screen and in selection screen we will call list screen.

8.jpg

9.jpg

Build query

10.jpg

Save and Test the application in emulator.

11.jpg

12.jpg

 

We will get PO header details.

13.jpg

For each PO number we will get Item details in next screen.

Screens and backend logic can be handled better by an android developer. Even we can include input fields to enter range values (like select options) , handle error messages and all CRUD operations in application.

 

We can use this .APK file to test it on Android device. Right click on your project in Eclipse and goto Properties. Under Resource -> Location, you can get above file(.APK) location.


Custom Gateway service with CRUD Operations and Android application through Eclipse Part 2

$
0
0

In Part1 Custom Gateway service with CRUD Operations and Android application through Eclipse Part 1 I discussed :

1. RFC function module with PO Number,Creation Date & PO Release indicator as input parameters.

2. Create service in Gateway system with all the CRUD operations.(Create Read Update Delete)

 

In Part2 & Part3 Custom Gateway service with CRUD Operations and Android application through Eclipse Part 3 I will be discussing how to :

3. Test our service in 'Service Explorer' (Various filter options along with CRUD operations).

4. Create Application in Eclipse and test it on Simulator.

 

3. Test our service in 'Service Explorer' (Various filter options along with CRUD operations).

In Transaction: /IWFND/MAINT_SERVICE  goto Service Explorer.

 

Also we can test in Gateway Client: Tcode /IWFND/GW_CLIENT

 

4.jpg

5.jpg

 

Testing individual key:

POSet/?$filter=Ebeln eq '3000000191'

6.jpg

7.jpg

Likewise below are other individual filter options:

POSet/?$filter=Aedat eq datetime'2001-07-16T00:00:00'

POSet/?$filter=Frgke eq 'R'

 

Lets see how to test for multiple fields in filter options:

Get PO's in a given range:

POSet/?$filter=Ebeln ge '3000000191' and Ebeln le '3000000199'

Get PO with release indicator eq 'R'

POSet/?$filter=Ebeln eq '4500004858' and Frgke eq 'R'

 

Testing Associations:

For below filter we will get 3000000191 PO and also corresponding Items (In Association we mapped header & items entity sets).

POSet/?$filter=(Ebeln eq '3000000191')&$expand=PONav

 

Other filter options:

POSet/?$top=2&$filter=(Ebeln ge '3000000191' and Ebeln le '3000000199')

Will return only top 2 records in given condition

 

POSet/?$skip=2&$filter=(Ebeln ge '3000000191' and Ebeln le '3000000199')

Will skip first 2 records in given condition and returns rest of the records

 

Likewise we have many other filter conditions. (You can check URI conventions http://www.odata.org/documentation/odata-v2-documentation/uri-conventions/ )

 

Testing CRUD Operations: (Gateway Client: Tcode /IWFND/GW_CLIENT)

 

Read:  (GET)

 

http://<host name >/sap/opu/odata/sap/ZBPS_PO_DEMO_SRV/POSet/?$filter=(Ebeln eq '3000000004')

 

Update: (PUT)

As PUT is to update a record, we should not use Filter in URL.   

First we need to READ(GET).

 

http://<host name>/sap/opu/odata/sap/ZBPS_PO_DEMO_SRV/POSet(Frgke='',Ebeln='3000000004',Aedat=datetime'0000-00-00T00:00:00')

Above URI without filter and also, as FRGKE and date are my key fields I am passing initial values.

1.jpg

 

Then, 'Use as Request' button and then use HTTP Method 'PUT' to update. I am trying to update Inco2 (Incoterm) field.

3.jpg

 

Create: (POST)

After read operation , 'Use as Request' and 'POST' the request to create new PO (I hardcoded PO item details). For creating PO with multiple items we need to implement CREATE_DEEP_ENTITY method.

1.jpg

Check Success status code 201.

12.jpg

 

Delete: Similar to Update operation.

First we need to READ(GET). Then, 'Use as Request' button and then use HTTP Method 'DELETE' to set flag for deletion.

13.jpg

In my next blog Custom Gateway service with CRUD Operations and Android application through Eclipse Part 3 I will discuss how to create Android application in Eclipse using our service.

Custom Gateway service with CRUD Operations and Android application through Eclipse Part 1

$
0
0

In my previous blog Steps to create custom Gateway service and Android application through Eclipse with GWPA Part 1, I was discussing about getting PO data without CRUD operations and any filter conditions. In this blog I will explain all CRUD operations and how to build an android app based on input values. Before starting, I am expecting that you have basic idea of gateway service or you have gone through my previous blog.

 

Below are the steps we will discuss in this blog.

1. RFC function module with PO Number,Creation Date & PO Release indicator as input parameters.

2. Create service in Gateway system with all the CRUD operations.(Create Read Update Delete)

3. Test our service in 'Service Explorer'.

4. Create Application in Exclipse and test it on Simulator.

 

1. Create a custom RFC Function Module to get PO header and item details. ( Developed in Backend system)

In this FM we have option to pass PO number & Creation date range. I am using custom FM for Read & Query operations only as there is no standard FM to get PO data with input as PO number Range or Date range.

A.  FM: ZBAPI_PO_GETLIST to Read & Query Operations

B.  FM: BAPI_PO_CREATE1 to Create.

C.  FM: BAPI_PO_CHANGE to Delete & Update Operations

FM1.jpg

FM2.jpg

You can get sample code in the attached file.

 

2. Create service in Gateway system with all the CRUD operations.(Create Read Update Delete)

Goto SEGW:

1.jpg

Import Entity type from Data Source

2.jpg

Entity Type for PO

3.jpg

Entity Type for POItems

4.jpg

Create Entity sets, Association and Activate it.

5.jpg

Map data source for READ

6.jpg

7.jpg

8.jpg

Similarly do it for Query , update & delete operations

9.jpg

10.jpg

11.jpg

Similarly map data sorce for POItemSet for Read & Query also

13.jpg

Goto Transaction: /IWFND/MAINT_SERVICE

Select service and add to list

14.jpg

Select service and explore service:

15.jpg

2.jpg

3.jpg

In my next blog Custom Gateway service with CRUD Operations and Android application through Eclipse Part 2 I will explain various combinations of filter conditions and how to test CRUD operations.

eCATT based Test Automation for ODATA Services available

$
0
0

How to test OData services in SAP NetWeaver Gateway is of great interest for our customers.

 

For testing OData services in SAP NetWeaver Gateway SAP has provided the SAP NetWeaver Gateway Client that can be started using transaction /IWFND/GW_CLIENT. The Gateway Client is a built in REST client that allows to store test cases and run one or more stored test cases in a sequential order. This way it is for example possible to test the CRUD methods of an OData service by creating an object, querying the object, updating the object and finially deleting it.

 

Customers have however requested that SAP would also offer support for performing tests using  Extended Computer Aided Test Tool (eCATT) . eCATT is used by customers frequently to create and execute functional tests. Its primary aim is the automatic testing of SAP business processes. Each test generates a detailed log that documents the test process and results.

 

Though this functionality has not been added to the standard delivery of SAP NetWeaver Gateway our development team decided to publish the
Gateway Test APIs as aproject on Code Exchangein SCN so that it can be leveraged by our customers.

 

With the availability of Gateway Test APIs customer requests can be satisfied to enable eCATT based Test Automation for ODATA Services.

 

Any feedback to the functionality we posted is welcome .

 

Special thanks goes to my colleague Kranti Khilari for working hard on this.

 

Best Regards,

André

 

Links:

 

GITHUB: https://github.com/krantikhil/zsaplink-plugins-for-apis-enabling-test-automation-of-odata-services

Featured Code Exchange projects: http://scn.sap.com/docs/DOC-41875

Deploying SAP NetWeaver Gateway in mixed (7.40 and earlier) environments

$
0
0

With a growing number of customers deploying systems that are based on SAP NetWeaver 7.40 I am getting more often the question how to deploy SAP NetWeaver Gateway in system landscape because it is not clear which service pack of SAP NetWeaver Gateway 2.0 fits to which service pack of SAP NetWeaver 7.40 where Gateway is part of the Basis.

 

While I have discussed the question of deployment options in my blog SAP NetWeaver Gateway deployment options in a nutshell this blog so far did not answer the question which service pack of SAP NetWeaver Gateway 2.0 should be deployed in a SAP Business Suite backend system if the SAP NetWeaver Gateway server is for example running on SAP NetWeaver 7.40 SP4.

 

To answer this question now and in the future we have published SAP Note 1942072 - SAP NetWeaver Gateway 2.0 Support Package Stack
Definition
which describe which SP level on 7.40 is equivalent to which SP level of SAP NetWeaver Gateway 2.0 running on a release prior to 7.31.

 

To answer the question raised above :

 

... the customer should choose IW_BEP 200 SP07 if the hub runs on top of 7.40 SP04.

 

Best Regards,

Andre

Your Solution for the error „No implementation environments“ in GWPA

$
0
0

YOUR INTRO

 

You’ve opened this page because you’re wondering about an error message in the "Service Implementation Wizard" after upgrading GWPA.

 

 

YOUR PROBLEM

 

You’ve installed GWPA (SAP NetWeaver Gateway Productivity Accelerator) version 1 from update site [1].

You’ve recently learned that SP 01 is available for GWPA.

You’ve thought: "Cool" – or anything similar.

You’ve either

a) performed "Check for Updates" manually within Eclipse (see below)

or

b) configured Eclipse to "automatically find new updates" (see below).

You’ve upgraded your GWPA to SP 01.

You’ve started the "New"-Wizard.

You’ve expanded the Category "OData Development".

You’ve realized that there’s a new wizard available: "Service Implementation Project".

 

OdataWizards.JPG

 

You’ve thought: "Cool, there’s something new – let’s try it…" (or similar).

You’ve clicked it.

You’ve received an error message:

 

No implementation environments. Either install an environment or create an environment

as described in the Help Content--> Extensibility--> Implementing a New Environment.

 

You’ve stared at it.

WizardError.JPG

 

You’ve read it.

You’ve tried to understand it.

You’ve thought: "upps…" … or anything less polite…;-)

You’ve searched for a solution.

You’ve found it – here it is:

 

 

YOUR SOLUTION

 

You should "install an environment".

You should go to "Help -> Install New Software" and select the GWPA-updatesite in order to "Work with".

You should mark the check box next to "Toolkit for Integration Gateway".

 

Install.jpg

 

You should step through the wizard and restart Eclipse.

You should be able now to see the enabled "Service Implementation Wizard":

 

WizardFixed.JPG

 

You should enjoy;-)

 

 

YOUR APPENDIX

 

a) How to check if updates are available for your Eclipse

 

Within Eclipse main menu, go to "Help" and press "Check for Updates".

CheckUpdates.jpg

 

This will contact all update sites which are configured in  Eclipse and check if newer versions are available.

 

 

b) How to configure Eclipse to automatically find updates

 

Within Eclipse main menu, go to "Windows -> Preferences".

On the left panel, expand the node "Install/Update" and select "Automatic Updates".

On the right panel, mark the checkbox "Automatically find new updates".

 

AutomaticUpdates.jpg

 

 

 

YOUR LINKS

 

[1] GWPA installation: https://tools.hana.ondemand.com/#gateway

[2] GWPA update site to be entered in Eclipse: https://tools.hana.ondemand.com/juno

[3] GWPA introduction: http://scn.sap.com/community/netweaver-gateway/blog/2013/05/10/new-gateway-tool--sap-netweaver-gateway-productivity-accelerator

[4] GWPA introduction: http://scn.sap.com/community/netweaver-gateway/blog/2013/06/03/gateway-productivity-accelerator-10-launched

 

 

 

Yours... Carlos

Design Time: How to Compose Multiple OData Services using SAP NetWeaver Gateway

$
0
0

As I could not find any writing on Composition feature of Gateway(available since SP05) where two/multiple services can be composed into one, here it goes...

 

Consider a scenario where you have two independent OData services(say, Sales Order and Business Partner). The two can be connected (associated) to see Business Partner details of a Sales Order. This can be achieved using the functionality Include->OData Service(GW) available in SEGW Data Model of SAP NetWeaver Gateway (SP05 and above).

 

          Here you would have option either to

               1) Compose current service(in a project) with one or multiple services in a) Current System  OR   b) External System.

                                                            OR

               2) Compose 2 independently existing services(in Current/External systems) into a new service(project)

 

Lets consider the case 1) variance b) where we compose current service(in a project) with one service in External system.

 

Through this writeup I will also mention the difference in behaviour with the Current System case.

Assumption is that Sales Orders and Business Orders OData services are generated and registered out of service builder(SEGW) in two different systems.

 

  • Open the corresponding Sales Orders project and go to edit mode using the pencil toolbar button.

 

  • On the Data Model right click and invoke Include->OData Service(GW)

          compose_service2.jpg

  • Select the Service in External System option. This makes the RFC Destination text field editable.

include1.jpg

 

  • Using the F4 provided, chose the required RFC destination of the system where Business Orders service resides.

        Use the F4 help to select the Technical Service Name and Version and chose to continue using the tick.

 

compose_service3.jpg

  • Once an external service is included, a Model Reference entry gets added into the Data Model with Model Reference Type: Include

    include_serv1.jpg

 

  • Next step is to associate the two models. Go to Associations Folder in the Data Model, add an entry. Give it a name.

 

  • Now create an External Association called so as this is between two entities of 2 different services.

        Click on the Ext Assoc button to invoke the Creation of External Association.

 

  • Choose the option External from the drop down of Association Type.

           Once External is chosen, since the project now has only one included model, the dependent Model Reference gets proposed since there is only one service is included in the project, else this has to be filled using F4 help.

           The proposal given can be over ridden anyways!

 

     ext_assoc1.jpg

 

          In case where 2 or more services(from Current/External systems) are included, and your design requires you to associate entities of the included services, the Dependent and Principal model references can be chosen via F4 helps provided.

 

 

               The RFC destination for Metadata field becomes available when we have included Service in Current System. This is a special case where the     Metadata exists in an external system and the service is generated in the current system. A typical example for this would be an integration case where SPI's ABBID exists in another system and the OData service is generated in the current system. For more information on SPI integration please refer the blog SPI Integration with GW by Ashish Kumar and Harish

 

  • Next step is to continue using the tick available. As a result, it shows the Ext Assoc button enabled with a tick indicating External Association is created.

         EXT_ASS2.png

  • Now, use the F4 of Prinicipal Entity to chose the Sales Order entity.

 

The F4 provided on the Dependent Entity doesn't fetch entities of the service as the Model included is via Service in External System. This is because of a technical limitation. This means to say, one has to know the entity name of the service and enter it manually.

 

Where as in case of Model included via Service in Current System this F4 would list the entities, and you can select the required entity.

 

  • Enter the Dependent Entity name manually.

 

       EXT_ASS2.jpg

 

  • Go ahead and fill in the cardinalities as well like shown in the screenshot above.

        Now a composed project is ready for generation of an OData service.

 

  • Use Generate Runtime Objects button in the toolbar to generate artifacts like the service, model and classes.

 

  • Register using the Service Maintenance feature.

 

  • Click on Maintain toolbar button which leads to GW client OR T Code: /IWFND/GW_CLIENT to check the service doc.

        It looks like in the screenshot below

      serv_doc.jpg

          This brings to a closure of phase 1, where the service document has collections/entitysets of both services composed into ONE

 

Thanks for going through the blog and any feedback would be most welcome !

Would be linking this to another blog on the Run Time soon... so, please stay tuned...

 

Thanks,

Rashmi

Redefining a Gateway Service to enable Delta Query Support

$
0
0

After finally upgrading Gateway to SP07, I decided to look into the new Delta Query Support functionality. I found a really great document written by Andre Fischer, How to Implement Basic Delta Query Support in SAP Netweaver Gateway, which gave me all the direction I needed. I recommend reading it to get a better understanding of Delta Query Support and the different techniques.

 

As I am currently working on incorporating offline OData support using the new OData SDK’s included in the SMP 3.0 SDK, I needed to add in Delta Query Support to my Gateway Service. However, in my case the service I am consuming is a standard service, namely WFSERVICE (Workflow Service).

 

The technique and code I applied to get this working with WFSERVICE can be applied to any service.

 

Follow the following steps to redefine and add Delta Query Support:

 

 

Step 1

 

Create a new Gateway Project in transaction SEGW

1.PNG

2.PNG

 

 

Step 2

 

Right click on the Data Model under your new project and go to Redefine->OData Service GW

3.PNG



Step 3


Select the service you would like to redefine and click Next

4.PNG



Step 4

 

Select the entities and associations you would like to redefine. Although in this case I am only going to add the Delta Query Support to the WorkflowTaskCollection entity set which uses the WorkflowTask entity, it seems to error when I don't include all the associated entities.

5.PNG

6.PNG

 

 

Step 5

 

Generate Runtime by right clicking on the project and selecting Generate Runtime.

7.PNG

 

Give the Technical Service a new name

8.PNG

 

 

 

Step 6

 

Now we need to redefine the GET_ENTITYSET and GET_ENTITYSET_DELTA methods for the Entity Collection.

 

Start by right clicking the GetEntitySet of the Service Implementation for WorkflowTaskCollection and click on Go to ABAP Workbench

9.PNG

 

 

In the ABAP Workbench, we need to redefine both GET_ENTITYSET and GET_ENTITYSET_DELTA methods.

10.PNG

 

Once both methods have been redefined, go into their Redefinitions and paste the following code:

 

 


METHOD /iwbep/if_mgw_appl_srv_runtime~get_entityset.
DATA: lo_dp_facade   TYPE REF TO /iwbep/if_mgw_dp_facade.

DATA: lv_delta_token TYPE        string.

FIELD-SYMBOLS:
      <fs_entityset>
TYPE ANY TABLE.

TRY.
     
CALL METHOD super->/iwbep/if_mgw_appl_srv_runtime~get_entityset
          
EXPORTING
                iv_entity_name          
= iv_entity_name
                iv_entity_set_name      
= iv_entity_set_name
                iv_source_name          
= iv_source_name
                it_filter_select_options
= it_filter_select_options
                it_order                
= it_order
                is_paging               
= is_paging
                it_navigation_path      
= it_navigation_path
                it_key_tab              
= it_key_tab
                iv_filter_string        
= iv_filter_string
                iv_search_string        
= iv_search_string
                io_tech_request_context 
= io_tech_request_context
          
IMPORTING
                er_entityset            
= er_entityset
                es_response_context     
= es_response_context.


* get the data provider facade
     
TRY.
           lo_dp_facade
= /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).
     
CATCH /iwbep/cx_mgw_tech_exception.
          
RAISE EXCEPTION TYPE /iwbep/cx_mgw_tech_exception.
     
ENDTRY.


ASSIGN er_entityset->* TO <fs_entityset>.

* call the delta token functionality
     
TRY.
          
CALL METHOD /iwbep/cl_query_result_log=>create_update_log_entry_hash
               
EXPORTING
                     io_tech_request_context 
= io_tech_request_context
                     io_dp_facade            
= lo_dp_facade
                     ir_service_document_name
= mr_service_document_name
                     ir_service_version      
= mr_service_version
                     it_entityset            
= <fs_entityset>
               
CHANGING
                     ev_delta_token          
= lv_delta_token.

           es_response_context
-deltatoken = lv_delta_token.

     
CATCH /iwbep/cx_qrl_locked.
          
RAISE EXCEPTION TYPE /iwbep/cx_qrl_locked.
     
CATCH /iwbep/cx_qrl_delta_unavailabl.
          
RAISE EXCEPTION TYPE /iwbep/cx_qrl_delta_unavailabl.
     
ENDTRY.

     
CATCH /iwbep/cx_mgw_busi_exception .
     
CATCH /iwbep/cx_mgw_tech_exception .
ENDTRY.


ENDMETHOD.




and....

 

 

 

METHOD /iwbep/if_mgw_appl_srv_runtime~get_entityset_delta.
DATA: lo_dp_facade           TYPE REF TO /iwbep/if_mgw_dp_facade.

DATA: lv_delta_token         TYPE        string.

FIELD-SYMBOLS:
      <fs_entityset>         TYPE ANY TABLE,
      <fs_deleted_entityset>
TYPE ANY TABLE.

TRY.
     
CALL METHOD super->/iwbep/if_mgw_appl_srv_runtime~get_entityset_delta
          
EXPORTING
                io_tech_request_context
= io_tech_request_context
          
IMPORTING
                er_entityset           
= er_entityset
                er_deleted_entityset   
= er_deleted_entityset
                es_response_context    
= es_response_context.

     
ASSIGN er_entityset->* TO <fs_entityset>.

     
IF er_deleted_entityset IS NOT BOUND.
          
CREATE DATA er_deleted_entityset LIKE <fs_entityset>.
     
ENDIF.

     
ASSIGN er_deleted_entityset->* TO <fs_deleted_entityset>.


* get the data provider facade
     
TRY.
           lo_dp_facade
= /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).
     
CATCH /iwbep/cx_mgw_tech_exception.
          
RAISE EXCEPTION TYPE /iwbep/cx_mgw_tech_exception.
     
ENDTRY.

*  call the delta token functionality
     
TRY.
          
CALL METHOD /iwbep/cl_query_result_log=>create_update_log_entry_hash
               
EXPORTING
                     io_tech_request_context 
= io_tech_request_context
                     io_dp_facade            
= lo_dp_facade
                     ir_service_document_name
= mr_service_document_name
                     ir_service_version      
= mr_service_version
                     it_entityset            
= <fs_entityset>
               
IMPORTING
                     et_deleted_entityset    
= <fs_deleted_entityset>
                     et_entityset            
= <fs_entityset>
               
CHANGING
                     ev_delta_token          
= lv_delta_token.


           es_response_context
-deltatoken = lv_delta_token.

     
CATCH /iwbep/cx_qrl_locked.
          
RAISE EXCEPTION TYPE /iwbep/cx_qrl_locked.
            CATCH /iwbep/cx_qrl_delta_unavailabl.
          
RAISE EXCEPTION TYPE /iwbep/cx_qrl_delta_unavailabl.
     
ENDTRY.

CATCH /iwbep/cx_mgw_busi_exception .
CATCH /iwbep/cx_mgw_tech_exception .
ENDTRY.

ENDMETHOD
.



 

 

Step 7

 

Add the new service in transaction /IWFND/MAINT_SERVICE

 

11.PNG

12.PNG

 

Click on ZWFSERVICE to add it

13.PNG

 

 

Step 8

 

Run the service in a browser via its URL: http://my.domain.com:8200/sap/opu/odata/sap/ZWFSERVICE/WorkflowTaskCollection

 

The difference you will notice is that there is the following additional tag at the second last line of the response:

 

<linkrel="delta"href="WorkflowTaskCollection?!deltatoken='22000AB22B051EE397AFF3B8EE42B356_20131205073405'"/>

 

Now on subsequent calls you will use the new delta token retrieved from the latest response to make sure that only new/updated and deleted entries are returned like follows: http://my.domain.com:8200/sap/opu/odata/sap/ZWFSERVICE/WorkflowTaskCollection?!deltatoken='22000AB22B051EE397AFF3B8EE42B356_20131205073405'

 

In the case where an entry has been deleted since the last service call and in the case of Workflow, when a work item has been approved and is no longer in the approvers worklist, the following will appear in the response:

 

<at:deleted-entryref="http://my.domain.com:8200/sap/opu/odata/sap/ZWFSERVICE/WorkflowTaskCollection('000001224760')"when="2013-12-05T07:33:41Z"/>



 

And that is all you need to do from the backend side, the rest would be handled on the client side.


SAP mass update via Excel made easy - Gateway productivity accelerator for Microsoft

$
0
0

Gateway productivity accelerator for Microsoft -- Service Pack 01


What is the first thing that comes to your mind when you have to work with lots of data? When you need not only to update one entry, but ten or hundred?

 

Most likely you will think of Microsoft Excel. In the past, what you probably did was dump the data from your SAP system into an Excel sheet, work on the data from there and then somehow try to import this data back into your SAP system.

 

The process to do this has quite a few limitation:

  • as soon as you dump the data into Excel -- it is decoupled. All of a sudden you have two data sources to work on. The real, live data in your SAP system and an outdated snapshot in your Excel.
  • Now you need to work on the data and you know that for some properties only certain values are allowed. Well, so you have to go back to the SAP system and check what are these allowed values (lets say for simplicity the allowed Country Codes). Only then can you go back to your Excel and can continue to work on the data -- and hope that you have no typos
  • You might have data / time fields (or some other defined data-types). Well, the problem is that when dumping your data into Excel all these data-types are lost. So you have to remind yourself, that you really keep track on what data goes where
  • And finally -- after you have updated all the data in Excel -- you are ready to import the data back into SAP. The only problem is, that you do not know if someone else also updated the data in the meantime. So your import might overwrite whatever has been already updated...

 

You can see that a process which seems to be quite simple can be extremely complicated once you decouple data from the original datasource.

 

This is exactly what we are addressing in the latest Service Pack 01 for Gateway productivity accelerator for Microsoft.


As you probably have read we released Gateway productivity accelerator for Microsoft about a month ago. The response that we got was simply amazing.


Unlike the previous integration in Visual Studio which comes with great templates for Outlook, SP01 focuses on an end-user story for Microsoft Excel. End-users can use the Gateway productivity accelerator for Microsoft Excel add-on to easily bind their Excel sheets to an existing OData service.


Excel-Config.png


Now this Excel sheet/"template" can be shared with end-users who have no idea about OData services, NetWeaver Gateway systems or SAP backend  systems. They can simply open up the Excel file and interact with SAP.

Updates can be made directly from within Excel. Data can be refreshed anytime to see new changes in the backend system. Value help information in the SAP system can be made available as drop-downs in Excel and a conflict resolution can help the end-user to easily identify updates that were made by other users while the data was stored in the Excel sheet.


Excel-GWPAM-FeaturesHighlights.png

 

This latest Service Pack brings the power of Gateway productivity accelerator for Microsoft to Microsoft Excel. Now updating data from Excel is extremely simple and only requires the knowledge how to use Excel. Of course all the communication can be done via in an enterprise ready way, via a secure channel (e.g. HTTPS) and the users can be authenticated via Single Sign On, so that all corporate auditing and tracing functionalities are kept in place.

 

 

 

Scenarios range from mass data updates (e.g. updating your bank information with the new SEPA information like most of us in Europe currently experienced), maintaining your timesheet once a week / month in Excel (e.g. like several customers in consulting or employess on off-shore installations in the Oil & Gas industries), verifying and working on purchase orders before they are getting released or simply keeping track of OSS notes that have to be implemented across your SAP system landscape)

 

Excel-Examples.png

 

Even though we only released SP01 today we already have quite a few requirements from SAP internal stakeholders/colleagues to work with the Gateway productivity accelerator for Microsoft Excel add-in. I am sure you will also find lots of usecases that can make your life easier to work with data.


Go ahead and download it from the service marketplace, at http://service.sap.com/patches -> Support Packages and Patches - G" GWPAM" GWPAM 1.0 -> GWPAM EXCEL ADD ON 1.0

Build a SAPUI5 app with the AppBuilder consuming a NW Gateway service - series 1 of 2

$
0
0

A couple of weeks we held a spotgroup (knowledge sharing session) in the company I work for. It was one of the most busy NetWeaver spotgroups handons sessions ever. We literally had to extend the room!

 

Handson

 

Together with a couple of colleagues we organised a handson session to get aquanted with NetWeaver Gateway and consuming those services. For you all to enjoy I decided to simplify and shorten the exercises a bit and share it here. In 2 blogs we will create a NetWeaver Gateway service and consume the service in a SAPUI5 app, using the just released appBuilder. It assumes no handson knowledge on NetWeaver Gateway and SAPUI5 at all, and it is a first step to get aquanted with the topics.

 

Still interested? sure you are, good! Let's start;

 

NetWeaver Gateway

 

NetWeaver Gateway enables us to perform CRUD operations on data from our SAP system via OData.

 

The BAPI we will expose as a service is:

 

0_bapi_sflight.JPG

Note: To perform this steps a NetWeaver Gateway system is required, if you do not have it at your disposal, the ES workplace demo services can be used as service. In the 2nd blog you could then consume those services in a mobile app.

 


Create project

 

To start building our service, we need to create a project in the NetWeaver Gateway service builder.

Open the gateway service builder by starting the transaction 'segw' in your gateway system. Use the create button to create a new project (The package 'ZSCN' was created before).

1_segw create project.JPG

Create entity

 

After creation of the project we define our entity. There are various ways to create an entity, we choose to base it on an BAPI

Right click on data model and pick 'import RFC/BOR interface'.

Define the entity name and the BAPI:

BAPI_FLIGHT_GETLIST

3_ create entity.JPG

Select the 'FLIGHT_LIST' as data source parameters

3_ create entity step2.JPG

Configure the AIRLINEID and CONNECTID as key.

3_ create entity step3.JPG

The following message should appear;

3_create entity_step succes.JPG

 

We could use the import parameters of the BAPI as filter option, so let's setup the Airlineid as 'filterable'. See below:

 

4 - set filterable.JPG

Since the entity name is taken from our BAPI parameters naming, we like to rename it to FLIGHT.

5_rename entity.JPG

Create entityset

 

Based on our entity we want to create an entitySet

6 create entitySet.JPG


Service implementation

 

Move down in your project to the entry 'service implementation'. We would like to create a getEntitySet query which will give us a list of flights.

Use right mouse button and  'create mapping' to start performing the mapping of our entityset to a BAPI.

7 move to getentityset implementation- right mouse button create mapping.JPG

Choose the BAPI you would like to map.

Note: the BAPI we selected in the beginning was just the definition of our entity, it did not call or expose any BAPI yet. We will do that now.

8. choose the bapi for mapping.JPG

Use propose mapping to perform a default export mapping for your BAPI.

9. propose mapping - should fill all fields.JPG

 

Click the '+' to add another entity set property.

Pick Airlineid again, as property.

10.add field again to mapping with plus sign.JPG

Map it to the Airlineid input parameter of the BAPI.

 

11. airline id map to input parameter of bapi by selecting and okay.JPG

 

This will give us later on the possibility to filter the list of flights based on airlineid.

 

The end result of the mapping should be like this:

12 end result mapping.JPG

 

Generate

 

Since mapping is done, we basically ready to generate, yes generate our service implementation.

We need to the magic button on top to start this proces.

 

13. generate!.JPG

 

When generation is finished, classes should be generated.

14. messages log after generate - succes!.JPG


Register

 

Only thing left is to register our service;

 

Scroll fully down in your project in the left pane and go to service maintenance. In this menu you should see at least your own gateway service registered and probably others. Open up your own system to register the just created service on this gateway stack.

After opening your system go to the right pane and in top bar, use 'register' to register your service.

 

15. register service - via register service button in service maintenance menu in tree.JPG

During registration we select 'LOCAL' as our system, where we would like to register our service.

After registration our service registration list should show a succesfull registration;16. click on maintain service to see the service registry and to be able to test.JPG

 

Test results

 

Click on maintain to open 'service maintenance'.

A new transaction (/IWFND/MAINT_SERVICE) opens, in here we can normally see all registered service, in this case we only see our service, since we navigated starting from our project.

See the bottom left pane, we can decide to test our service in the browser or in the system itself via the build-in gateway client.

Let's open the gateway client.

 

17. start GW client.JPG

A similar URL will appear when you start gateway client. Click on execute to see what happens, and if your service can actually be reached;

18 gw client - start.JPG

To retrieve the list of flights, fill in a similar url as below;

19. change url to this and see result.JPG

The result will show the list with flights as follows in atom-xml format;

20. service all flights result.JPG

 

Since we also setup a filter in our service we can see the result of this call as well. We need to add the $filter to the url, in this case filter the list on field Airlineid, which must be equal to LH. (Lufthansa).

21. use filter url.JPG

See an example result below;

22 check filtered result.JPG

 

Closure

 

Congratulations! You've succesfully build a simple service using SAP NetWeaver Gateway, please continue to step 2, to build an app with SAPUI5 in the appbuilder  consuming the list with flights.

 

Hope you enjoyed part 1 of this blog series, see you at part 2.

Build a SAPUI5 app with the AppBuilder consuming a NW Gateway service - series 2 of 2

$
0
0

Thanks for moving on to the 2nd blog in this series. For those just joined; this blog is the second in a serie of 2. The first can be found here. In the first blog we build a NetWeaver Gateway service exposing flight data.

In this 2nd part we will consume this data in a mobile app. We will build this app with the just released appBuilder. A WYSIWYG editor which is one of the ways to build a SAPUI5 application. The first time I saw the AppBuilder in a real live demo was when it was presented and demo-ed by Roel van den Berge on the SAP Inside Track Netherlands 2013.

 

Of course there are also other ways to build a SAPUI5 app. Since this blog assumes no handson experience yet with SAPUI5 or NetWeaver Gateway. The appBuilder is an easy way to get aquanted with the topic.

 

Install appBuilder

 

No need to repeat, it is all explained here; Installation is real easy. Basically it means; install node.js and download and run the appbuilder.

The editor runs in your browser.

 

Create project

 

Start the appbuilder, and it will open a url similar to this in your browser:


startscherm.JPG

A start screen will appear with several test apps and also the option to create a new project.

 

Create a new project for a tablet;

 

2. create project.JPG

 

After creating the project in the appbuilder, you will see an empty ipad screen.

Before we can show data on here we need to define the datasource.

 

Define datasource

 

To consume data we need to define the OData service from part 1 of this blog series as a datasource;

 

Open the pane on the left to view datasources. Use the 'new datasource' button to add a new one.

 

Use the full url to your service (without filter or collection).

Note:This is service we tested in the gateway client in blog series 1. To get the full url including hostname, go to your gatewaysystem and use /iwnfd/maint-service and use 'call in browser' to get the full url to your service.

 

Example

http://<NetWeaver GatewaySystemHost>:<Port>/sap/opu/odata/sap/ZSCN_FLIGHTDEMO_SRV

 

4a create datasource odataservice.jpg

 

Define superlist metadata

 

To show the list of flight on the screen we need to connect our datasource to a superlist. The first step for a superlist is to define the superlist metafile.

Create it via the 'designers' menu on top.

 

5.JPG

 

6 create superlist.JPG

 

A superlist .slmeta file is added into our project, it can be further configured by checking the right pane and click on datastructure.

7. open datastructure in right panel.JPG

 

We need to select the datasource first, this is our ODataService flight with in there, the FlightSet.

 

8 select datasource.JPG

Select and add columns

 

Select the columns which you would like to add to your list view.

Select them by choosing the 'label' control for those columns, leave the others to 'none'.

Do pick 'label' for: curr/ price/ deptime/ cityto / cityfrom / flightdate / airline

 

select fields.png

 

After clicking confirm,view the right pane and set the alignment to 'horizontal' instead of 'vertical'

10 set alignmetn to horizontal.JPG

 

In the middle of the browser screen we see the layout of the future listscreen

Select the flightdate column and view its properties in the right pane.

Set it to these values;

 

11 reorder columns and click per field example for flightdate.JPG

Reorder the columns (by drag and drop on the screen) to the following order. And also set the width on the other columns:

1) flightdateset 'flightdate' to dateformat: 'shortdate', width 12%

2) depttime to width 10%

3) airline to 12 %

4) cityfrom to 18%

5) city to 20%

6) price to 8%

7) curr to  4%

 

Hint: Since we already connected the data to the screen, you could already press preview to get an indication how your list will look showing flight data.

 

Add an image

 

Click on 'save' and 'return'.

This will return you the 'home' screen.

In left pane select 'project' and browse to the 'img' folder and select this.

In the 'file' menu upload a picture to show along the flightlist.

12 upload image.JPG

Again in the project in the left pane, browse through our files and select the flightlist.slmeta and open it.

 

In the left pane select the image icon, and drag it onto the superlist table and position it as it is the most left column.

 

12b add img tag ontolist.JPG

 

Select the image when it is dropped onto the screen and view its properties in the right pane.

 

Click the button at the 'src' property and in here set the path to your image in the \img folder.

 

13 set image to image on slmeta.JPG

Set the 'width' of the image to 3%

 

 

We can preview the data now including our image. It will look like this;

 

14 preview slmeta incl image.JPG

 

 

The superlist meta definition is fully done now. 'Save' and press 'return' to move back to the home screen.

 

Add the list to the homepage

 

Check in the project on the left and browse to the 'view' folder and make sure the HomePage.view.html screen is currently opened (blue).

14b move back to homescreen.JPG

 

In the toolbox menu select the superlist icon and drag it onto the homescreen. Adjust the size to the surround screen.

 

15 in the toolbox, add a superlist to the home screen by dragging.jpg


View the superlist element properties in the right pane and click on the select metafile.

Select your flightlist.slmeta file and use confirm.

 

16 in the right pane, view the superlist properties and select the metafile by clicking and choosing your flightlist-meta. jpg.JPG

 

The page will refresh now and it will show the flightlist on the homescreen.

 

Test

 

Click on 'run' in the top right of the window.

It will open in a new browser window and give you the ability to view portrait or landscape mode and zoom in or out.

 

The result will look like this:

 

end result.png

 

Closure

 

Congratulations (again) on succesfully completing these steps! Thanks for reading until the end of this blog. Thanks for joining this blog series,

 

Stay tuned for more on SAPUI5 and NetWeaver Gateway.

 

Shout out to Twan van den Broek Yes, scrollable it is.

SAP CodeJam in Frankfurt

$
0
0

The event


Today we had a successful SAP CodeJam in Frankfurt showing the End-2-End process of OData Service Development using SAP NetWeaver Gateway and the development of an SAPUI5 consumer application.

 

From 29 registered participants we were able to welcome 24 at our location.

 

This means that more than 85% showed up which I found very impressive.

 

A big thank you from our side to the participants for taking the time.

 

WP_20131209_006.jpg

 

The location


The location that has been organized and sponsored by our partner iProCon was nicely located in the city center of Frankfurt in walking distance from the main station. The meeting room was in the  ecos office center. From here we had a nice view on the skyline of Frankfurt.

 

WP_20131209_013.jpg


Big Thank you goes especially to Christian Buckowitz from iProCon for driving this event and Christian Brauckmueller for his support and promotion.

 

Getting your hands dirty ...


Christoph Kraemer and I started with two short presentations about SAP NetWeaver Gateway and SAPUI5 that were both followed by a hands-on part where we developed a small OData sample service based on SAP’s EPM demo model as described in the following how-to-guides How to write a simple SAPUI5 application leveraging the SAPUI5 Theme Editor and How to Develop a Gateway Service using Code based Implementation .

 

After approx. one hour we continued with a Q&A session covering various topics around SAP NetWeaver Gateway and SAPUI5.


Now it was time to code. Here we were able to leverage a SAP NetWeaver Gateway demo system in the cloud that had been provided by the product group of SAP Netweaver Gateway. As you can see the participants had intense discussions.

WP_20131209_009.jpg


Coding was only stopped for having some good sandwiches. That gave us some time for additional discussions. Unfortunately I was too late to take pictures from the buffet …

WP_20131209_008.jpg

 

We saw a lot of working services and SAPUI5 applications at the end of the day. From what I saw, the participants seemed to be satisfied with what they were able to learn and to try out by getting their hands dirty.

 

What's next ?


So I am looking forward to many upcoming successful customer and partner projects leveraging SAP NetWeavaer Gateway and SAPUI5.


And I am looking forward to the next upcoming SAP CodeJam in Antwerpen, Belgium which will be hosted by our partner Flexso.

Day 1 highlights from TechEd Bangalore

$
0
0

Day 1: SAP Netweaver Gateway at Teched Bangalore 2013

 

Here is a list of sessions for tomorrow:

 

Session ID

Session Type

H

Title

Track

Speakers

Session Date/Time/Location

CD107

Lecture

1 h

SAP NetWeaver Gateway - On-Premise and in the Cloud

Custom Development

Sudeesh K

Thu, 12/12  3:45p-4:45p Lounge 2

CD204

Lecture

2 h

Develop an E2E scenario with ABAP on HANA, SAP NetWeaver Gateway and SAPUI5

Custom Development

Sreeharsha R

Thu, 12/12  1:15p-3:15p

Lounge 2

CD802

Roadmap / Q&A

1 h

Road Map Q&A: SAP NetWeaver Gateway - On-Premise and in the Cloud

Custom Development

Sudeesh K

Thu, 12/12   9a-10a

Show Floor (both sessions)

CD263

Hands On

4 h

ABAP on SAP HANA - Building an End-to-End App from HANA via ABAP to SAP UI5

Custom Development

Vishnu Prasad Hegde, Vaibhav Kumar, Prakash Kamaraj

Thu, 12/12   9a-1p, HO1

CD265

Hands On

4 h

End-2-End Developer Experience with SAP HANA Cloud Platform and SAPUI5

Custom Development

Rui Nogueira, Ankur Kumar, Stephen Cherian

Thu, 12/12   9a-1p, HO5

 

Session ID

Title

Session owner

Session Date/Time/Location

SPK10486

SAP NetWeaver Gateway Services Development Insights

Balakrishna Gottipati

Thu, 12/12  4:30p-5p

Lounge 3

 

 

Hope to see you there!

Viewing all 253 articles
Browse latest View live




Latest Images