COND, SWITCH, CASE, IF statement comparison

As far as i have discovered new commands coming with ABAP 7.4 (COND,SWITCH), i realized that they have some superiority over the old predecessors considering code repetition. Lately i have started to make use of COND command very often. The reason for that is SWITCH has same usage with CASE but has less code. Likewise COND provides declaring free conditions and accordingly assign a field value therefore has less code than IF. Below i have written very simple sample code for you to easily compare each of these commands.

consume REST oauth service from ABAP – with access token consume REST service with JSON data – part 2

In consume REST oauth service from ABAP – get access token in order to call main webservice – part 1 post, i had tried to explain how a key required by REST services can be obtained. In this step i will make use of this generated key so that i can call my real service. Here all i have to do is creating the body part of my JSON data, the rest is again using right methods of cl_http_client. After consuming service the response from the server will be processed and siutable message will be returned.

consume REST oauth service from ABAP – get access token in order to call main webservice – part 1

I have heard many things about REST, oauth, JSON and all these things. Finally i have to meet these terms this week. There was a third party tool which is provding a REST service and i have to consume it with ABAP. Interestingly i learnt that there is not any Enterprise Service infrastructure in order to call REST services. Therefore i had to use HTTP service objects within ABAP program library. cl_http_client is the main class for REST services. Calling a REST service is consist of two parts. In this post i will focust on the first part. It is getting access token which is required to successfully make main webservice and this is the second poart of REST service.

suppress all messages including success ones thrown from function module

Eventhough success messages are not disturbing flow of program, we know that they can also be avoided with a mystery way. I don’t know why SAP has hidden this exception but it is a very practical solution. I intentionally write a post named hidden exception choice for handling error messages in function modules . However this hidden exception is not only covering error messages but also success and information messages. That’s why i want to remind this subject.

EXPORT_TOO_MUCH_DATA runtime exception

When you want to pass data between different programs you make use of EXPORT/IMPORT FROM/TO MEMORY commands of ABAP. Unfortunately there is a limit for the size of data transferred with this command. I suppose it can be configured but for the SAP system i am working it is 2GB. Therefore when you want to pass an internal tables with many records there is a chance to exceed this limit and when it pass over the limit the program terminates with a EXPORT_TOO_MUCH_DATA exception and has a short text “Too much data for export”.