By now you know about SAP Gateway for Microsoft and how it can help to building solutions that bring SAP data to Microsoft Office. A prerequisite for building such a solution is the availability of a suitable OData service. Sometimes you will face the situation that such a service is not available but you would like to build a quick prototype of your Windows solution before investing time and energy into the development of an OData service.

 

Here is an idea:

With the help of the function module RFC_READ_TABLE you can build an OData service that can generically read any DDIC table. Such a service could be used by the GWM Excel Add-In or GWM Visual Studio Add-In to build quick prototypes.

 

Here a screenshot of the Company Code table (T001) when testing function module RFC_READ_TABLE:

GenericTableReader4.jpg

As can be seen in this screenshot, the output of RFC_READ_TABLE isn’t perfect for consumption in an OData service. In this blog I will briefly explain how to utilize this function module and wrap it in a way to make it more suitable so you can finally do something like this:

 

Example: Reading Company Code table (T001) via generic table reader OData service from GWM Excel Add-In:

GenericTableReader1.jpg

Example: Reading Plants table (T001W) via generic table reader OData service from the GWM Excel Add-In:

GenericTableReader2.jpg

Important Information about RFC_READ_TABLE

Please read note 382318 (FAQ|Function module RFC_READ_TABLE) before you continue. It states “Avoid to use the external generic table access (with function module RFC_READ_TABLE) in your solutions. The function is not meant to be publicly used.”

 

Some other points to consider about RFC_READ_TABLE:

It will only facilitate the READ operation (no CREATE, UDATE or DELETE). It can’t read all tables under the sun - some work and some don’t. Especially tables that are wider than 512 characters are not supported. Also the function module can’t directly be used in the SAP Gateway Service Builder (SEGW). It will need to be wrapped in another function module to make it suitable for Service Builder. The error handling needs to be improved to meet the Service Builder requirements. And finally the return structure is quite unsuitable as each table entry is returned as a long string.

 

 

If you are cool with that, then please continue reading. Otherwise please disconnect at this time. ;-)

 

Here a high-level outline of the tasks:

  • Create a generic DDIC structure that will be used as return table
  • Create a new wrapper function module
  • Create a new OData Service
  • Consuming OData Service from GWM Excel Add-In or .NET Application

 

To appreciate this blog you need to be familiar with the process on how to create OData services with SAP Gateway.

 

Create a generic DDIC structure that will be used as return table

I create a new DDIC structure in SE11 (with name ZDATA_FORMATTED), which will be used by the new function module to return the table entries. I am limiting the number of columns to 20. As for the data type I am using SYCHAR512, which will allow for 512 characters per column.

 

Note: The settings of this structure will have two implications for the OData service: 1) For tables that have more than 20 fields only the first 20 fields are returned and 2) any field value that is longer than 512 characters will be truncated.

 

GenericTableReader3.jpg

 

Create a new Wrapper Function Module

To speed up things, I copy the original RFC_READ_TABLE to my own function module (with name Z_READ_TABLE).

 

Now I adjust the interface of my function module starting with the Import tab. I removed some of the parameters and only retain these:

GenericTableReader13.jpg

On the Export tab I add parameter RETURN, which will be used to return error messages in a format that the Service Builder likes:

GenericTableReader5.jpg

On the Tables tab, here I set all existing parameters to Optional and then I add a new parameter DATA_FORMATTED of type ZDATA_FORMATTED (which I created earlier in the first step):

GenericTableReader6.jpg

I retain all the Exceptions that were copied from the original function module.

 

As for source code, I first delete all existing code and replace it with the following sample coding, which should give you an idea on how to wrap the original function module in a way to make it usable in the Service Builder:

Source Code Example

