Quantcast
Channel: SCN : Unanswered Discussions - SAP Gateway
Viewing all 1745 articles
Browse latest View live

Update Entity Operation Taking Time To Trigger...

$
0
0

Hi,

 

I have implemented Update entity operation with a simple code.

The issue is that, when I am triggering URL from UI5 application it is taking 7 sec to reach ABAP code however when I am hitting same URL from gateway client it is taking milliseconds to reach ABAP code...

 

Any suggestions...

 

 

-Amol S


Some doubts from SAP OData

$
0
0

Hi everyone,

 

I have few question related to SAP OData service and Gateway Hub.

 

1. Related to Subscription and Notification.

 

    When we enable the Subscription check box while creating the service in SEGW, system automatically creates 2 Entity Sets.

    i.  SubscriptionCollection

    ii. NotificationCollection

    I understood the SubscriptionCollection, but what is the use of NotificationCollection.

 

2. My understanding is that there should a program like /IWBEP/R_MGW_PUSH_TEST to send the push notification. The question is whether the system takes care of sending Notification to the client automatically without writing the push program ?

 

3. Subscriptions being saved in a Table /IWBEP/D_MGW_SUB.  Now the question is where the notification should save if we have 2 systems/boxes like ERP and NGW Hub.

 

4. What is the role of bgRFC in the notification process ?

 

Please share your thoughts.

 

Thank you.

Ravinder.

Delete method automatically generated problem

$
0
0

Hi,

I´m following this Detailed step by step procedure for Creating Gateway Service with all the CRUD Operations and testing them in Service Explorer Part2 , but in my system I'm having problem with the code generated for the method "MATRSET_DELETE_ENTITY ", this code only mapped the keys fields, and the constants values  , someone knows why?.

 

 

My system:

 

SAP_BASIS7400009
SAP_ABA7400009
SAP_GWFND7400014
SAP_UI7400015

 

 

method MATRSET_DELETE_ENTITY.

*-------------------------------------------------------------

*  Data declaration

*-------------------------------------------------------------

  data CLIENTDATA type ZIF_BAPI_MATERIAL_SAVEDATA=>BAPI_MARA.

  data CLIENTDATAX type ZIF_BAPI_MATERIAL_SAVEDATA=>BAPI_MARAX.

  data HEADDATA type ZIF_BAPI_MATERIAL_SAVEDATA=>BAPIMATHEAD.

  data RETURN type ZIF_BAPI_MATERIAL_SAVEDATA=>BAPIRET2.

  data LV_RFC_NAME type TFDIR-FUNCNAME.

  data LV_DESTINATION type RFCDEST.

  data LV_SUBRC type SYST-SUBRC.

  data LV_EXC_MSG type /IWBEP/MGW_BOP_RFC_EXCEP_TEXT.

  data LX_ROOT type ref to CX_ROOT.

DATA ls_converted_keys TYPE ZCL_ZBPS_MATR_DEMO_MPC=>TS_MATR.

DATA lv_source_entity_set_name TYPE string.

DATA lo_dp_facade TYPE REF TO /iwbep/if_mgw_dp_facade.

 

*-------------------------------------------------------------

*  Map the runtime request to the RFC - Only mapped attributes

*-------------------------------------------------------------

* Get all input information from the technical request context object

* Since DPC works with internal property names and runtime API interface holds external property names

* the process needs to get the all needed input information from the technical request context object

* Get key table information

   io_tech_request_context->get_converted_keys(

     IMPORTING

       es_key_values  = ls_converted_keys ).

 

* Maps constant value to function module parameters

     CLIENTDATAX-DEL_FLAG = 'X'.

     CLIENTDATAX-MATL_GROUP = 'X'.

 

* Maps key fields to function module parameters

 

        HEADDATA-MATERIAL = ls_converted_keys-MATERIAL.

* Get RFC destination

lo_dp_facade = /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).

