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

CSRF Token reports

$
0
0

Hi,

 

Are there any reports to monitor csrf tokens generated?

 

Reports for

1. CSRF token generated in a period

2. List of CSRF tokens active currently

3. Services & REST method with which a CSRF token was used

 

regards

Nitesh


Build Service from SEGW

$
0
0

Hi Experts,

 

 

We are trying to create a gateway Service through SEGW.

 

After Creating data Model and entities, i have generated the objects.

 

When I am trying to register the service, I can see the RFC destination is also generated, but that destination is created/Maintained nowhere.Please check the

 

attachment.This new RFC destination generation is standard behaviour?

 

When I tried to change the RFC destination also, my OK button is also disabled.

 

Have anyone faced this kind of issue.

 

 

Thanks and Regards,

 

Peter Dinesh.

Publishing an oData from CDS View with Parameters

$
0
0

Hi experts!

 

I have a CDS View with parameter that i want to publish as an oData service.

 

My view have two parameters:

 

     - GJAHR:GJAHR --> CHAR 04   

     - AFABE:AFABE_D --> CHAR 02

 

How i publish this CDS View in SEGW?

 

When i used an import by reference, it recognize the parameters, but when generating the class, i have an error (the class is generated with a blank type).

 

Ex.:

TYPES:

BEGIN OF tt_zcds_parameters.

INCLUDE TYPE . "no type is specified, and this generated an error in the class activating

 

Thanks!

Matheus Goulart

Update Annotation Model for Referenced Service

$
0
0

Hello,

 

I have the following scenario:

  • I have created a first project with SAP Annotations called Z1 and created some entities, arround 10.
  • Run time artefacts generated.
  • After these entities created, I build a second project called Z1_ANNOTATIONS as type 3 (Annotation Model for Referenced Service), with reference for project Z1 and created some notations.
  • Run time artefacts generated.
  • In a second moment, it's necessary create more one entity on Z1.

 

I not know why but I can't update the model Z1_ANNOTATIONS to recognize the new entity. The only way is destroy all notations and import the full service again - and it is not acceptable.

 

Anyone has another solution to update the annotation reference service with the new entity without lost all current annotations?

How do I display the SAP ODATA response with a nested JSON Structure??

$
0
0

Hi,

 

I have a requirement to display the JSON Response using a nested structure rather than a flat structure.

Kindly provide a solution for the same.

 

Thanks & Regards,

Thejus Singh J

Ph no. (91)9686557664

Error while access service

$
0
0

Hi there.

I'm trying to create my first fiori app using scn tutorials.

I've created a Odata service in "/IWFND/MAINT_SERVICE - Activate and Maintain Services", the system put it there

sap/opu/odata/sap/ZGW_RE_BU01_SRV

 

When i try to access it i get an error in chrome:

 

Call of service /sap/opu/odata/sap/zgw_re_bu01_srv terminated because of an error. The following error text was processed in system SID : Syntax error in program /IWFND/CL_SODATA_HTTP_HANDLER=CP .The error occurred on the application server SERVER. The termination type was: RABAX_STATE.If the termination type is RABAX_STATE, you will find more information on the cause of termination in system SID in transaction ST22. If the termination type is ABORT_MESSAGE_STATE, you will find more information on the cause of termination on the application server SERVERin transaction SM21. If the termination type is ERROR_MESSAGE_STATE, you can search for further information in the trace file for the work process in transaction ST11 on the application server . You may also need to analyze the trace files of other work processes. If you do not yet have a user ID, contact your system adminmistrator.

 

I've checked ST22 and found, then method HANDLE_CSRF_TOKEN is not inheritaded.

My service inheritate "Logon procedure" from upward service sap/opu/

I tried to deactivate ~CHECK_CSRF_TOKEN=0 but has no result.

Also i checked parameters in profiles:

login/accept_sso2_ticket = 1

login/create_sso2_ticket = 2

login/ticket_only_by_https = 0

 

my system is

SAP_GWFND 740 0004

 

What should i try next to have access to service? its local system, so i dont bother about security.

Thank you!

GET_ENTITYSET method code for BAPI_CUSTOMER_GETLIST with filter option

$
0
0

Hello Experts,

 

I am new to OData service creation and looking for sample code which can be used in order to implement GET_ENTITYSET function.

I am using BAPI- BAPI_CUSTOMER_GETLIST and scenario here is to filter certain set of customers from KNA1 table to display output.

 

