Quantcast
Channel: SCN: Message List - SAP Gateway
Viewing all 6105 articles
Browse latest View live

Re: Product Configuration with ODATA Service

$
0
0

HI Atanu,

 

thank you for your answer.

 

I adapted your approach and created an configuration  entity that represent a specifc configuration by defining the ordernumber (that reflects the configuration) as the key. So the EntitiySet for the configuration is virtually a collection of all possible configurations (not addressable of course). As an attribute of this entity I have a field called "status" that tells me exaclty the status of the configuration specified by the key (=order number).

 

Beside that I modelled entities for the characteristics and the values but again always with the order number as key.

 

Now I need to check if the peformance for the getEntitiy  implementation as I have to gather all information  again for each server roundtrip. Maybe I need to check on SharedObjects for this!.

 

Looking forward to your comments.

 

Br

Sebastian


Not able to upload file via OData Gateway services

$
0
0

Hi,

 

I have created an OData service for File Upload and Download.

I have created 2 tables i.e. 1st Table contains contact information and 2nd table contains the attachment. The Ref_ID field is the primary key in both tables. Using the same Tables I have created the below two Entity Types with Association/Navigation Between Them. I have marked the Second Entity as Media Type

 

Entity 1:

Image 2.JPG

Entity 2:

image4.JPG

 

Image3.JPG

 

I have Implemented the Create Stream Method as below:

 

DATA: ls_key_tab                   TYPE /iwbep/s_mgw_name_value_pair,

             lt_key_tab                   TYPE /iwbep/t_mgw_name_value_pair,

             ls_info                     TYPE ZBASIC_CONT_FILE,

             lv_refid                     TYPE zref_id.

 

   CASE iv_entity_name.

     WHEN 'ZBASIC_CONT_POA_FILE'.

       READ TABLE it_key_tab WITH KEY name = 'RefID' INTO ls_key_tab.

       SELECT SINGLE * FROM zbasic_cont_file INTO CORRESPONDING FIELDS OF ls_info WHERE ref_id = ls_key_tab-value.

       ls_info-ref_id = ls_key_tab-value.

       ls_info-poa_mtype = is_media_resource-mime_type.

       ls_info-poa = iv_slug.

       ls_info-poa_content = is_media_resource-value.

 

       MODIFY zbasic_cont_file FROM ls_info.

 

       copy_data_to_ref( EXPORTING is_data = ls_info

                         CHANGING  cr_data = er_entity ).

   ENDCASE.


While I executing the URL as below with Content-Type = application/atom+xml everything seems to be fine whereas when i set the Content-Type = application/pdf or any thing elsee eror is triggered as in below screenhot.


Error Screen:

image 5.JPG


Sucess Screen with Content Type as application/atom+xml

Image1.JPG


Kindly help to understand What am i doing wrong.


I have followed the Blog

http://scn.sap.com/community/gateway/blog/2014/07/25/uploading-files-to-sap-gw-downloading-files-from-sap-gw--new-techniques



Thanks in advance,

Samir

Re: Product Configuration with ODATA Service

$
0
0

In Gateway we have the tools for performance check. Please refer to http://help.sap.com/saphelp_gateway20sp09/helpdata/en/9d/da3a2ceca344cf85568ae927e9858d/content.htm

and

FAQ: Performance Trace

for further information.

 

However I did not understand the following part

 

Now I need to check if the peformance for the getEntitiy  implementation as I have to gather all information  again for each server roundtrip.

 

Is it not possible to overcome it by a custom expand or a batch operation ?

May be you can give a thought.

 

 

Regards,

Atanu

Re: Odata creation for standard reports(MB5B)

$
0
0

Hi Prabaharan,

 

If you use the SUBMIT keyword with an addition of 'WITH RETURN' the flow will return to the calling program. This keyword works in the following way: You have a calling program ZTEST1 and another executable program(or report) ZTEST2 which would be called from ZTEST1. So while calling the other report, you have following options:

  • to pass the selection screen parameter values in the background
  • to return in the calling program after execution. This is achieved by WITH RETURN. This would hold the session value of calling program and would continue execution from the next statement after calling the program. So this way ALV would not get displayed.

 