lv_destination = /iwbep/cl_sb_gen_dpc_rt_util=>get_rfc_destination( io_dp_facade = lo_dp_facade ).

 

*-------------------------------------------------------------

*  Call RFC function module

*-------------------------------------------------------------

lv_rfc_name = 'BAPI_MATERIAL_SAVEDATA'.

 

if lv_destination is initial or lv_destination eq 'NONE'.

 

   try.

       call function lv_rfc_name

         exporting

           HEADDATA      =   HEADDATA

           CLIENTDATA    =   CLIENTDATA

           CLIENTDATAX   =   CLIENTDATAX

         importing

           RETURN   =   RETURN

         exceptions

           system_failure = 1000 message lv_exc_msg

           others = 1002.

 

       lv_subrc = sy-subrc.

*in case of co-deployment the exception is raised and needs to be caught

     catch cx_root into lx_root.

       lv_subrc = 1001.

       lv_exc_msg = lx_root->if_message~get_text( ).

   endtry.

 

else.

 

   call function lv_rfc_name destination lv_destination

         exporting

           HEADDATA      =   HEADDATA

           CLIENTDATA    =   CLIENTDATA

           CLIENTDATAX   =   CLIENTDATAX

         importing

           RETURN   =   RETURN

         exceptions

           system_failure         = 1000 message lv_exc_msg

           communication_failure  = 1001 message lv_exc_msg

           others = 1002.

 

   lv_subrc = sy-subrc.

 

endif.

 

*-------------------------------------------------------------

*  Map the RFC response to the caller interface - Only mapped attributes

*-------------------------------------------------------------

*-------------------------------------------------------------

* Error and exception handling

*-------------------------------------------------------------

IF lv_subrc <> 0.

* Execute the RFC exception handling process

   me->/iwbep/if_sb_dpc_comm_services~rfc_exception_handling(

     EXPORTING

       iv_subrc            = lv_subrc

       iv_exp_message_text = lv_exc_msg ).

ENDIF.

 

IF RETURN IS NOT INITIAL.

* Call RFC call exception handling

   me->/iwbep/if_sb_dpc_comm_services~rfc_save_log(

     EXPORTING

       is_return      = RETURN

       iv_entity_type = iv_entity_name

       it_key_tab     = it_key_tab ).

ENDIF.

 

* Call RFC commit work

   me->/iwbep/if_sb_dpc_comm_services~commit_work(

          EXPORTING

            iv_rfc_dest = lv_destination

       ) .

   endmethod.



The parameter CLIENTDATA never is populated and i had mapped:


imagen.png


If i'll compare this code with the code generated for the method "MATRSET_UPDATE_ENTITY":


method MATRSET_UPDATE_ENTITY.

*-------------------------------------------------------------

*  Data declaration

*-------------------------------------------------------------

  data CLIENTDATA type ZIF_BAPI_MATERIAL_SAVEDATA=>BAPI_MARA.

  data CLIENTDATAX type ZIF_BAPI_MATERIAL_SAVEDATA=>BAPI_MARAX.

  data HEADDATA type ZIF_BAPI_MATERIAL_SAVEDATA=>BAPIMATHEAD.

  data RETURN type ZIF_BAPI_MATERIAL_SAVEDATA=>BAPIRET2.

  data MATERIALDESCRIPTION  type ZIF_BAPI_MATERIAL_SAVEDATA=>__BAPI_MAKT.

  data LS_MATERIALDESCRIPTION  type line of ZIF_BAPI_MATERIAL_SAVEDATA=>__BAPI_MAKT.

  data LV_RFC_NAME type TFDIR-FUNCNAME.

  data LV_DESTINATION type RFCDEST.

  data LV_SUBRC type SYST-SUBRC.

  data LV_EXC_MSG type /IWBEP/MGW_BOP_RFC_EXCEP_TEXT.

  data LX_ROOT type ref to CX_ROOT.

DATA ls_request_input_data TYPE ZCL_ZBPS_MATR_DEMO_MPC=>TS_MATR.

