Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all 2823 articles
Browse latest View live

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.


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

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.

#9 How To... Implement End-to-End Push Notifications with HCPms and SAP Gateway

$
0
0

#9.png

This is a part of the implementation details of How To... Implement End-to-End Push Notifications with HCPms and SAP Gateway.


 

Tips & Tricks - Implementing Subscribable OData services & Notification API in ABAP

13.png

You have a complete e2e landscape for push. Let's talk about how to implement "Subscribable" OData services with SAP Gateway and trigger the notification from ABAP application.

 

Building Subscribable OData services

 

If you don't have any OData services nor ever have coding experiences with SAP Gateway, here's a beginner level crash course of how to build your OData CRUD services. From now on let's assume you have done the CRUD implementation with TravelAgency data.

 

#1 - OData CRUD Crash Course - Getting ready with offline store

 

Now that you have functional OData services, go to the transaction code SEGW - Open "Data Model" > "Entity Sets", find your collection you want to make subscribable. You'll see the checkbox "Subscribable". Tick it in.

9.1.png

Click on the project and select "Generate Runtime".

9.2.png

Find "Runtime Artifacts" and select "...DPC_EXT" and "Go to ABAP Workbench".

9.3.png

In the ABAP Workbench, you should be able to find "CHECK_SUBSCRIPTION_AUTHORITY" in the "Methods" > "Inherited Methods". Select it and "Redefine". Simply you save it - this is the place for extra authorization check to access "/IWBEP/D_MGW_SUB" table. But for this case you can leave it empty implementation. (= anyone can subscribe)

9.4.png

In the "Runtime Artifacts", select "...MPC_EXT" and "Go to ABAP Workbench".

9.8.png

Find "DEFINE" in the "Methods" > "Inherited Methods". Select it and "Redefine".  And type in a single line of "super->define( )." Save it.

9.7.png

Time to check if you made it subscribable. In the transaction code SEGW, start a Gateway Client via the system in the "Service Maintenance".

9.5.png

Execute it and you should be able to confirm two new collections of "SubscriptionCollection" and "NotificationCollection".

9.6.png

Tip - if you still don't see them, most likely your client is seeing cached metadata. Please try following:


  • Clear the cache in Gateway Hub: tx code /IWFND/CACHE_CLEANUP
  • Clear in Backend: tx code /IWBEP/CACHE_CLEANUP
  • (Recommended during the development) Deactivate caching: tx code SPRO "SAP NetWeaver" > "Gateway" > "OData Channel" > Administration > Cache Settings > Metadata

9.9.png


Now your favorite OData services became subscribable!

 

 

Using Notification API to trigger Push event

 

SAP Gateway provides a notification API that facilitates sending notifications from the back end when a back-end event is triggered. The necessary set of API calls to send an appropriate notification once a back-end business object event is triggered are listed below. Integrate the appropriate code for these calls into the standard processing of your ABAP logic - such as during OData CUD methods or in the SAP business object via an appropriate user exit or BADI.

 

  1. Call static method /IWBEP/CL_MGW_SUB_REGISTRY=>GET_SUBSCRIPTION_REGISTRY( ) to get the instance of the subscription registry.
  2. Call method GET_SUBSCRIPTIONS( ) of the subscription registry, and provide the model group name and the collection for the notifications of the current business application.
  3. Call static method /IWBEP/CL_MGW_NOTIF_PUBLISHER=>GET_NOTIFICATION_PUBLISHER() to get the instance of the notification publisher.
  4. Call method CREATE_NOTIFICATION_ENDPOINTS() of the publisher instance, and provide the data structure you want to send and the list of subscriptions returned by the registry. (Note - formal help document: /IWBEP/IF_MGW_NOTIF_PUBLISHER - SAP NetWeaver Gateway - SAP Library)
  5. Call method SEND_NOTIFICATIONS() of the publisher for each notification endpoint.

 

