cancel
Showing results for 
Search instead for 
Did you mean: 

Add custom fields to OData Service - Desktop Connection SP5

S0011572494
Participant
0 Kudos

Hi everyone,

following the enhancement guide for SAP Desktop Connection (EnhancementGuide_DeskConn_PE_2015-01-16.pdf) which can be downloaded from the SAP Note (http://service.sap.com/sap/support/notes/1926916) I tried to add some custom fields to the OData Service.

Steps done:

  1. Append AccountMain Structure with custom fields
  2. Redefine OData Sercvice GROUPWARE_SYNC to add the new fields to AccountMain Entity
  3. Redefine GET_ENTITY and GET_ENTITY_SET of the data provider class to assign the new fields
  4. Subclass /CRMGWS/CL_MODEL_CONTENT_04 and redefine DEFINE_ACCOUNTMAIN to add the definitions of the new fields for shared memory access

When debugging a request of the form <gateway-url>/sap/opu/odata/crmgws/groupware_sync/AccountMainCollection(guid'512F1381-489B-0B20-E100-80000A0D0A3A') I can see that my redefined methods are traversed and that the new fields are filled.

I can even see my fields in the response body in method /IWBEP/FM_MGW_HANDLE_REQUEST of class /IWBEP/SAPLFGR_MGW_CLIENT_IF.

Unfortunately my fields are not visible in the response in the browser.

The fields are also not visible in the metadata of the extended service ($metadata afer the root url to the service). Probably this is the reason why the fields are not populated to the browser. I checked the OData Service definition (Transaction SEGW) multiple times but could not find anything.

Has someone any ideas what could be wrong?

Kind regards

Fabian

Accepted Solutions (1)

Accepted Solutions (1)

michael_sackmann
Participant
0 Kudos

Hello Fabian,

your assumption is correct i.e. if the new field is not returned by metadata then it is only available internally but not externally for a given caller.

How did you extend the model? Did you use gateway service builder (t-code /IWBEP/SB)?

This is the most easiest way as you do not have to do any coding just some declarations i.e.

you create the external name of the new property and do an assignment to the interanl field name from the DDIC structure.

If you have created your own model provider class, is it also called (do a breakpoint in define method and execute the metadata service call)?

Please note that there is also some cache/buffering possibility within cateway which you should not use during development.

Regards

Michael

S0011572494
Participant
0 Kudos

Dear Michael,

I extended the service using the transaction SEGW. I created a new project in Z namespace, redefined the base service /CRMGWS/GROUPWARE_SYNC and activated the checkbox to overwrite the existing model during generation.

In the meantime I solved the problem in the following way:

Instead of using the Z namespace for my project, I created the service also in the /CRMGWS namespace (/CRMGWS/ZGROUPWARE_SYNC). Now also the external service (accessed via netweaver gateway hub) is working.

The problem lies in the detection of the service model. The model is searched for in the same namespace as the external service name (see Function Module /IWBEP/FM_MGW_GET_OBJ_MODELS Line 118) which is why the assigned model in Z namespace is not found.

Kind regards Fabian

michael_sackmann
Participant
0 Kudos

Dear Fabian,

I think the issue with the different namespace in service and model has already been reported and there is already a fix available with CSN note 2188049 for this.

Regards

Michael

Answers (0)