FUNCTION z_read_table.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(QUERY_TABLE) LIKE  DD02L-TABNAME
*"     VALUE(ROWCOUNT) LIKE  SOID-ACCNT DEFAULT 0
*"  EXPORTING
*"     VALUE(RETURN) TYPE  BAPIRET1
*"  TABLES
*"      OPTIONS STRUCTURE  RFC_DB_OPT OPTIONAL
*"      FIELDS STRUCTURE  RFC_DB_FLD OPTIONAL
*"      DATA STRUCTURE  TAB512 OPTIONAL
*"      DATA_FORMATTED STRUCTURE  ZDATA_FORMATTED
*"  EXCEPTIONS
*"      TABLE_NOT_AVAILABLE
*"      TABLE_WITHOUT_DATA
*"      OPTION_NOT_VALID
*"      FIELD_NOT_VALID
*"      NOT_AUTHORIZED
*"      DATA_BUFFER_EXCEEDED
*"----------------------------------------------------------------------
  DATA ls_data TYPE sychar512.
  DATA ls_data_formatted TYPE zdata_formatted.
  DATA lt_row TYPE TABLE OF sychar512.
  DATA ls_row TYPE sychar512.
  FIELD-SYMBOLS <wa> TYPE any.
  DATA lv_col_no TYPE i.
  DATA lv_message1 TYPE sy-msgv1.
  DATA lv_message2 TYPE sy-msgv1.
  DATA lv_message3 TYPE sy-msgv1.
  DATA lv_message4 TYPE sy-msgv1.

  TRANSLATE query_table TO UPPER CASE.
  CALL FUNCTION 'RFC_READ_TABLE'
    EXPORTING
      query_table          = query_table
      delimiter            = ';'
      rowcount             = rowcount
    TABLES
      options              = options
      fields               = fields
      data                 = data
    EXCEPTIONS
      table_not_available  = 1
      table_without_data   = 2
      option_not_valid     = 3
      field_not_valid      = 4
      not_authorized       = 5
      data_buffer_exceeded = 6
      OTHERS               = 7.
  IF sy-subrc <> 0.
    CASE sy-subrc.
      WHEN 1. lv_message1 = 'Table not available'.
      WHEN 2. lv_message1 = 'Table without data'.
      WHEN 3. lv_message1 = 'Option not valid'.
      WHEN 4. lv_message1 = 'Field not valid'.
      WHEN 5. lv_message1 = 'Not authorized'.
      WHEN 6. lv_message1 = 'Data buffer exceeded'.
      WHEN OTHERS. lv_message1 = 'An error occurred'.
    ENDCASE.
    CALL FUNCTION 'BALW_BAPIRETURN_GET1'
      EXPORTING
        type       = 'E'
        cl         = '01'
        number     = '319'
        par1       = lv_message1
        par2       = lv_message2
        par3       = lv_message3
        par4       = lv_message4
      IMPORTING
        bapireturn = return.
    EXIT.
  ENDIF.

  LOOP AT data INTO ls_data.
    SPLIT ls_data AT ';' INTO TABLE lt_row.
    CLEAR ls_data_formatted.
    ls_data_formatted-key_value = sy-tabix.
    lv_col_no = 1.
    LOOP AT lt_row INTO ls_row.
      lv_col_no = lv_col_no + 1.
      ASSIGN COMPONENT lv_col_no OF STRUCTURE ls_data_formatted TO <wa>.
      <wa> = ls_row.
    ENDLOOP.
    APPEND ls_data_formatted TO data_formatted.
  ENDLOOP.
ENDFUNCTION.

 

Based on this function module, now I create an OData service.

 

Create a new OData Service

In transaction SEGW I create a new project with name ZGWM_READ_TABLE. Then I create a new Entity Type with name TableEntry. The easiest way to do this is to use the Import -> RFC/BOR Interface feature. This screenshot shows my final list of properties:
GenericTableReader7.jpg

Optional: After the import, I make a couple of tweaks to the structure to facilitate the consumption of this OData service:

  • I set all attributes, with the exception of the KeyValue, to Nullable.
  • I introduce an additional property called TableNameFilter (Nullable and Filterable). I will use this parameter as a filter parameter.
  • I provide labels for each property to make them more easily identifiable.

Next I create an Entity Set for the Entity Type. Once the Entity Set exists, then I can do the mapping for the GetEntityset(Query) operation. I map to the newly created function module Z_READ_TABLE. I use the Propose Mapping feature. Now I only need to do one additional manual change. I add new entry for the mapping of the entity set property TableNameFilter to the data source parameter QUERY_TABLE.
GenericTableReader8.jpg
The Service Builder will automatically recognize that the data source parameter RETURN should be mapped for error/message handling. Additionally I have to flag data source parameter ROWCOUNT should be flagged as ‘Max Hits’.
GenericTableReader11.jpg
Now it is time to generate the OData service. Once successfully generated, I can now register it in (transaction /IWFND/MAINT_SERVICE).  Here a screenshot of my registered service:
GenericTableReader9.jpg

Consuming OData Service