Tip - Some remarks with CREATE_NOTIFICATION_ENDPOINTS(). This is specific with /Notification/ Push URL of HCPms:


  • IS_DATA - Mandatory, but you could set any data (this data is originally meant for a HTTP body - but HCPms only sends the header data).
  • IV_TYPE - Mandatory, but it doesn't matter if it is "ID" or "DATA". This value is used to send the HTTP Body payload that is ignored by HCPms.
  • IR_POKE_DATA - If you want to send any additional data (such as OData Entity, email address), use this param - it will be alive in the header.
  • IV_ENTRIES_OF_INTEREST - This is a "Badge" value for push client API.

 

9.11.png

Please have a look at the complete code in the Appendix to go through those steps with push information (the push will send "Created!" text and its OData entity data), it is intended for embedding in the OData's "Create" method, so that when Create occurs, it sends the notification to the subscribers.

 

As another sample, ABAP report “/IWBEP/R_MGW_PUSH_TEST” demonstrates the notification transmission with FLIGHT sample data.

 

The notification format can be ATOM XML or JSON, which you must specify when you send the subscription request. For example, to receive notifications in the JSON format, send the value of the “Accept” HTTP header to “application/json”. By default, ATOM XML-formatted notifications are used. If your OData client creates a subscription via JSON, here's how it looks in the subscription table (NOTIF FORMAT field):


Note - XML format is preferred with /Notification/ Push URL. (JSON would not work)

9.10.png

Official help doc: SAP Gateway Notification Support

 

 

Appendix: Sample Code to Trigger Push

* Fixed values for /IWBEP/D_MGW_SUB table  CONSTANTS: lc_technical_group_name TYPE /iwbep/med_grp_technical_name VALUE 'Z_TRAVELAGENCY_SRV',                                lc_group_version        TYPE /iwbep/med_grp_version        VALUE 0001,             lc_collection           TYPE /iwbep/mgw_sub_collection     VALUE 'TravelAgencySet',
* The push text message             lc_text                 TYPE string                        VALUE 'Created!'.
* Vars for Subscriptions  DATA: lo_sub_registry  TYPE REF TO /iwbep/if_mgw_sub_registry,        lt_subscriptions TYPE        /iwbep/t_mgw_sub_data,
* Vars for Notifications        lo_notification_publisher TYPE REF TO /iwbep/if_mgw_notif_publisher,        ls_notification_endpoint  TYPE /iwbep/if_mgw_notif_publisher=>ty_s_notification_endpoint,        lt_notification_endpoints TYPE /iwbep/if_mgw_notif_publisher=>ty_t_notification_endpoint,        lr_data                   TYPE REF TO data,        lv_notification_type      TYPE char1,        lx_mgw_tech_exception     TYPE REF TO /iwbep/cx_mgw_tech_exception.  FIELD-SYMBOLS: <ls_subscription> TYPE /iwbep/s_mgw_sub_data.

* Permission for access to /IWBEP/D_MGW_SUB table
  AUTHORITY-CHECK OBJECT 'S_TABU_DIS'    ID 'ACTVT'     FIELD '02' " Activity: 02: Create, change, or delete    ID 'DICBERCLS' FIELD 'IWAD'. " Authorization Group: IW Admin  IF sy-subrc NE 0.    RAISE EXCEPTION TYPE /iwbep/cx_mgw_tech_exception      EXPORTING        textid = /iwbep/cx_mgw_tech_exception=>missing_authorization.  ENDIF.

* Type is either ID or Data (Full Payload) - for HCPms, it doesn't matter if it is "ID" or "DATA",
* as HTTP body will be ignored by /Notification/ Push URL of HCPms
  lv_notification_type = /iwbep/if_mgw_notif_publisher=>gcs_notification_types-id.