Can any of you please help me with sample code to implement this method? I have below code which needs to be populated properly.

 

 

Thanks,

Megha

Gateway HTTPS issues

$
0
0

Hi All,

 

We developed a service to create customer in SAP. While trying to create customer using HTTP, we are able to create new customer using POST method. But, when we try to create customer using HTTPS using POST method, we are getting status_code 403.

 

HTTPS 'GET' is working but not 'PUT' and 'POST' methods.

 

HTTP 'GET', 'PUT' and 'POST' methods are working fine.

 

Here are the error Screenshots.

image003.jpg

While checking in Error Log.

image4.jpg

 

Instead of Service Name we are getting 'OPU' while using the HTTPS.

 

image5.png

Please help us to resolve the HTTPS issue while using 'POST' and 'PUT' methods.

 

Thank you in advance.

 

HariKrishna M


Issue while redefining BEx query in NW Gateway

$
0
0

Hi Friends,

 

I am trying to redefine a BEx query in Netweaver Gateway system using SEGW transaction, and MDX query option. I am getting the following error after step 2 (step 1 is selecting the catalog and query name, and step 2 is assigning model/service name)  :

 

Could not retrieve the Model Name 'Z_ODATASERVICE_2_MDL' and Version '0001'

 

I have already created one test odata service by redefining another query from the same system, but I was able to do it successfully. Any help on the error would be appreciated !

Consume Odata Service in ABAP CL_HTTP_CLIENT->CREATE_BY_DESTINATION

$
0
0

This blog would have not been possible, but for the awesome community that is SCN. I would like to thank every contributor ever for helping me out in my hours of need!.

 

I had tremendous help in navigating through my current requirement thanks to the below blog posts.

How to consume an OData service using OData Services Consumption and Integration (OSCI)

Thank you. Andre Fischer

 

Consuming an External RESTful Web Service with ABAP in Gateway

And Paul J. Modderman

 

both these blogs helped me understand the intricacies of the functionality that is Consuming an OData Service.

this Blog can be considered as an extension of the Blog by Paul J. Modderman.

 

we can consume a data service by using the method CREATE_BY_URL of the class CL_HTTP_CLIENT, but when authentication is involved this method was ill suited for it.

 

The CREATE_BY_DESTINATION method however enables us to store the Credentials in a more standard and secured fashion.

 

The Requirement:-

I needed to access an OData service that was exposed by HANA . It is required that we trigger this service from the ECC system and process the result.

 

The user would be logging in to ECC directly and not via portal, thus it would require the use of an RFC destination Login Credentials.

 

The Process:-

Step 1.

we have to create the RFC connection in SM59 as below.

 

  1. Go to TCode SM59
  2. Click on the create new connection button.
  3. Provide the description
  4. Choose the connection type as G.
  5. enter the Host name/port number(an Odata Service generally has a URL containing ".COM" followed by ":" Port Number)
    1. The  part until the ".com" without the HTTP:// is the host name
    2. The part after the ":" is the port number
  6. Enter any proxy details if a proxy is being used(we were not in my case)
  7. go to the Logon & Security tab
    1. CHoose the Basic Authentication Radio Button.
    2. Enter the logon credentials
  8. Save and click on connection test.
  9. If all setting are proper you should be able to see a webapage that is relevant to the Host you entered, in the Response Body/Response Text tabs.

 

Step2.

 

Now that we have created the RFC connection we proceed to the creation of the HTTP client .

 

to create the client we use the attached  code. CL_HTTP_CLIENT.txt.

 

 

DATA:   lo_http_client TYPE REF TO if_http_client,

        lv_service TYPE string,

        lv_result TYPE string.

 

 

"xml variables

DATA:    lo_ixml TYPE REF TO if_ixml,

        lo_streamfactory TYPE REF TO if_ixml_stream_factory,

        lo_istream TYPE REF TO if_ixml_istream,

        lo_document TYPE REF TO if_ixml_document,

        lo_parser TYPE REF TO if_ixml_parser,

        lo_weather_element TYPE REF TO if_ixml_element,

        lo_weather_nodes TYPE REF TO if_ixml_node_list,

        lo_curr_node TYPE REF TO if_ixml_node,

        lv_value TYPE string,

        lv_node_length TYPE i,

        lv_node_index TYPE i,

        lv_node_name TYPE string,

        lv_node_value TYPE string.

************************************************************************