Regards,

Ekansh

Documents for SAP Gateway

$
0
0

Hi Gurus,

 

  I'm new to SAP Gateway. Request you to please share related documents for Starters.

 

  You help is much Appreciated.

 

Thank you.

Re: Documents for SAP Gateway

$
0
0

Check the forum. There are many documents already.

Thread locked.

Krishna (Moderator)

Re: adding entity set

$
0
0

There are many possibilities, the option to choose for depends on your need. May be you can consider the following options to clarify your requirement. First You need to answer

 

1. You have an OData service, you want to add a new EntitySet in the same service

2. You have an OData service, you want to add a new EntitySet using this service and create a new OData service


If you have clarified the above questions, then consider the following

3. You have an OData service, you want to add a new EntitySet in the same service based on some existing Entity

4.You have an OData service, you want to add a new EntitySet in the same service based on a new entity

 

Now you need to think,

5. If you create a new service then do you need the same old OData service URL or you want a new URL(so that you do not need to change the Fiori OData service).

 

There may be more aspects to think that I may be missing here

Re: adding entity set

$
0
0

Hi Atanu,

Thank you for answering.



In my scenario I have an OData service and i want to add a new EntitySet in the same service based on some existing Entity and i need the same old odata service url.


So is there some code that i have to write in my ui5 or should i make any changes in odata?



Fiori CRM My Opportunity App OData Error

$
0
0

Hi All,

 

We are trying to execute the OData Url for the Service CRM_Opportunity.

 

/sap/opu/odata/sap/CRM_OPPORTUNITY/$metadata - This metadata works fine. We are able to see all the entity and its structures.

 

This has an Entity - Opportunity.

 

When we try /sap/opu/odata/sap/CRM_Opportunity/Opportunity -  we are facing an error

"Resource not found for segment 'Opportunity'   

 

This has an Entity set - Opportunities.

 

When we try /sap/opu/odata/sap/CRM_Opportunity/Opportunities- we are not facing any error but the structure is not getting displayed.

 

Can we map the entity set to the URL?

 

We are using the SAP Gateway version

 

-UIX02CRM - Version 0002 - SAPK-10002INUIX02CRM

 

-UIX01EAP - Version 0003 - SAPK-10003INUIX01EAP

 

-SAP_GWFND  - Version 0008 - SAPK-74008INSAPGWFND

 

 

 

/sap/opu/odata/sap/CRM_OPPORTUNITY/Opportunity/?$format=xml -  we are not able to see any hyperlinks to the entity structures.

 

CRM app for My opportunity is working fine in FIORI lauchpad.

 

* Are we missing some SAP notes?

 

Please help.

 

Thanks,

Divya

OData service for Fiori app 'Maintenance Order' - Unable to load metadata

$
0
0

Hi,

 

I am new to Fiori/Gateway and I am trying to configure 'Maintenance Order' fiori app. When i click the tile, it is failing to launch the app and on debug, i found the below OData service metadata load is failing.

 

OData service: CB_MAINTENANCE_ORDER_SRV


I tried to load the metadata again through transaction /IWFND/MAINT_SERVICE, but it result in giving error message.


Error log says 'Metadata call for model SAPAPPLH~STANDARD~MAINTENANCE_ORDER_H~ was not succesfull.'


Is there any configuration required to make this work ? I see couple of gateway error's and below is the screenshot of that. Please guide to solve the issue.

 

Thanks and Regards,

Gaurav.

Redefined Service - New Entityset methods did not get created

$
0
0

Hello Experts,


I enhanced a standard service in SEGW and created 2 entity types and sets. Consistency Check and Runtime Aritifacts generation were successful. However, the new DPC_EXT class does not have CREATE_ENTITY, DELETE_ENTITY, GET_ENTITY, GET_ENTITYSET and UPDATE_ENTITY for the newly created Entity Sets. Instead, it shows me methods as - /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_ENTITY etc.


Image 222.png


I read in a lot of help documents and examples that these methods are created automatically in the form of <ENTITYSET_CREATE_ENTITY> , <ENTITYSET_GET_ENTITY> and should be REDEFINED as needed.