* Obtain /IWBEP/D_MGW_SUB table  lo_sub_registry = /iwbep/cl_mgw_sub_registry=>get_subscription_registry( ).
* Obtain a list of subscribers  lt_subscriptions = lo_sub_registry->get_subscriptions(                      iv_internal_service_name    = lc_technical_group_name                      iv_internal_service_version = lc_group_version                      iv_collection               = lc_collection ).
* Object to push  lo_notification_publisher = /iwbep/cl_mgw_notif_publisher=>get_notification_publisher( ).  LOOP AT lt_subscriptions ASSIGNING <ls_subscription>.    IF  <ls_subscription>-language IS INITIAL.      <ls_subscription>-language = sy-langu.    ENDIF.  ENDLOOP.
* For this case ls_entity set is already declared as "ls_entityset TYPE stravelag"
* entity data will be sent to the push client  GET REFERENCE OF ls_entityset INTO lr_data.
* Set the required params for push   lo_notification_publisher->create_notification_endpoints(    EXPORTING
* those two value are mandatory but ignored      is_data           = lr_data      iv_type           = lv_notification_type
* type "create"      iv_operation_type = /iwbep/if_mgw_notif_publisher=>gcs_operation_types-create
* push text       iv_text           = lc_text
* additional info (this example is entity data)       ir_poke_data = lr_data
* "Badge" value 
*      iv_entries_of_interest =      it_subscriptions  = lt_subscriptions    IMPORTING      et_notification_endpoints = lt_notification_endpoints ).

* Push the text message to relevant subscribers - this will create a bgRFC queue
  LOOP AT lt_notification_endpoints INTO ls_notification_endpoint.    TRY.      lo_notification_publisher->send_notifications(              is_notification_endpoint = ls_notification_endpoint ).    CATCH      /iwbep/cx_mgw_tech_exception INTO lx_mgw_tech_exception.    ENDTRY.  ENDLOOP.

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

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.

Function Import: Optional Parameters: Example


Introduction: OData $batch Processing with Content ID in SAP Gateway

$
0
0

cid_150.png

Dear all,


Thanks for your attention. If you are the one of frequent SCN readers, you would think I'm publishing yet another H2G blog :-) - yes this is important topic hence I wrote it.


Question.


Do you know OData? - Most likely yes.


Have you ever used OData? Most likely yes too.


And - do you know about "Content ID"? - Perhaps no.


"Content ID" is nothing new, it has been defined in the standard OData specification for a while, based on the idea that any OData app can take advantage of when building relationships between entities. A section of "Batch Processing" (2.2.1. Referencing Requests in a Change Set) describes what it is and how to use it - but without any context, you would have no idea when we use it.

 

Why we need this?


One very common use case is - OData providers need to support Content ID when we use Header-Items (or "Parent-Children") data with Offline Store of SMP3/HCPms OData SDK.

A_h_i.png

Let's have a quick look at how it works in an offline store. If you're familiar with Offline Store, it is nothing new. As an OData $batch request, we create a set of  header & item entities in the offline store locally. Each entity has its own create request via OData client API.

A_1.png

Here comes the interesting part. To add related child entities to a parent entity, you need to know, or be able to reference, the parent entity's ID.  The "Content ID" acts as a reference to the parent entity’s ID. As you see, a Content ID has a prefixed value with a "$" character.

A_id.png

For example, by using the Content ID referencing, you can refer the items with the resource navigation path "$100/ToItems". $100 indicates the header entity by using Content ID. As it is still created locally, those entities don't have any finalized key that will be given by the OData services.


Time to flush the local entities. These entities needs to be flushed via OData $batch request.

A_2.png

Once your $batch flush goes successfully, the OData services handle "Content ID" and assign key(s) to the entities for all the set of headers & items on the backend side. Most likely you want to do refresh too.

A_3.png

Got it? As you see, Content ID plays a critical role to handle header-item relationship with Offline Store during OData $batch processing. In other words -  to create child items for entities within a change set of $batch request.


