By this time we are optimistic that all the readers are conversant with the creation of Projects in SEGW, mapping of the Data Models, Navigation, Service creation and Testing URIs. Assuming that you have gone through the previous six tutorials on SAP Netweaver Gateway and OData Services. If you have not, please spare some time aside from your busy schedule and invest it on educating yourself in coming days. We believe, every ABAPer would need to have a good grasp of OData and SAPNetweaver Gateway development concepts.
Once we start working on real projects, our developments would not be as simple as shown in the tutorial exercises. We get weird errors/issues ranging from Authorization to Configuration to Code issues. As an ABAPer, we need to learn how to find the root cause of the issues and mitigate them. Today, let us venture further and understand how we will be handling these services, the issues and changes in actual real project scenarios.
In this article, I will help you understand how any developer will be able to track issues and defects in the OData models. What can be an ABAPer’s best friend when it comes to tracing the issues and fixing defects. You guessed it right. Debugging and Tracing Tools are ABAPer’s life lines. Let me show you how to debug and trace any service in SAP Netweaver Gateway.
1. Debugging OData Services
Let us consider the simple model as below.
To get the all Business Partner details the below URI is used.
Now if you want to debug the data just add the syntax ‘&sap-ds-debug=true’ at the end. And you thought you need to put ‘/h’. Right? You can still do that. 🙂 But passing ‘&sap-ds-debug=true’ parameter in the URL is more convenient while debugging services.
Hit Execute button on the top. The below screen appears with additional tabs like Body, Request, Response, Server and Runtime. Check each of the tabs to understand the features. Some of the relevant screenshots are below which are self-explanatory. If you still have questions, please feel free to write to us and we would be happy to elaborate them.
2. Trace OData Services
Below steps will help us understand how to trace any OData service.
Execute transaction ‘/IWFND/TRACES’.
Select the above 2 boxes and Press return/enter.
Now execute any query, say as below.
Go to Trace and hit Refresh.
Now check the ‘Performance Trace’ and ‘Payload Trace’ tabs.
i. Performance Trace
Double click on the above line. The below screenshot will be displayed.
The above image explains how much time each section in the process is taking.
Click on the 1st line and ‘Trace Details’ button.
It will give the trace details.
You can check the ‘Source Code’, ‘Payload Trace’, ‘Error Log’ etc.
Now click on the 2nd line of the trace log and check the ‘Trace Details’.
ii. Payload Trace
Double click on the above line.
Click on ‘HTTP Header’ in the above screen.
Click on ‘HTTP Body->Original Payload’.
3. Cache Cleanup
Run transaction ‘ /IWFND/CACHE_CLEANUP’.
Execute to Cleanup the Cache.
Sometimes after changing or fixing any code, the changes does not get reflected in the web browser. In such cases, Cache needs to be cleaned/refreshed. Do you remember, we have similar issues in Workflow changes as well? And we need to run one particular t-code to refresh the Workflow modification to take effect. What is the t-code? 🙂
4. F4 Help in OData Services
Sometimes we may need to leverage SAP Search Helps in the Web Server. Meaning, we want to implement the search functionality in our applications that consumes OData Services. We do not need to worry much. This can be easily achieved as shown below.
In your SEGW Project, Import the Search Help name (just like you import DDIC structure).
Hope this post would come handy to all ABAPers when they actually start to work on real projects. We all know there can be 101 bugs/issues in our applications. But as long as we know how to use the Trace and Debugging Tools to diagnose it, every bug can be terminated and every issue can be resolved.
Do you have anything to add to this article? Have you faced any issue understanding and working on OData? Do you want to share any real project requirement or solutions? Please do not hold back. Please leave your thoughts in the comment section.
If you GENUINELY like our articles then it would be a HUGE help if you subscribed and liked us on facebook. It might seem insignificant, but it helps more than you might think.
Thank you very much for your time!!
Do you have any tips or tricks to share? Do you want to write some articles at SAPYard? Please REGISTER and start posting and sharing your knowledge to the SAP world and get connected to your readers. Please check our simple guidelines for contributing your articles and receiving the gifts.
Step by Step Tutorials on SAP Netweaver Gateway and OData
- OData and SAP Netweaver Gateway. Part I. Introduction
- OData and SAP Netweaver Gateway. Part II. Create your first OData Service
- OData and SAP Netweaver Gateway. Part III. Query Options in OData Service URI
- OData and SAP Netweaver Gateway. Part IV. Association and Navigation in OData Service
- OData and SAP Netweaver Gateway. Part V. CRUD Operations in OData Services
- OData and SAP Netweaver Gateway. Part VI. Frequently Asked Questions
- OData and SAP Netweaver Gateway. Part VII. Debugging, Trace, Cache Cleanup and F4 Help
- OData and SAP Netweaver Gateway. Part VIII. SAP’s Love for OData – a Tale of the Friendly ABAPer
- ABAP on SAP HANA: Part XV. Expose CDS Views as OData Service through Annotation
- OData and SAP Netweaver Gateway. Part IX. How to Add Multiple Entities in One Operation in OData Service
- OData and SAP Netweaver Gateway. Part X. How to Delete OData Service from Service Catalog?
- OData and SAP Netweaver Gateway. Part XI. Query Options & HTTP Status Code Summary
- SAP Netweaver Gateway and OData. Part XII. Media Handling using OData Gateways
- SAP Netweaver Gateway and OData. Part XIII. Entity Tags in SAP OData Gateways
Also, Check Step by Step Tutorials on SAPUI5
- Journey to SAPUI5
- SAPUI5 Tutorial with WebIDE. Part I. How to Consume Custom OData in SAPUI5 Application
- SAPUI5 Tutorial with WebIDE. Part II. Routing and Navigation in SAPUI5 Application
- SAPUI5 Tutorial with WebIDE. Part III. Drop Down in SAPUI5 Applications (2 Methods)
- SAPUI5 Tutorial. Part IV with WebIDE. Routers and Routing in SAPUI5
- SAPUI5 Tutorial with WebIDE. Part V. Navigation in SAPUI5 without Routers
- SAPUI5 Tutorial with WebIDE. Part VI. Using Fragments in SAPUI5 Fiori Applications
- SAPUI5 Tutorial with WebIDE. Part VII. An ABAPer’s First SAPUI5 App in SAP WebIDE
- SAPUI5 Tutorial with WebIDE. Part VIII. Deploy my First SAPUI5 App in WebIDE
- SAPUI5 Tutorial with WebIDE. Part IX. Alternative to oModel.setSizeLimit()
- SAPUI5 Tutorial with WebIDE. Part X. Using Media Queries in UI5 Application
- SAPUI5 Tutorial with WebIDE. Part XI. An ABAPer’s Second SAPUI5 App
- SAPUI5 Tutorial with WebIDE. Part XII. SAPUI5 Basic Debugging for Beginners
- Routing and Navigation in SAP UI5 – Theoretical Explanation Part 1
- Routing and Navigation in SAP UI5 – Theoretical Explanation Part 2
We have a very active Telegram SAP Technical Group. Please join it using below link.
Telegram SAP Technical Discuss Group.
WhatsApp had the limitation of 256 members per group and we were finding a hard time syncing and maintaining information in multiple WhatsApp group. Therefore we have moved to Telegram as it can accommodate more than 10,000 users. Please join.