DATA ls_converted_keys LIKE ER_ENTITY.

DATA lv_source_entity_set_name TYPE string.

DATA lo_dp_facade TYPE REF TO /iwbep/if_mgw_dp_facade.

 

*-------------------------------------------------------------

*  Map the runtime request to the RFC - Only mapped attributes

*-------------------------------------------------------------

* Get all input information from the technical request context object

* Since DPC works with internal property names and runtime API interface holds external property names

* the process needs to get the all needed input information from the technical request context object

* Get request input data

   io_data_provider->read_entry_data( IMPORTING es_data = ls_request_input_data ).

* Get key table information

   io_tech_request_context->get_converted_keys(

     IMPORTING

       es_key_values  = ls_converted_keys ).

 

* Maps constant value to function module parameters

     CLIENTDATAX-MATL_GROUP = 'X'.

 

* Maps key fields to function module parameters

 

        HEADDATA-MATERIAL = ls_converted_keys-MATERIAL.

* Map request input fields to function module parameters

        CLIENTDATA-base_uom = ls_request_input_data-base_uom.

        CLIENTDATA-matl_group = ls_request_input_data-matl_group.

        HEADDATA-ind_sector = ls_request_input_data-ind_sector.

        HEADDATA-matl_type = ls_request_input_data-matl_type.

        LS_MATERIALDESCRIPTION-langu_iso = ls_request_input_data-langu_iso.

        LS_MATERIALDESCRIPTION-langu = ls_request_input_data-langu.

        LS_MATERIALDESCRIPTION-matl_desc = ls_request_input_data-matl_desc.

 

* Append lines of table parameters in the function call

   IF LS_MATERIALDESCRIPTION IS NOT INITIAL.

     APPEND LS_MATERIALDESCRIPTION TO MATERIALDESCRIPTION.

   ENDIF.

 

* Get RFC destination

lo_dp_facade = /iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).

lv_destination = /iwbep/cl_sb_gen_dpc_rt_util=>get_rfc_destination( io_dp_facade = lo_dp_facade ).

 

*-------------------------------------------------------------

*  Call RFC function module

*-------------------------------------------------------------

lv_rfc_name = 'BAPI_MATERIAL_SAVEDATA'.

 

if lv_destination is initial or lv_destination eq 'NONE'.

 

   try.

       call function lv_rfc_name

         exporting

           HEADDATA      =   HEADDATA

           CLIENTDATA    =   CLIENTDATA

           CLIENTDATAX   =   CLIENTDATAX

         importing

           RETURN   =   RETURN

         tables

           MATERIALDESCRIPTION   =   MATERIALDESCRIPTION

         exceptions

           system_failure = 1000 message lv_exc_msg

           others = 1002.

 

       lv_subrc = sy-subrc.

*in case of co-deployment the exception is raised and needs to be caught

     catch cx_root into lx_root.

       lv_subrc = 1001.

       lv_exc_msg = lx_root->if_message~get_text( ).

   endtry.

 

else.

 

   call function lv_rfc_name destination lv_destination

         exporting

           HEADDATA      =   HEADDATA

           CLIENTDATA    =   CLIENTDATA

           CLIENTDATAX   =   CLIENTDATAX

         importing

           RETURN   =   RETURN

         tables

           MATERIALDESCRIPTION   =   MATERIALDESCRIPTION

         exceptions

           system_failure         = 1000 message lv_exc_msg

           communication_failure  = 1001 message lv_exc_msg

           others = 1002.

 

   lv_subrc = sy-subrc.

 

endif.

 

*-------------------------------------------------------------

*  Map the RFC response to the caller interface - Only mapped attributes

*-------------------------------------------------------------

*-------------------------------------------------------------

* Error and exception handling

*-------------------------------------------------------------

IF lv_subrc <> 0.

* Execute the RFC exception handling process

   me->/iwbep/if_sb_dpc_comm_services~rfc_exception_handling(

     EXPORTING

       iv_subrc            = lv_subrc

       iv_exp_message_text = lv_exc_msg ).