* lv_ destination will be name of the RFC destination we created in SM59

************************************************************************

CALL METHOD cl_http_client=>create_by_destination

  EXPORTING

    destination              = lv_destination

  IMPORTING

    client                   = lo_http_client

  EXCEPTIONS

    argument_not_found       = 1

    destination_not_found    = 2

    destination_no_authority = 3

    plugin_not_active        = 4

    internal_error           = 5

    OTHERS                   = 6.

IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

 

*************************************************************************************************

* we need to build the URI, this is the part in the OData Service that comes after the port number

* This includes the Path and Query string for the service that is being called on the host.

* lv_uri holds the path and query string

*************************************************************************************************

 

CALL METHOD cl_http_utility=>set_request_uri

  EXPORTING

    request = lo_http_client->request

    uri     = lv_uri.

 

lo_http_client->receive(

  EXCEPTIONS

    http_communication_failure = 1

    http_invalid_state         = 2

    http_processing_failed     = 3 ).

 

**************************************************

* Making sense of the result parsing the XML

**************************************************

lv_result = lo_http_client->response->get_cdata( ).

 

lo_ixml = cl_ixml=>create( ).

lo_streamfactory = lo_ixml->create_stream_factory( ).

lo_istream = lo_streamfactory->create_istream_string(

                                 lv_result ).

lo_document = lo_ixml->create_document( ).

lo_parser = lo_ixml->create_parser(

                       stream_factory = lo_streamfactory

                       istream        = lo_istream

                       document       = lo_document ).

 

 

 

 

"This actually makes the XML document navigable

lo_parser->parse( ).

DATA: lv_name TYPE string.

"Navigate XML to nodes we want to process

*lo_weather_element = lo_document->get_root_element( ).

lv_name = 'content'.

lo_weather_element = lo_document->find_from_name( lv_name ).

lo_weather_nodes = lo_weather_element->get_children( ).

 

 

 

 

"Move through the nodes and assign appropriate values to export

lv_node_length = lo_weather_nodes->get_length( ).

lv_node_index = 0.

 

 

 

 

WHILE lv_node_index < lv_node_length.

  lo_curr_node = lo_weather_nodes->get_item( lv_node_index ).

  lv_node_name = lo_curr_node->get_name( ).

  lv_node_value = lo_curr_node->get_value( ).

  ADD 1 TO lv_node_index.

ENDWHILE.



Hope this Helps!, let me know if i can clarify further.


Peace!!!!

How can SAP Odata Service receive payloads in JSON format?

$
0
0

Hi all,

 

I have a requirement to make my SAP OData service receive JSON payload as well ?

 

How can i achieve this?

 

Thanks & Regards,

Thejus Singh J

SAP GW - Orchestration

$
0
0

Hi guys, well, the thing is this. We are in a mobile development project with a mobile application that works offline most of the time.

 

In this app, the employee fills the business partner data (not yet created in backend) and then fills the opportunity data (also not yet created in the backend) and relates the opportunity to 1:N business partners. The thing is that the request is handled in batch request, first are sent the business partners requests to the backend and then the request related to the opportunity, the thing is that the business partner should be validated in a business workflow in CRM before the creation of the opportunity and this business partner validation could take 1 day, that means, the opportunity request are sent milisenconds after the business partners requests but in most of the cases I don´t have a business partner created yet. How do I orchestrate this? should we use something standard from GW or do we need to build a custom queue system or something like that.

 

Any help will be appreciated.

 

Thanks .

Code snippet for adding annotations to your Gateway Service

$
0
0

Now that annotations are making UI5 development easier by using Smart controls, it is important to learn how to add these annotations to your service. SEGW does not yet allow you to add most of the annotations. Till SEGW inherently provides that feature, here is how you can do it using code.

 

Step 1. Goto you MPC_EXT class

 

Step 2. Redefine Define method.

 

Step 3. Write this code.

 

    super->define( ). "Ensure you call the parent metadata

    lo_entity_type = model->get_entity_type( iv_entity_name = 'EmpDetail'). "Your Entity Name

    lo_property = lo_entity_type->get_property( iv_property_name = 'DateOfHire'). "Property inside your Entity

    lo_annotation = lo_property-/iwbep/if_mgw_odata_annotatabl~create_annotation( /iwbep/if_mgw_med_odata_types=>gc_sap_namespace ). "SAP's annotations

    lo_annotation->add( iv_key = 'display-format' iv_value = 'Date' ). "Specific annotation you want to add.

 