Redefining the DPC Implementation Class - SAP NetWeaver Gateway - SAP Library


Base Class: Data Provider Class - SAP NetWeaver Gateway - SAP Library

 

Implementation Class: Data Provider Class - SAP NetWeaver Gateway - SAP Library

 

What am I missing?


Thanks,

Rohan

Re: adding entity set

$
0
0

You can do it by using service builder. You need to go to the EntitySet node under the Data Model and create a new Entity set from the context menu option.

 

The other option can be to write code manually in the DEFINE method of Model Provider Extension class(*_MPC_EXT). The code may look like

 

Data:   lo_entity_type    TYPE REF TO /iwbep/if_mgw_odata_entity_typ,     
lo_entity_set     TYPE REF TO /iwbep/if_mgw_odata_entity_set. 
SUPER->DEFINE( ).
lo_entity_type = model->get_entity_type( iv_entity_name = 'ENTITY NAME' ). 
lo_entity_set = lo_entity_type->create_entity_set( 'NEW ENTITYSET NAME' ).
lo_entity_set->set_creatable( abap_false ).
lo_entity_set->set_updatable( abap_false ).
lo_entity_set->set_deletable( abap_false ).
 lo_entity_set->set_pageable( abap_false ).
 lo_entity_set->set_addressable( abap_false ).
 lo_entity_set->set_has_ftxt_search( abap_false ).
 lo_entity_set->set_subscribable( abap_false ).
 lo_entity_set->set_filter_required( abap_false ).

You can also find similar code in the Model Provider Class.

 

However if you are using service Service Builder to create your service, then you need to directly write the code in the above mentioned code in  DEFINE method of the Model Provider Class.  In this case you need not write SUPER->DEFINE().

 

After you make the changes, you need to clear the metadata cache by transaction /IWBEP/CACHE_CLEANUP and /IWFND/CACHE_CLEANUP.

 

 

 

At this stage you will see the entity set in the $metadata.

However you need to write code in Data Provider class(or Data Provider Extension class) to provision data for the entityset.

Re: Fiori CRM My Opportunity App OData Error

$
0
0

Hi Divya,

 

Using /sap/opu/odata/sap/CRM_Opportunity/Opportunity will not work as we have to use the entityset in the URL to access. You can not directly address an entity via URL. We always have to follow the entityset path.

 

Regards,

Ekansh

Re: Odata creation for standard reports(MB5B)

$
0
0

Hi Hussain,

 

I do not see any other direct method to use these reports for OData services. If you found any other options please share with us.

Can you please be more specific about the performance issue in this approach?

 

Regards,

Ekansh

Re: adding entity set

$
0
0

Thank you Atanu.I got it using the above procedure


Re: Lightweight consumption check "by OData" doesn't trigger service generation

$
0
0

Hi Reig,

 

Is this issue resolved?

I am facing same issue, can you explain how to solve this issue?

 

Thanks,

Raghava

Re: Redefined Service - New Entityset methods did not get created

Re: Redefined Service - New Entityset methods did not get created

$
0
0

Hi Rohan,

 

SEGW does unfortunately not create these methods if you add an entity set to a redefined service.

 

You have to implement the generic methods in your DPC_EXT class, check whether your newly created entity set is accessed.

 

If not you can call the method of the base class that will call the methods for the other entity sets of the redefined service.

 

Best Regards,

Andre

 

 

method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY.

DATA lv_entityset_name TYPE string.
DATA
lr_entity TYPE REF TO data.

lv_entityset_name=
io_tech_request_context->get_entity_set_name( ).

CASE
lv_entityset_name.

   WHEN ‘<
NewEntitySet>'.

  


   WHEN OTHERS.

 

super->

/iwbep/if_mgw_appl_srv_runtime~get_entity

(    EXPORTING
   …
  
   IMPORTING
   er_entity= er_entity ).
ENDCASE.

 

 

Re: Redefined Service - New Entityset methods did not get created

$
0
0

That makes sense. Thanks for your response, Andre.

Re: OData service for Fiori app 'Maintenance Order' - Unable to load metadata

Viewing all 6105 articles
Browse latest View live


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