ENDIF.

 

IF RETURN IS NOT INITIAL.

* Call RFC call exception handling

   me->/iwbep/if_sb_dpc_comm_services~rfc_save_log(

     EXPORTING

       is_return      = RETURN

       iv_entity_type = iv_entity_name

       it_key_tab     = it_key_tab ).

ENDIF.

 

* Call RFC commit work

   me->/iwbep/if_sb_dpc_comm_services~commit_work(

          EXPORTING

            iv_rfc_dest = lv_destination

       ) .

   endmethod.

All was fine for update method .


There is a BUG in the generator for the method DELETE?.


Best regards.

Authentication between SAP Gateway cloud connector and HCP mobile services

$
0
0

Hello Experts,

 

We have an Use Case where in we have iOS Native app that connects to HCP mobile services which connects to back end ECC system (say ERP) via HCP Mobile services and HANA cloud connector (HCC) .

 

App -> HCPms -> HCC -> OData_SRV -> ERP.

 

We are able to do a GET with and  without authentication. This Works !! 

 

However, to perform PATCH operation  from native app, we get an error "CSRF Token needed".

But patch works within SAP gateway if we use tcode /IWFND/GW_CLIENT

 

For authentication, we are using HCP default identity provider (SAP ID) and HTTP Basic Auth. (and this works too). For backend ECC system we use SAP backend user for identity management.

 

What is the correct way to configure Cloud connector + backend ECC systems so that we can execute PATCH/update? 

Any pointers will be highly appreciated!!

 

 

 

regards

Akshay

JSON_PARSER_ERROR in REST consuming Service

$
0
0

Hi All,

 

I am updating the External system Service(Sales Force) through REST API's using SAP ABAP. I'm giving the inputs as specified below.

 

Requested Body in the form Of JSON:

 

  body = '{ "City" : "Newyork" } '.

 

     lv_body = body.

 

Sending Request

 

  http_client->request->set_header_field( name  = '~request_method'

    value = 'PATCH' ).


while executing the report i am getting the below message in the content field.


[{"message":"The HTTP entity body is required, but this request has no entity body.","errorCode":"JSON_PARSER_ERROR"}]


 

Please kindly help me on this.


Thanks,

Harikrishna

Not able to call Annotations in Gateway

$
0
0

HI,

 

I have developed the Annotation project and redefined the method  DEFINE_VOCAB_ANNOTATIONS with below code, how to call the below code in my main service.

 

My Requirement is to display the description of MATNR as ARTICLE CODE,  Please let me know what I am missing here.

 

Please let me know if there is any code i have to written to get the

 

data: lo_ann_target type ref to /iwbep/if_mgw_vocan_ann_target.   " Vocabulary Annotation Target                     "#EC NEEDED

DATA: lo_annotation TYPE REF TO /iwbep/if_mgw_vocan_annotation.   " Vocabulary Annotation                            "#EC NEEDED

DATA: lo_collection TYPE REF TO /iwbep/if_mgw_vocan_collection.   " Vocabulary Annotation Collection                 "#EC NEEDED

DATA: lo_function   TYPE REF TO /iwbep/if_mgw_vocan_function.     " Vocabulary Annotation Function                   "#EC NEEDED

DATA: lo_fun_param  TYPE REF TO /iwbep/if_mgw_vocan_fun_param.    " Vocabulary Annotation Function Parameter         "#EC NEEDED

DATA: lo_property   TYPE REF TO /iwbep/if_mgw_vocan_property.     " Vocabulary Annotation Property                   "#EC NEEDED

DATA: lo_record     TYPE REF TO /iwbep/if_mgw_vocan_record.       " Vocabulary Annotation Record                     "#EC NEEDED

DATA: lo_simp_value TYPE REF TO /iwbep/if_mgw_vocan_simple_val.   " Vocabulary Annotation Simple Value               "#EC NEEDED