To give you some more practical idea from the OData client SDK perspective, here's a small piece of code that demonstrates the idea in iOS API (Android, Windows, and Kapsel API follow the same rule):


01 SODataRequestParamBatchDefault *batch = [[SODataRequestParamBatchDefault alloc] init];
02 SODataRequestChangesetDefault *changeset = [[SODataRequestChangesetDefault alloc] init];
03    
04 SODataRequestParamSingleDefault *parentReq = [[SODataRequestParamSingleDefault alloc] initWithMode:SODataRequestModeCreate resourcePath:@"/HeaderSet"];
05 parentReq.payload = parentEntity;
06 parentReq.contentID = @"100";
07    
08 SODataRequestParamSingleDefault *childReq = [[SODataRequestParamSingleDefault alloc] initWithMode:SODataRequestModeCreate resourcePath:@"$100/ToItems"];
09 childReq.payload = childEntity;
10    
11 [changeset.requestParams addObject:parentReq];
12 [changeset.requestParams addObject:childReq];
13    
14 [batch.batchItems addObject:changeset];
15   
16 [store scheduleRequest:batch delegate:self];

#01 & #02:  creating a batch and changeset object.

#04 - #06: is for creating parent entity - as #04 indicates, it is a Header entity. You see the #06 that is assigning Content ID.

#08 - #09: for child entity. #08 indicates the child entityset is described as "$100/ToItems" that is navigation resource path from parent to children.

#11 - #16: execute a $batch request.


That's all the Content ID referencing from client perspective. Now you get the idea of what Content ID is - and the next question is how to implement OData services that support it.


The aim of the following H2G is how to implement OData $batch processing with Content ID in SAP Gateway.


Note: This introductory page focuses on the Offline Store in SMP3/HCPms OData SDK. However, Content ID Referencing could make sense (or useful) when we have these reasons in general:


  1. You want (or need) to create parent and one or more related child entities in the same transaction.
  2. You choose to use a OData $batch changeset.
  3. You choose to create the relationship by issuing a POST request to the navigation URL of the parent entity (rather than, for example, using a deep insert)
  4. You do not have enough information to construct the edit URL of the parent entity (because some part of the key is generated)


Perhaps another common use case in which we want to use Content ID is when we create a header-items data via HANA Cloud Integration. HCI supports $batch request as a runtime. My buddy colleague Midhun VP wrote a tip of how to execute the $batch call through HCI.

hci.png

Prerequisites


Content ID Referencing is supported in the following versions:

 

  • SAP Gateway 2.0 SP12+
  • SAP NetWeaver 740 SP13+
  • SAP NetWeaver 750


You have a skillset of building basic CRUD OData services with SAP Gateway Workbench (tx code: SEGW) as explained here: #1 - OData CRUD Crash Course - Getting ready with offline store


Are you ready? Let's hop in the implementation.

cid_circle_75.png

マコ参上

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

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

Does the Task Gateway service support subscriptions ? it's confusing to say the least

$
0
0

Try this :

 

(1) access the root service of an activated Task Gateway service on SAP NW Gateway (mine is SP09 and I am using version 2 of the Task Gateway service) - that should be a URL like : https://<myserver>.<mydomain>/sap/opu/odata/IWPGW/TASKPROCESSING;mo;v=2/


You will see a SubscriptionCollection and a NotificationCollection and the TaskCollection has an indicator saying it is subscribeable

 

(2) In SE24 locate the data provider class for the task gateway service (/IWPGW/CL_TGW_EDP_TASK_V2) and look at its inheritance tree

 

/IWPGW/CL_TGW_EDP_TASK_V2 inherits from /IWPGW/CL_TGW_EDP_TASK, which inherits from - surprise surprise - /IWBEP/CL_MGW_ABS_DATA

 

That's rather awkward cause - as the root service tells you the service supports subscriptions - one would normally expect to find an inheritance tree climbing up to the base class /IWBEP/CL_MGW_PUSH_ABS_DATA, as all other services do when they support subscriptions.

 

