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!!
Useful Tutorials in SAPYard
1. ABAP for SAP HANA Tutorials
2. ABAP Web Dynpro Tutorials
3. GOS Tutorial
4. OOPs ABAP Tutorial
5. HANA Tutorial
6. SAP Netweaver and OData Tutorial
7. SAP Adobe Form Tutorial
8. SAP Fiori Tutorial
9. SAPUI5 Tutorial
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.
About the author: Averi Sengupta
Averi is playing the role of Delivery Lead of an SAP Implementation project in IBM. She has more than thirteen years of SAP Technical experience. She is Subject Matter Expert in SAPScripts/Smartforms, Web Dynpro, Interfaces, HANA-ABAP and Mobility Area (OData).
Averi has excellent communication, interpersonal skills and leadership qualities. She has been handling multiple high visibility projects in IBM. She has worked in different SAP functional areas like MM, SD, FI, SRM, CRM and EHSM (Incident Management).
Find more about Averi Sengupta at LinkedIn.