DATA: lo_url        TYPE REF TO /iwbep/if_mgw_vocan_url.          " Vocabulary Annotation URL                        "#EC NEEDED

DATA: lo_label_elem TYPE REF TO /iwbep/if_mgw_vocan_label_elem.   " Vocabulary Annotation Labeled Element            "#EC NEEDED

DATA: lo_reference  TYPE REF TO /iwbep/if_mgw_vocan_reference.    " Vocabulary Annotation Reference

 

*Calling the generated mehtod for creating annotations

     CALL METHOD super->define_vocab_annotations( ).

 

   lo_reference = vocab_anno_model->create_vocabulary_reference( iv_vocab_id = '/IWBEP/VOC_CORE'

                                                                 iv_vocab_version = '0001').

   lo_reference->create_include( iv_namespace = 'Org.OData.Core.V1' ).

   lo_reference = vocab_anno_model->create_vocabulary_reference( iv_vocab_id = '/IWBEP/VOC_CAPABILITIES'

                                                                 iv_vocab_version = '0001').

   lo_reference->create_include( iv_namespace = 'Org.OData.Capabilities.V1' ).

   lo_reference = vocab_anno_model->create_vocabulary_reference( iv_vocab_id = '/IWBEP/VOC_COMMON'

                                                                 iv_vocab_version = '0001').

   lo_reference->create_include( iv_namespace = 'com.sap.vocabularies.Common.v1' ).

   lo_reference = vocab_anno_model->create_vocabulary_reference( iv_vocab_id = '/IWBEP/VOC_COMMUNICATION'

                                                                 iv_vocab_version = '0001').

   lo_reference->create_include( iv_namespace = 'com.sap.vocabularies.Communication.v1' ).

   lo_reference = vocab_anno_model->create_vocabulary_reference( iv_vocab_id = '/IWBEP/VOC_UI'

                                                                 iv_vocab_version = '0001').

   lo_reference->create_include( iv_namespace = 'com.sap.vocabularies.UI.v1' ).

 

 

*Creating the Annotation Target

     lo_ann_target = vocab_anno_model->create_annotations_target( iv_target = 'ZXXX_LINKXXX_SRV.Article' ).

 

*Creating the LineItem Collection

     lo_annotation = lo_ann_target->create_annotation( iv_term = 'com.sap.vocabularies.UI.v1.LineItem' ).

     lo_collection = lo_annotation->create_collection( ).

 

**Creating the Records

 

* Article Number

     lo_record = lo_collection->create_record( iv_record_type = 'com.sap.vocabularies.UI.v1.DataField' ).

     lo_property = lo_record->create_property( iv_property_name = 'Value').

     lo_simp_value = lo_property->create_simple_value( ).

     lo_simp_value->set_path( 'Matnr' ).

     lo_property = lo_record->create_property( iv_property_name = 'Label').

     lo_simp_value = lo_property->create_simple_value( ).

     lo_simp_value->set_string( 'Article Code' ).


Thanks

Shaik

Cannot delete ODATA service

$
0
0

Hi Gurus,

 

I'm in the data service catalog '/iwfnd/maint_service'.  I'm trying to delete a service that someone created, but it won't let me.  I'm following Delete the Service - SAP Gateway Foundation (SAP_GWFND) - SAP Library , but when I get to the delete service portion, I get 'Service can only be deleted in original system 'SAP'.'.  I'm not sure what I'm doing wrong.  I would appreciate it if someone could give me some direction?

 

Best regards and thanks for your assistance,

 

Jim

Netweaver gateway services not visible in different client

$
0
0

Hi Experts,

 

We have created netweaver gateway services in client 100 but those are not visible in client 200.

Client 200 is test client so we maintained system alias as 200 client.


Also services are not showing in sap netweaver gateway system SEGW tcode but we could see these in /IWFND/MAINT_SERVICE.

 