Not so with the Task Gateway service

 

(3) Use a REST client to try and create a subscription for the TaskCollection in the Task Gateway service

 

Result : KO, It doesn't work (at least not for my setup)

 

To summarize

=> OBSERVATIONS
(1) the root service tells you, you can subscribe to the TaskCollection in the Task Gateway service

(2) the provider class however doesn't appear to have the right inheritance to do so

(3) when trying to create a subscription, things blow up in your face (as you would expect considering (2), but not in an honest way cause (1) promises you, it can

 

=> QUESTIONS

(1) How to explain the availability of the SubscriptionCollection / NotificationCollection in the root service ?

(1) Are subscriptions supported or not - because of some technical limitation

(3) If one would like to subscribe to the TaskCollection in the Task Gateway, would it be possible to enable this by changing the inheritance tree ?

(2) If it can work, how does the subscription process work considering Task Gateway service is a moc (multiple origin composition) service - assuming that during the creation of a subscription, the gateway - according to SAP help - contacts the backend system to validate (authorize ?) the request.

need to enhance entity type properties from data model

$
0
0

Hello,



i work on "My Shopping Cart" SRM Fiori application.

I need to add a customer field among an entity type's properties. The ABAP structure type name is /SRMNXP/S_SC_HEADER:i added my CUF in its include  /SRMNXP/INCL_CUS_MINISC_HDR.

 

In SEGW, i created a Z project and i redefined the SAP GW OData technical service name /SRMNXP/SHOPPING_CART.

Then, i imported the properties from data source in order to add my CUF.

Finally, i generated the runtime objects (artifacts).


Nevertheless, data provider base and extension classes failed due to syntax error (The final class "/SRMNXP/CL_DATA_ACCESS_BASE" cannot have any subclasses).

What am i missing?


Moreover, after solving this point, is there any other steps to realize?


One final question: where can i look at standard entity types for a technical service (as the way displayed in SEGW after OData service redefinition?)


Thank you for you help.

 

Regards.

 

 

Laurent.

Media/MIME config in Vocabulary-based SEGW project

$
0
0

Dear Gurus,

 

 

I successfully implemented an SEGW  project with SAP Annotations already, which is working properly and managing attachments. Now I want to do the same within a project of Vocabulary-based annotations.

I got the error: 415 (Unsupported Media Type). This is due I do not know, how-to configure the entity and its properties in SEGW to set this entity as Media Type, I feel myself a bit lost.

What I already did, is that redefined the DEFINE method of Model Provider to set up the Property holding the Content Type:

 

  METHOD define.    super->define( ).    DATA(lo_entity_type) = model->get_entity_type( iv_entity_name = gc_attachment ).    IF lo_entity_type IS BOUND.      lo_entity_type->get_property( iv_property_name = 'MimeType' )->set_as_content_type( ).    ENDIF.  ENDMETHOD.

set MediaType for the MimeType property

05_entity_prop.png

set allowed file extensions

10_entity_allowe_types.png

 

and set MediaResource configuration, but unsuccessfully:

15_media_rsrc.png

 

 

I wiped the cache and got the same issue time to time in the standard, when processing a newly created entities. The processing in the gateway is dependent of  the following statement: lo_entity_type->has_stream( ), which is always false, and therefore the entity is evaluated not as a Media, and the exception 415 (Unsupported Media Type) is raised by the GateWay. Our release is GW 740sp11.

 

Any advise is welcome

 

Thank you

Cache Issue

$
0
0

Hi ,

 

I have a scenario where we need to read data from cache without hitting the Backend. in the first call the Query will be called and in second call the data should read from Cache. How can we achieve this at gateway ?


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

Deserialization of xml failed via transformation GetEntitySet

$
0
0

Hi experts

 

i'm implementing a SAPUI5 app, which should get some imformations from ECC side.

To do this, i've implemented a service which is working fine only for GetWEntity method:

/sap/opu/odata/sap/zfiori_read_orders_srv_02/EtOrdersSet('40504*')

 

I've set the service also for the GetEntitySet method, but the transformation which should deserialize the XML is failing.

calling the service in this way:

/sap/opu/odata/sap/zfiori_read_orders_srv_02/EtOrdersSet?$filter=Vbeln eq '4050344*', transformation get only the 5th char of the string, and in parameters i found VBELN = 0000040503.

 

The transformation is perfomed in this method:

/IWBEP/CL_MGW_REMOTE_HANDLER==CP   method DESERIALIZE_REQUEST.

 

 

DATA: lo_xml_reader  TYPE REF TO if_sxml_reader.

 

 

   IF iv_request_data IS NOT INITIAL.

 

     lo_xml_reader = create_xml_reader( iv_request_data ).

 

     CALL TRANSFORMATION id

        SOURCE XML lo_xml_reader

        RESULT     context        = es_request_context

                   entity         = ev_entity_data

                   model_id       = ev_model_id

                   language       = ev_language

                   text_keys      = et_text_keys

                   technical_name = ev_vocab_id

                   version        = ev_version.

 

   ENDIF.



Any help?


Best regards

Marco

getting error that --> '/IWFND/OM_MED_CATAL_ODC_0002_BE' '01' 'DEFAULT' does not exist

$
0
0

hi all

 

while accessing gateway from sap webide getting error that

 

Value    Data Provider implementation '/IWFND/OM_MED_CATAL_ODC_0002_BE' '01' 'DEFAULT' does not exist

 

 

please give need full information

Not Able To Upload PDF To DMS Using ODATA And SAPUI5

$
0
0

Hi Experts,

 

I have to upload pdf to DMS using Odata and SAPUI5,I googled and following these links.

 

1). http://scn.sap.com/community/gateway/blog/2013/08/14/how-to-upload-and-download-files-using-sap-nw-gateway

 