Now I can consume this service from different consumption tools, like the GWM Visual Studio Add-In or GWM Excel Add-In. Via the filter parameter TableNameFilter I can specify which table should be queried. This allows me to read any table in the SAP System (provided that it is supported by the underlying function module RFC_READ_TABLE). When testing make sure to add the filter (otherwise the RFC will throw an error). The URL should look like this:
... /ZGWM_READ_TABLE_SRV/TableEntryCollection?$filter=TableNameFilter eq 'T001'


Here a simple example of using this OData service and GWM from a Windows Forms application (reading the Currency Text table TCURT):
GenericTableReader10.jpg
Another example of using the same OData service from GWM Excel Add-In (reading table TCURT):
GenericTableReader14.jpg
I hope you find this generic table reader OData service helpful, especially when building prototypes. Later when building a solution for productive usage then you will need to build a new tailored OData service.

 

Taking this further

Here a couple of improvement ideas to take this even further:

  • The number of columns could be easily expanded beyond the 20 by simply extending the data structure.
  • To overcome some of the limitations of the function module RFC_READ_TABLE, you could copy the coding and enhance your copy (e.g. the DATA_BUFFER_EXCEEDED exception could be easily dealt with, which would make this function module usable for many more tables).
  • The function module has a very helpful parameter called OPTIONS that could be used for filtering. This parameter lets you pass a ‘SQL WHERE clause’ (e.g. you could read table T001 and limit the result by a specific country specifying a WHERE clause like this “LAND1 eq ‘US’”). When creating the mapping of your OData service you could specify a WHERE clause or create a filter parameter to set the WHERE clause.
  • You could build tailored OData Service by copying the OData service and adjust it to a specific table (e.g. set proper column headings).

In a previously blog I described how SAP Fiori Leave Requests can be brought into Microsoft Outlook to update your calendar. In this blog I want to highlight another scenario where SAP Fiori and Outlook complement each other perfectly – SAP Fiori My Contacts for SAP ERP.


Note: There is also My Contacts for CRM, but that is not the one used in this blog.

 

The SAP Fiori App lets you see and edit contact details:

GPAM_MyContacts1.jpg
Wouldn't it be nice to see this information not only through SAP Fiori but also have it available as Outlook Contacts? I will discuss how you can utilize SAP NetWeaver Gateway productivity accelerator for Microsoft to create Microsoft Outlook Contacts based on the OData service behind the SAP Fiori App.


The OData service has external name SD_MYCONTACTS and the URL for the service should look like this: http://<host>:<port>/sap/opu/odata/sap/SD_MYCONTACTS/


The service follows a master-detail pattern and contains two entity sets that are of interest here:

  • ContactSet: This can be used for querying the contacts. It contains only a small subset of 4 attributes (contact key, first and last name, customer name). As expected, create and update operations are not possible for this entity set.
  • ContactDetailsSet: It contains all attributes (e.g. email address, mail address, …) but is not searchable. It allows for create and update operations.


To utilize the GWPAM generation tool I can use either entity set, but no matter which one I am choosing I have the possibility to adjust the generated .NET coding to accommodate the design of this service. I will choose the ContactsDetailsSet, as I get more coding generated by the wizard (e.g. the coding for create and update).


With that out of the way, I create a new project in Visual Studio and select the GWPAM Outlook 2010 Add-in template. The GWPAM wizard launches and here I provide a template name and chose Contact as the template type. I also select the ‘New Item’ checkbox, which will generate the .NET coding to allow the end user to create new contacts directly from Outlook.

GPAM_MyContacts2.jpg
On the Service Details tab, I enter the URL and in the Collection Name dropdown list I select the ContactDetailsSet entry (as discussed above). As for the mapping instructions I map some of the following:

Service PropertiesOutlook Properties
CountryBusinessAddressCountry
DepartmentDepartment
E-Mail AddressEmail1Address
FaxBusinessFaxNumber
FunctionJobTitle
Name 2LastName
Postal CodeBusinessAddressPostalCode
RegionBusinessAddressState
StreetBusinessAddressStreet
TelephoneBusinessTelephoneNumber


You will notice that the list of Service Properties contains multiple entries with the same name, which makes mapping a bit tricky. I am not going to worry about this too much, as all this can be correct in the .NET coding later. I want to place all unmapped properties on a separate screen within the Outlook Contact. This I can easily do on the Custom Properties tab.

GPAM_MyContacts3.jpg
Now I let the GWPAM wizard generate the coding.