Thing is all services are working fine. But I am curious to know why they are not showing in SEGW tcode project list in netweaver gateway and ECC 200 client.?

 

We have central hub deployment and backend development environment.

 

Is there something else do we need to do in order to see them?

 

Hope my question is clear to all.

 

Thanks

BRS


Resouce Chip Not Found Error

$
0
0

Hi Experts,

 

Any one of you help me this issue , What is the root cause of this error "resource chip not found " .i added the authorizationroles.

sap_ui2_user_700

sap_ui2_admin_700 at the same time added authorization objects manually in that roles.even i am getting same error.

 

Authorization Objects:

/ui2/chip

S_service


S_service what is the use of this object.

Develop new OData service for workflows

$
0
0

Dear Gateway/Fiori experts,

 

Is it possible to develop new OData service for workflow approval apps.to integrate custom/standard workflows available in business suite.

Yes the Fiori MyInbox app or Approve Requests app can connect well with workflows , but the UI template of our app does nt fit well with requirements. we want to further integrate drill down approach to other apps and use a complete different template than master detail and extensibility points are limited.

 

So, developing a new app from scratch is the only way.

But how feasible is it to develop a new OData service for workflows? What are the considerations for it.

Appreciate your suggestions.

CC:

 

Thanks in advance

Daniel.

[SEGW] sap annotation usage in UI5 smartFilterBar dropDownList

$
0
0

Hi Experts,

I am new to sap annotation . As far as i know , annotation  can be called by UI as dropdown list or F4 help  .

Currently i want to configure annotation to be used as dropdown list .

In the ui , the description of the field can be seen .

When i filter one value , it can pass its key value to the gateway .

If anyone can answer my question , it will be appreciated.

 

Or any one can share one example .

SAP Gateway message headers with SMP3

$
0
0

Hello experts,

 

We are developing offline application with SMP3. For errors handling, we are trying to send custom headers through implementing method /iwbep/if_mgw_conv_srv_runtime~set_header. So I fill structure IS_HEADER with key and value. According the following post,

 

Notification Data Sent Through HTTP Headers - REST API Application Development - SAP Library

 

I send mesage header for instance as 'X-SMP-MYMSG'. But SMP3 server is still filtering out this header. So I cannot build a valid header to be accesible from the app. Gateway is converting the key to lowercase 'x-smp-mymsg'. Could this be causing the problem?

 

Do you have any hint on how to proceed here?

 

Thanks and kind regards,

Francisco.

odata implementation in order to get sharepoint data into sap

$
0
0

Hi folks,

I am having a requirement to get sharepoint lists into SAP. I have created already a odata model based on XML output of the sharepoint db. I am struggling now to get the data from sharepoint into SAP.

Most examples which I found so far are working the other way round, so SAP data is offered to outside world.

Anybody any idea how I can do this? I guess somehow  I have to trigger the sharepoint services like List, but I have no clue how.

Any idea, help, suggestion is much appreciated.

Regards, Thomas

Function Import: Optional Parameters: Example

Compressing ODATA Response Data (Payload)

$
0
0

Dear Experts

 

I have a requirement of compressing the response payload which returns a huge number of records.

Tried GZIP option as a Accept-Encoding header but no luck.

 

Can anyone explain how this concept work? How is the zip format identified?

 

Note: We are in SAP GW 2.0 - SP8

 

Best Regards,

Vijay


Fetch data based on input in OData service

$
0
0

Hi everyone,

 

I created BAPI to fetch sales details of a given customer.

 

Import parameter

   CUST_NO

 

Export Parameter

   RETURN

 

Tables:  SALES_TAB   (Table having 4 columns given below)

                *  SO_NO

                *  SO_DATE

                *  NET_VALUE

                *  CURRENCY

 

BAPI working fine.

Now I want to create a OData service by importing the above BAPI function.

 

I have little confusion while selecting the fields to create a model.

I want to take RETURN structure also.

 

Another question is do I need to go with GetEntity (Read) or GetEntitySet (Query) for my above BAPI.

 

Please help.

Ravinder.

Error when accessing the SAP Fiori Launchpad

$
0
0

Hi all,

 

We are trying to test My Inbox Fiori app in our system.

 

We're following the How-To manual, and now we're on step #4: Fiori My Inbox - Step 4. Testing My Inbox

 

When we try to start the SAP Fiori Launchpad, we're receiving an error:

Sin título.png

The BADI /UI5/BADI_CONFIG_HTTP_HANDLER is not available into the system:

Sin título.png

Sin título.png

I think we have all the necessary SC installed:

Sin título.png

Any idea??

 

Thanks,

 

Miguel Angel.

Enabling OAuth for OData Services - Restricting existing service - How?

$
0
0

So, I've gone through the information on SCN regarding how to enable OAuth 2.0 for an OData service. I've used the following article:

 

  • OAuth 2.0: Constrained Authorization and SSO for OData Services

 

I set up an OAuth 2.0 Client, set-up an Identity Provider, added scopes, etc. I am still able to hit the OData endpoint despite having it set to use OData. I am not required to use authorization, and I'm expecting it to say I can't access it. But I have a few inklings as to why, and I want to confirm these and ask for help:

 

  1. Is SSL required to test the OAuth calls to OData services? We currently do not have this on our development sandbox, and this is where I'm doing some testing.
  2. Are Resource Owner Authorization Configurations required? Is this why the service isn't restricting me?
  3. Do I need to set something in SICF on the service to enable OAuth to work?

 

Keep in mind, this is all for the SAML Bearer Assertion Flow.

 

https://wiki.scn.sap.com/wiki/display/Security/Using+OAuth+2.0+from+a+Web+Application+with+SAML+Bearer+Assertion+Flow

Using eTags for concurrency control - Does it help for all the scenarios ?

$
0
0

Dear All,

 

SAP Gatway framework suggest using eTags to achieve conccurency control. However eTags doesnt actually lock the data instead it allows all the users to edit the data and check this when saving in the backend.This actually contradicts the behaviour we see in typical SAP transactions.

 

Is there any techinques to achieve SAP Transaction like behaviuor(Pessimistic lock) in SAPUI5/Gateway applications ?

 

 

Thanks for the help !

 

Regards

Prabahran Asokan

Concurrency during Update using eTags

$
0
0

Hi Experts,

 

i've found a race condition while performing an update statement on my oData service. To achieve concurrency control i'm using eTags which is already working fine for most situations. But there is a sequence that i can not handle with eTags, let me describe it in the following table. The left column contains the actions for User 1, the right one those for User 2. To show the chronological order the steps are ordered from top to bottom, so that the action in row 1 ist executed before row 2 and so on. The entries highlighted in bold red are the actual actions performed by users, the other entries serve for better understanding.

 

When performing an Update-Statement in SAPUI5 the framework is automatically calling the "GetEntity"-Method to compute the necessary eTag and comparing it with the timestamp used by the Application (simplified). Only when both eTags are matching the Update-Statement will be executed.

 

NrUser 1 ActionUser 2 Action
1Calling GetEntity and comparing eTag --> OK
2Calling GetEntity and comparing eTag --> OK
3At this point both users are able to update the entityAt this Point both users are able to update the entity
4Performing Update
5Now User 1 is working on the updated datasetNow User 2 is working on an outdated dataset
6Performing Update
7User 2 has overwritten the data of User 1
8User 1 does not know about the changes of User 2User 2 has never seen the changes of User 1

 

As you can see both users could update the dataset without noticing the changes of the other one. I can also provoke this behaviour using the Debugger, so this is a "real-life" problem. The only solution i found is to raise an exception in the Update-Routine, but therefore i have to check the timestamp on my own - a feature that i thought eTags could handle for me.

 

 

Finally my question: is there another approach to handle this race condition?

 

Best regards

Lukas

Viewing all 1745 articles
Browse latest View live


Latest Images

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