2). http://scn.sap.com/community/developer-center/front-end/blog/2014/07/28/upload-image-to-sap-gateway-and-display-image-in-ui5--using-new-fileuploader-with-sap-gateway

 

 

===========================================================================================================

 

Now i am explaining my procedure.

 

1). I have a FM which uploads the contents to DMS.

Import.PNG

2). In OData creation, Importing RFC and Defining mapping.

 

3). Defining MPC_EXT->Define method.

4).Defining  /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_STREAM class .

 

4). When i registering the in /iwfnd/maint_service getting error

define.PNG

 

I googled this error but can not find anything .

 

Thanks in advance.

 

 

CSRF-Token validation failed in an Odata / GW / SAPUI5 szenario

$
0
0

Hello experts!

We encounter a strange behavior in one of our developments and I wonder if of you can help me out:

 

On our development system (D) We set up a SAPUI5 application that communicates with our SAP-backend system via a gateway. It contains of GET and UPDATE methods.

Everything went fine on our development system - we did not enable or disable any CSRF-parameters in the SICF-nodes... it just went fine!

 

Now as we transfer our application to the quality-system (Q), the CSRF-token-validation failed!

We have checked the network-resources in the chrome browser and in fact no token is returned!

At this point we started to amend a couple of things, we set the parameter ~CHECK_CSRF_TOKEN in our service and our bsp to '1', we explicitly request the token in the GET method and provide it at POST (but this does not work as we didn't get a token at all  ....!), we changed the service URL from HTTP to HTTPS. Nothing worked in Q but everything worked in D!

 

Now comes the funny thing:

For testing reasons we have entered user and pw credentials at the bsp in SICF. As we tried to figure out if it could be a problem of authorization, we removed the user and entered it directly in the chrome-prompt that poped up as the system requests the page and then it works fine... even with the same user we entered at SICF!!!

 

Can anyone say anything to this?

Thanks a lot in advance!

Viewing all 2823 articles
Browse latest View live


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