Before I can execute my application I need to do a couple of code changes related to the master-detail design of the service. Initially the GetAllData() method coding is based on the ContactDetailsSet, which does not offer a query operation. I quickly switch this against the ContactSet. Here my sample coding:

Method GetAllData()

override internal void GetAllData()

…              

var serviceresponse = serviceContext.ContactSet.Execute() as QueryOperationResponse<SD_MYCONTACTS.Contact>;

do

{

if (token != null)

{

Logger.Log(Severity.Info, Categories.Outlook_GetAll, "Executing next token query for ContactSet");

serviceresponse = serviceContext.Execute<SD_MYCONTACTS.Contact>(token);

}

foreach (SD_MYCONTACTS.Contact contactEntity in serviceresponse)

{

ContactItem outlookItem = null;

UserProperties userProperties = null;

UserProperty userProperty = null;

string propertykey = "";

try

{

// Read additional details (or alternatively use the $expand option for better performance)

string contactKey = contactEntity.ContactKey;

string relativeUrl = "ContactSet('" + contactKey + "')/ToContactDetails";

SD_MYCONTACTS.ContactDetails entity = (serviceContext.Execute<SD_MYCONTACTS.ContactDetails>(new Uri(relativeUrl, UriKind.Relative))).FirstOrDefault();

MapEntityToStandardFields(entity, outlookItem);

...

 

Also since my mapping was a bit of a guess, I also clean up the mapping in method MapEntityToStandardFields(). Here my sample mapping:

Method MapEntityToStandardFields()

private static void MapEntityToStandardFields(SD_MYCONTACTS.ContactDetails entity, ContactItem outlookItem)

{

Logger.Log(Severity.Verbose, Categories.Outlook_StarterKit, "Fiori_My_ContactsBusinessApplication::MapEntityToStandardFields()");

outlookItem.MobileTelephoneNumber = entity.MobileMain;

outlookItem.MailingAddressState = entity.RegionMain;

outlookItem.LastName = entity.LastName;

outlookItem.JobTitle = entity.JobFunction;

outlookItem.FirstName = entity.FirstName;

outlookItem.Email1Address = entity.EmailMain;

outlookItem.Department = entity.Department;

outlookItem.CompanyName = entity.CustomerName;

outlookItem.BusinessTelephoneNumber = entity.PhoneMain;

outlookItem.BusinessFaxNumber = entity.FaxMain;

outlookItem.BusinessAddressStreet = entity.StreetMain;

outlookItem.BusinessAddressPostalCode = entity.PostalCodeMain;

outlookItem.BusinessAddressCountry = entity.CountryMain;

outlookItem.BusinessAddressCity = entity.CityMain;

}


With very little coding changes, now I am ready to fetch data from Outlook. I click on the GetAll button to trigger the query operation and for each entity in the result set I get a new Outlook Contact, containing information taken straight out of the ERP system.

GPAM_MyContacts4.jpg
These contacts correspond to the ones you see in the SAP Fiori App. The screenshot below shows a contact and all the mapped data coming from ERP. The unmapped information can be accessed via the Contact Details User Properties tab:

GPAM_MyContacts5.jpg
With the help of GWPAM and very little coding changes I was able to build a solution that queries the OData service and creates corresponding Outlook Contacts. Now let’s step it up a notch.


Create and Update
The underlying OData service also provides the capabilities to create and update contacts. The coding generated by the GWPAM wizard already contains much of the required .NET coding to facilitate create and update operations.


Nevertheless I have to do some more coding in order to get them to work properly. One of the tasks I have to accomplish is the formatting and validation of the data prior to submitting it to SAP. For example: Instead of submitting a department name, the OData service expects a department key. Fortunately the OData service provides additional entity sets that let me look up key values (e.g. for department or job function).

 

With a small development effort you will be able to provide a beautiful and easy to use Outlook Add-in offering similar functionality as the SAP Fiori App right from within Outlook. With the help of GWPAM, you will get a head-start into your development process by providing you with generated coding. GWPAM lets you focus on programming the business logic and shields you from low-level task like handling of authentication, logging and tracing.

If you have built a solution with the SAP NetWeaver Gateway productivity accelerator for Microsoft and you experience the following runtime error

 

“A missing or empty content type header was found when trying to read a message. The content type header is required.”

 

then this might be related to the Windows Communication Foundation (WCF) version. I have seen this so far only with projects generated in Microsoft Visual Studio 2012. When looking at the HTTP trace I see that Gateway returns a success message and still an exception occurs.

 

Try the following: Open your project in Visual Studio and open the Package Manager Console (from the menu Tools --> Library Package manager --> Package Manager Console):

GWPaM_Exception1.jpg

Note: If you do not see the menu entry then you have to install the NuGet Package Manager.

 

The Package Manager Console should now open and here you need to run the following command:

Install-Package Microsoft.Data.Services -Version 5.5.0

GWPaM_Exception2.jpg

This will add the WCF 5.5 libraries to your project. Keep in mind that you will have to do this for each new project.

 

Now give a try again. This should resolve the “A missing or empty content type header…” exception.

If your company is using the “My Leave Requests” SAP Fiori application and also uses Microsoft Outlook then this blog might be for you. Below you see a list of my recently submitted leave request in Fiori. Wouldn’t it be nice to have this information also reflected in the Outlook Calendar?

GWPAM_Fiori1.jpg

Behind the scenes the Fiori application is powered by a SAP NetWeaver Gateway OData service called LEAVEREQUEST. This service can be used for different consumption experience beyond the Fiori UI. In this blog I will briefly discuss how you can utilize this service together with the SAP NetWeaver Gateway productivity accelerator for Microsoft to bring leave requests into your Microsoft Outlook Calendar.


If you are not yet familiar with the Appointment Template of SAP NetWeaver Gateway productivity accelerator for Microsoft, then you should take a look at this blog before you continue.


First I need to find the URL of the OData service. In the SAP NetWeaver Gateway system I navigate to Activate and Maintain Services (transaction /iwfnd/maint_service). In the Service Catalog I look for a service with the technical service name ZLEAVEREQUEST_2 (have not tried version 1 of the service).


Via the Call Browser button I get to the URL, which is required for the next step.

GWPAM_Fiori6.jpg
In my case the URL looks like this: http://<host>:<port>/sap/opu/odata/GBHCM/LEAVEREQUEST;v=2


In Microsoft Visual Studio, I create a new project based on the GWPAM Outlook 2010 Add-in template. The GWPAM wizard launches and here I provide a template name and chose Appointment as the template type.

GWPAM_Fiori7.jpg
Next, on the Service Details tab, I enter the URL and click on the GO button, which prompts me to authenticate against the Gateway system. In the Collection Name dropdown list I select the LeaveRequestCollection entry.


As for the mapping instruction I keep it simple and only map 3 fields (which I will have to enhance later in coding):

Service PropertiesOutlook Properties
Leave TypeSubject
Start dateStart
End dateEnd


I am not tweaking the Custom Properties. By default I will get all of them. I also skip over the Associated Properties to keep things simple.

GWPAM_Fiori8.jpg
That’s it. I click on the Finish button to generate the project. Once generated, I set my user id and password in the BusinessConnectivityHelper class. I use Basic Authentication to keep things simple, but GWPAM does also support X.509 and SAML 2.0. Now I give this a try to see the “plain-vanilla” solution that GWPAM generated. From Outlook I click on the GetAll button to retrieve the data through the Fiori OData Service and now I see the leave requests in my Outlook Calendar:GWPAM_Fiori9.jpg

The calendar entries you see correspond to the ones you see in the Fiori application above. Below you see one of the leave requests with the Subject, Start and End populated with data from the SAP HR system:
 
Looking at the auto-generated user property folder, here you see all additional data that the OData service offers:
GWPAM_Fiori3.jpg
I hope you are excited by now. But you might be saying: Pretty cool, but a bit plain. Ok, this is where your work starts to enhance the generated coding to take full advantage of the SAP data and map it into the proper fields and formats of an Outlook Appointment. Example: The HR Leave Status (posted vs. approved) could determine the Appointment Busy Status (tentative vs. out-of-office). In the screenshot below I have done a couple of simple tweaks to the .NET coding:

GWPAM_Fiori5.jpg
Of course this could be taken even further to allow the creation or changes of a leave request from Outlook, which I will not touch on in this blog. The sky is the limit? Almost, more precisely, the OData service, the .NET  framework and your skills are the limits. ;-)


SAP Fiori has many other scenarios that fit really well into Outlook. I hope to post a follow-up blog on some other scenarios. Please leave your feedback and comments of scenarios you have tried.

 

Update: In the meantime I have written another blog on how to bring the SAP Fiori My Contacts to Outlook. I hope you find it helpful.

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.

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.

In an earlier blog I have introduced the Contact Template of the SAP NetWeaver Gateway Productivity Accelerator for Microsoft (GWPAM). Now I cover the Workflow Template that generates an Outlook Add-in specifically dealing with SAP workflows.

 

Business Scenario

With SAP NetWeaver Gateway, you can expose workflow tasks from the SAP Business Workflow through an OData service, more specifically the User Decision steps and Activity steps of a workflow. Typically these are steps where an information worker needs to take a decision, e.g. an approval of a leave request.

These workflow tasks closely resemble Microsoft Outlook Tasks, where the information worker could take a decision directly from Microsoft Outlook. In this blog I will explore how GWPAM can generate an Outlook Add-in that exactly addresses this need.

 

Workflow for SAP NetWeaver Gateway

Before you can use the Workflow Template of GWPAM, you have to configure SAP NetWeaver Gateway for workflow processing. If you haven’t done so already, then please take a look at these resources that will help you in setting it up:

Once the workflow configuration is in place, you should have a properly working service WFSERVICE (or WFHUBSERVICE) provided by your Gateway system. This service is required by GWPAM.

 

GWPAM Workflow Template

With the help of the Workflow Template of GWPAM, you can generate coding for an Outlook Add-in that will turn the workflow items into Outlook Tasks. A wizard guides you through related steps. You will notice that, compared to the Contact Template, there are next to no choices you have to make. This is because the Workflow Template has been tailored to service WFSERVICE.

 

Here a sample screenshot of the wizard:

GWPAM_Workflow_Template_Wizard.jpg

Note: Even though the wizard lets you chose the New Item Name, it will be ignored as the WFSERVICE does not offer to create new workflows. It strictly only lets you act on a workflow item, e.g. take a decision, reserve, release or forward it. Here you can learn more about this service.

 

GWPAM generates an Outlook 2010 Add-in project with C# coding that will offer functionality like:

  • Triggering the Query operation leveraging different  authentication methods (Basic, SAML, X.509)
  • Each workflow item contained in the Query result will be turned into a new Outlook Task. (If a Task already exists for this particular workflow item then it will be updated.)
  • Each Outlook Task has an additional menu and ribbon that provides additional features for actions like applying the decision, forwarding or reserving.

 

Example of a workflow item as Outlook Task:

GWPAM_Workflow_Outlook_Task.jpg

 

Demonstration

Please see this video for a short demonstration on how to use the GWPAM Workflow Template.

 

More Information

If you are interested in more details on how the GWPAM Workflow Template works, then please check out this presentation, which is part of our Self-Pace Learning offering for Gateway PAM.

 

Take it further

In an easy and quick manner, GWPAM creates a prototype for you. It is a fully functional Outlook Add-in that allows you to act on a workflow item. If it doesn’t address all your needs, then you can take the generated coding and adjust it to your requirements.

One area that you might want to enhance: The generated coding does not provide any contextual information about the workflow item. Here you could use the Extensibility Elements and the provided user exits (more information here) to enhance the workflow item with additional information for the decision maker. In the C# coding you would then query the Extensibility Elements and add them to the Outlook Task (e.g. in the body of the Task). But this will have to wait for another blog.

 

I am looking forward to hearing about your experience and thoughts about the GWPAM Workflow Template in the comments below.

By now you have probably heard about the new SAP NetWeaver Gateway Productivity Accelerator for Microsoft (GWPAM). One of the features of GWPAM is the capability to generate Outlook Add-ins using the Contact Template.

 

Business Scenario

In SAP, there are many business objects that closely resemble Outlook Contacts, e.g. Business Partners stored in a CRM system, Employees in a HCM system, Users of a system. They might have attributes that closely match Outlook Contact properties, like name, address, phone number, email address.

 

Wouldn’t it be nice to expose them as Outlook Contacts, eliminating the need for end users to log on to the SAP system and letting users leverage native capabilities of Outlook?

 

In this blog we will explore how GWPAM can help with this along an example of Business Partners.

 

It all starts with an OData Service

Let’s assume you already have an OData service that exposes contact information of Business Partners. This service should provide a Query operation with appropriate filter capabilities. If your end users are also modifying (create, update or delete) records then your OData service requires all CRUD operations.

 

If you would like to see an example of such an OData service and do not have your own Gateway system, then sign up for the Gateway Demo system. Take a look at the Business Partner collection of the EPM based sample services (GWDEMO or ZGWSAMPLE_SRV).

GWPAM Contact Template

With the help of the Contact Template of GWPAM, you can generate coding for an Outlook Add-in that will turn the Business Partner records into Outlook Contacts. A wizard guides you, the .Net developer, through a number of choices that can be made, so the generated code is best tailored to your requirements. Here a short summary of the choices you can make in the wizard:

  • Own folder: Decide if the new Outlook Contacts should be placed in their own folder or should they be created inside the default Contacts folder of Outlook.
  • Create button: Based on your requirements, choose whether or not to offer Create functionality to the end user.
  • Field mapping: Provide mapping instructions on which properties of the OData service should be mapped to which Outlook Contact properties.
  • Custom tab: Properties that can’t be mapped to the standard Outlook Contact properties can be added to a Custom tab.
  • Associated Entities tab: If associations to other entities exist, then these can be shown on an extra tab.

 

Here a sample screenshot of the wizard:

GWPAM_Contact_Template_Wizard.jpg

Based on the instructions given in the wizard, GWPAM generates an Outlook 2010 Add-in project with the C# coding that will offer functionality like:

  • Triggering the Query operation capable of leveraging different  authentication methods (Basic, SAML, X.509)
  • Each record of the Query result will be turned into a new Outlook Contact. If a Contact already exists for this particular record then it will be updated. Based on the mapping instruction provided standard Outlook Contact properties will be populated.
  • Additional properties that are not mapped to standard Outlook properties will be added to an extra tab (if selected in the wizard).
  • An additional tab will be generated in order to display associated entities (if selected in the wizard).
  • A Create New Contact button and required coding will be generated (if selected in the wizard).
  • All security related topics, like the X-CSRF Token handling, are taken care of by GWPAM.
  • The generated coding utilizes the GWPAM logging framework and is configurable (controlled by setting in App.config).

 

Demonstration

Please see this video for a short demonstration on how to use the GWPAM Contact Template.

 

More Information

If you are interested in more details on how the GWPAM Contact Template works, then please check out this presentation, which is part of our Self-Paced Learning offering for GWPAM.

 

Take it further

GWPAM lets you quickly generate a prototype, but it might not cover all your requirements. Hence, the generated coding will serve as a starting point for your development. Here your work starts. Now you can enhance the coding to make it fit your needs.

 

Please share your experience and thoughts about the GWPAM Contact Template in the comments below.

In this article Dr. Renate Mayer discusses how T-Systems has implemented a Supplier Dashboard for Deutsche Telekom based on Duet Enterprise 2.0. You find the article on page 13 of the VOI-Solutions magazine (available only in German, issue 2-2013).

 

The Supplier Dashboard collects all relevant information for a particular supplier and presents it in SharePoint 2013. The user is provided with a holistic view of all relevant data and documents pulled from multiple systems, e.g. SRM, FI, Logistics, archiving system.

 

The article discusses the many benefits of the solution to the purchasing department, e.g. the elimination of manually accessing of various systems and the shortened processing time and reduced processing cost.

 

The solution is built on Duet Enterprise 2.0 and SharePoint 2013 and leverages SAP NetWeaver Gateway 2.0 and OData Services as well as an archiving system.

If you are a Duet Enterprise 1.0 customer and you are planning to develop your own custom solution, then this blog is for you.

In the past couple of month I have seen some questions coming across my desk and the forum that indicate that not all of you are using the latest development approach recommended by SAP. If you are starting a new development project I would like to point you to the most current and relevant resources available:

 

Self-Paced Learning:
http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=272531786
Start with the Development Introduction and pay special attention to the fact that the OData Service needs to be built with the Service Builder. If you are not yet using this tool, then upgrade your system and use the Service Builder (transaction SEGW) for all new development.

 

Developer Guide:
http://scn.sap.com/docs/DOC-33223
In chapter 4, the guide outlines the Code-based Implementation approach. You are not limited to this approach. You can build your OData Service in various ways the Service Builder allows you to, including the code-free approaches via the RFC/BOR Mapping feature. Some limitations are documented in note 1834091.

 

SAP NetWeaver Gateway 2.0 SP7:
The above documents mention SAP NetWeaver Gateway 2.0 SP5 as the minimum requirement. By now SP7 is available and should be applied as it contains a number of fixes for the BDC Browser, including the following notes:

1825793: ODC SOAP Bridge - Read call does not work
1838165: BDC Browser: Long names causing problems
1835385: Handling filterable flags for entity sets in BDC
1825315: Handling filterable flags for properties in BDC Browser
1841026: Changes in the READ/DELETE/UPDATE/LIST templates
1853703: Composite Key Handling in BDC Browser

 

Duet Enterprise Forum:
http://scn.sap.com/community/duet-enterprise/content
Should you have any questions or face challenges during your development, then check out our Duet Enterprise Forum where you might find answers and can post your questions.

In Duet Enterprise 1.0 Feature Pack 1 we have two development approaches:

  • Tooling approach
  • Handcrafting approach

The Tooling approach has already been briefly introduced Generate code-free solutions for Duet Enterprise 1.0 FP1. As for the handcrafting approach, here you are manually creating a Gateway Data Model, a web service interface and ABAP classes and coding (see step 1 and 2):

 

Want to learn more about this?

The new Developer Guide for Feature Pack 1 has just been published. This guide outlines all the required steps for handcrafting:

Why do I need to do handcrafting?

You might be wondering why you still need handcrafting now that we have a new toolset that allows you to generate a code-free solution. Here a couple of examples where you might need to consider the handcrafting approach:

  • Your data source does not meet the requirements of the generation tools.
  • You require a more complex solution (e.g. the CREATE and UPDATE scenarios can become so complex that handcrafting might be required)
  • You require a complex data structure (Note: The BDC Browser automatically flattens all complex structures)

What has changed compared to the handcrafting prior to FP1?

The handcrafting has changed a bit in FP1. Main differences are:

  • Starting with FP1 we are no longer using the GenIL Mode and are switching now to the Gateway Data Model.
  • Consumer Inbound and Outbound Mappers are no required.

I encourage you to take a look at the new guide to familiarize yourself with these changes.

Note: There is no need to change your previously built solutions. We recommend that if you start a new development you should now switch over to the new process.

Hybrid Approach

There is also the possibility to mix-and-match between handcrafting and the tooling approach – hybrid approach. Example: You might handcraft the objects for Step 1 (GW Data Model, BSO, BOP and Mappers) and then for Step 2 you can use the BDC Browser tool.

You might have heard about the new improvements we made in Feature Pack 1 of Duet Enterprise 1.0.

We have now a new toolset that enables you to generate a solution based on RFCs, BOR or ABAP dynpros. These tools are excellent for building solutions that have low complexity (e.g. display-only scenarios). There is no coding involved. The underlying data source (RFC, BOR, dynpro) has to meet the requirements of the tools.

The toolset consists of NetWeaver Gateway tools (step 1) and the BDC Browser tool (step 2):

Tooling Approach 

If you want to give these tools a try, then take a look at the following two guides:

I hope you enjoy these new tools. More documents and update to follow on the development in Feature Pack 1.

New Version of the Duet Enterprise Developer Guide

We have published a new version of the Duet Enterprise Developer Guide on SDN. It is available here. So what has changed?

CRUDQ

In January we released the first version of the Developer Guide. It explained how to build a 'read-only' custom solution.

Now we have updated the guide to include instructions on how to develop Create, Update and Delete operations. The guide covers all CRUDQ operations. See the newly added chapter 7 Use case – Adding Create, Update and Delete Operations.

Sample Services

We have also included a new chapter explaining how to use the pre-delivered Starter Services as samples for your development. The guide explains how to locate the various development objects belonging to a Starter Service so you can use them as samples for your own development. See the new chapter 8 Other Development Examples – Starter Services.

Source Code

For your convenience, we are now providing the ABAP source code in form of text files. You can find the link to the source code files in the Summary section on page 1.

As for chapters 1 to 6, we have only made minimal changes to the previously published chapters.

How to use the Guide

If you have already gone through chapter 1 to 6 and have already implemented the scenario, then there is no need to revisit these chapters. You can go directly to chapter 7 and continue building on your previous work. Please ensure that you have a working 'read-only' scenario before moving on to the Create, Update and Delete operations.

If you have not yet started with your custom development then start from chapter 1 and work through the guide in its entirety.

 

Please check out the new version of the Duet Enterprise Developer Guide and provide use with your feedback.

Related Content

Duet Enterprise Developer Guide

Duet Enterprise Home Site

Actions

Filter Blog

By author:
By date:
By tag: