Quantcast
Channel: SCN : Blog List - ABAP Development
Viewing all articles
Browse latest Browse all 943

Some handy ABAP tricks

$
0
0

I am sharing some very useful ABAP tricks which I came across. Again, these might not be new for some people but still some of us are not aware of it.

 

"Somewhere, something incredible is waiting to be known"

 

Un-typed Field symbols


While dealing with un-typed field symbols of type ANY or ANY TABLE without any structure, I have seen most of people moving the data from the field symbols to an internal table and then the data manipulations are done on internal table.

1.JPG

While I came across a simple method of using field symbol while sorting and reading the data. We can specify the field name inside ('Field name'). Doing this we can avoid the intermediate internal table and instead directly operate on the field symbol.

2.JPG

Similarly, we can use it for READ also.

 

Find the Enhancement name from the user-exit function module name.

While activating a customer exit, we need to have the SAP enhancement name to activate in CMOD. Now, it might be difficult to find out the SAP enhancement name from the function module name from the package name (traditional approach). A package name might have 100 or more exits enhancements and it might become herculean task.

 

SAP has provided a table MODSAP wherein we can give the function module name and it will return the enhancement name. Then we can directly use the enhancement name to activate the exit.

3.JPG

Change status of any IDoc.


We can't reprocess any successful idoc with 53 status. Now either way is we create a new idoc through WE19 and test again but that will generate a new idoc number or there might be a another scenario where few idocs are stuck in inbound queue. We can directly change the status of idocs in such cases and the successful idocs can be reprocessed again.

 

4.JPG

 

For that execute a report RC1_IDOC_SET_STATUS, provide the idoc number, old idoc status and new idoc status. There is also a test mode available to check if the new idoc status is possible.

 

Insert custom values in standard domains fixed values.


We can add our own custom values to the fixed values of the data dictionary standard domains. Like if we are creating a new custom status and we need to append the status to the domain.
5.JPG

In the menu bar navigate to Goto > Fixed Value Append

6.jpg

Provide the append name and the specify the fields.

7.JPG

8.JPG

 

Performance tip while using FOR ALL ENTRIES when the data becomes large


While I was doing the performance analysis of a code in SAT tool, I noticed a strange thing while using FOR ALL ENTRIES. When the data in the FOR ALL ENTRIES tables becomes huge close to 100 thousand or more, in such cases it is better to fetch the whole data of the table instead of using FOR ALL ENTRIES. I notices a significant change in the above case.

 

But I must say this is not a conclusion but a subjective observation and it might be helpful in some cases.


Viewing all articles
Browse latest Browse all 943

Trending Articles



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