This will result in

Annotation.PNG

How to annotate an OData Attribute with sap:display-format="Date"

$
0
0

Hello experts,

 

for a Fiori SmartFilterBar I need an Edm.DateTime attribute to be recognized as a Date field.

Intention: From the annotation the Filterbar recognizes, that a Datepicker needs to be displayed.

 

I got the idea with the Annotation from here:

Re: Rules for OData datetime properties

 

 

The Annotation (display-format) is of course mentioned here:

SAP Annotations for OData Version 2.0

 

 

I do not see any option to set this Annotation for my attribute in transaction segw.

The explanations on the second link confused me quite a bit.

 

Any hints appreciated.

Namespace not found for Service

$
0
0

  Hello together,

 

I transported a service with system alias to Quality System and the Model is in the View /IWFND/V_MGDPIM and has the same name like in the developement system. If I test the service I got nevertheless this error message:

 

<code>SY/530</code>

No service found for namespace ...

 

What did I forgot?


Gateway service call not triggering DPC_EXT class

$
0
0


Hi,

 

I have created a gateway project and have implemented the DPC_ EXT method of getentityset. While testing in Gateway client I am getting status 200 for the service call [/sap/opu/odata/sap/ZTEST_SRV/EmpolyeeadressSet?$filter=Pernr eq'00000012'], but there is no data in results object. I have put external debugger for my user in the DPC_EXT ->EmployeeadressSet_getentityset method, but not getting triggered even as iam testing the service with my userid. (Gateway is implemented as Hub. Trusted RFC connection has login user configured. Was able to debug gateway services of standard fiori apps previously in the same way ).

 

thanks in advance

Issue with tree structure

$
0
0

Hi Experts,

 

I have created a SAPUI5 application which mock json data, the master page is in tree structure as shown in image, image1 which is working fine.

 

image.png

 

image (1).png

 

The excel sheet snapshot is my mock json representation, using this data only i am creating my mock json.

 

image (2).png

Now the same application has to be build using odata service as backend(without using mock json data). How could i able to give my master page view as a tree structure in a odata service. Please guide me and help me.

ODATA in Post method

$
0
0

Hello Team,

 

     I am using SPS 10 ODATA service . From HTML perspective, the link which i am generating is GET method .

     Sample link : https://<hostname>/<path>/<odata file name>.xsodata/InputParams(<input parameters)/Results?$format=json

 

     In the above mentioned link has input parameters also. Instead of this  , How to pass the input parameters in the HTML body which is like POST method ?

 

     Note : In future, we no need to modify this link if there is an addition / removal of parameters .

 

Thanks

Saravanan TN

Real life example of upgrading a 3-tier NetWeaver Gateway landscape

$
0
0

Introduction

 

This blog shares our experience of upgrading a 3-tier NetWeaver Gateway landscape, pointing out the challenges we faced and how we were able to solve them.

 

Source Landscape

 

Existing 3-tier landscape with NetWeaver Gateway 2.00 SP 07 (NetWeaver 7.31 SP 09) in a central hub deployment model. Applications are connecting to a CRM 7.0 EHP1 system with NetWeaver Gateway 2.00 SP 07 backend components.

 

Target Landscape

 

Existing 3-tier landscape with SAP Gateway 7.40 SP 13 in a central hub deployment model. No changes to backend systems.

 

Upgrade Strategy

 

Execute a in-place upgrade. Start with sandbox systems, which are recent copies of respective production systems.

 

Initial Plan

 

According to SAP note 1830198 systems can be independently upgraded, upgrading Gateway doesn't require one to upgrade the backend components of the connected backend systems, assuming sufficient SP levels exist both in the Gateway and the backend systems. In our case we met the SP level requirements. The plan was not to upgrade the backend components.

 

Challenges

 

As soon as we had upgraded sandbox, we realized that our existing Gateway services didn't work anymore. More specifically, none of the services leveraging filter functionality worked. In addition there were issues with currencies that used to work that no longer worked.

 

Troubleshooting

 

Debugging the filter problem we found out that passing filter values got broken by the upgrade, values were being truncated. Looking into it in detail, we found SAP note 2205402 which we applied on both the Gateway system as well as the backend system, as instructed by the SAP note. This however wasn't sufficient. Since the corrections are partly contained in 740/13, we had to also implement SAP notes 2232883 and 2241188 on the Gateway system. Even that wasn't sufficient, we had to also implement SAP note 2245413 in the backend system.

 

Applying the SAP notes fixed the issues with filter functionality. The issue with currencies is explained in SAP note 2028852. We chose to change the applications in order to avoid the decimal problems described in the SAP note.

 

New Plan

 

In order to apply the SAP notes required to fix the issues with filtering, we had to also update the backend components to 2.00 SP 11. The new plan is to execute the in-place upgrade of NetWeaver Gateway and update the backend components.

 

Conclusion

 

I'm sure breaking compatibility or interoperability wasn't on SAP's radar but it happened. I have contacted SAP Gateway Product Management but I haven't yet been provided with an official explanation. In our case a simple technical upgrade of NetWeaver Gateway turned into a full-fledged upgrade project.

 

Takeaways

 

Take everything with a grain of salt, even official information can't be trusted. Test and validate everything yourself, preferably in a sandbox environment.

 

We are currently executing the new plan in our development landscape. I will update this blog should we run into other issues.

Slacking Off (1 of 3)

$
0
0

(This is part 1 of a 3 part series. See Part 2 and Part 3 for the whole story.)

 

Did you ever have a late night instant message conversation that went something like this:

 

Screen Shot 2016-03-18 at 12.55.42 PM.png

 

It’s no fun to be in that conversation. You know you’re stuck sitting in front of a screen for at least the next 10 minutes. And since it’s your work laptop you know that the corporate internet police won’t even let you browse reddit for cat pictures while you wait for VPN and SAP GUI to load up. More so, you know that whatever this person is yelling about is probably not your fault.

 

I’ve been there, trust me.

 

What if your conversation could look like this, instead:

 

Screen Shot 2016-03-18 at 12.59.54 PM.png

 

Did you notice Commander Data interject in that exchange? More on that later.

 

As nerds our jobs often involve performing routine technical tasks for people who use our systems. Maybe you reset a lot of passwords, check the status of integrations, or respond to a support inbox. You probably have loads of different communication tools at your disposal. Chat, email, carrier pigeons…whatever gets the job done. If someone needs your help they’ll generally find a way to get in front of you. Digitally or otherwise.

 

One of the coolest communication tools I’ve worked with in the last couple years is Slack. It’s got individual conversations, group chats, categories, and anything you’d expect from a team chat tool. It’s quickly overtaken email as my preferred method of talking with colleagues.

 

Except it’s way more than chat. Slack allows you to use pre-built integrations to look at your Jira tasks, GitHub commits, and thousands of other things. What’s even better: you can make your own integrations that interact with its web API. Which makes it the perfect thing to plug into your SAP Gateway to make use of the REST APIs you’ve already created for other purposes.

 

In my next couple posts, I’ll show you how to make exactly what I did above using (nearly) free tools.

 

Slack Setup

If you're not using Slack already, you can get a free account. It's very simple and straightforward. Once you've got an account, follow these steps to set up the Slack end of this chain:

 

  • I set this up as a Slash Command. That's where the "/ask-sap" piece comes from in my chat transcript above. Go here to set a new one up for yourself.
  • On the next screen, choose the command that you want to use, starting with a '/' character. You can use /ask-sap if you want to stay perfectly within the tutorial, since these custom commands are for your own Slack team only.
  • Click the "Add integration" button.
  • Screen Shot 2016-03-18 at 1.36.36 AM.png
  • On the next page, pay close attention to the "Outgoing Data" and the "Token" sections. You may want to copy or screenshot them for reference later.
  • The only thing that absolutely has to be filled-in is the URL field. This has to be an https destination that you own or have control of, and it has to be an endpoint programmable by you. Post 2 of 3 in this series will show you how to set that up in Google App Engine - but you could realistically do it anywhere you have the rights to set up programs to run on a web server.
  • Click "Add integration" at the bottom of the page, filling out whatever else you want to along the way. I suggest at least showing your command in the autocomplete list.

 

What you just did set it up so that Slack will respond to any message that starts with "/ask-sap" by sending an HTTP POST to the URL you provided in the settings. The format of the POST it sends will look like the "Outgoing Data" section that you saw in the setup process. For this demo, the most important pieces are the token and text fields.

 

That's it! You now have a Slash Command available in any of your Slack channels. It won't do anything yet, but that's what we'll set up in the next section.

 

On to Part 2!

Viewing all 2823 articles
Browse latest View live


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