Monday, March 28, 2011

By reference or by value?

Probably, you have already used an ABAP method parameters. In OOP world, a method is a behavior wherein all parameters/variables accompanying it should have there own memory allocation or should be initialized. In ABAP method, you have an option in terms of parameters. It is either passing it by value or by reference. Ok, let's take a closer look of the difference between the two.

Searching ABAP codes for this word

There are some cases wherein we forgot to remember the name of our program that uses a certain line of codes. As a programmer, I used to work in a platform i.e unix that has a capability to search words or phrases in the entire directory of the program repository (COBOL in my case).

Sunday, March 27, 2011

Creating a Non class-based exception

Non class-based exception can be used in functions and methods. Below I will show you how.

Thursday, March 24, 2011

Blueprinting - Gathering requirements in SAP

Gathering requirements depends on the project and the size of the organization you are working with. There is no hard and fast rule as long as you finished your job on time and meets the user requirements.

Wednesday, March 23, 2011

Headache gone with SAP ICM (Incentives and Commission Management)

Many corporations today rely on spreadsheet or home grown applications which is very tedious to maintain esp. for the programmers due for example to ever changing alignment of marketing strategies which affect the setup for incentives and commissions of business partners/sellers/vendors/agents etc.

Monday, March 21, 2011

ABAP Exceptions

Knowing the types of exception handling in ABAP could be helpful in your application.

Trade-off in SE30 Runtime Analysis Evaluation Result

They say that programmers when developing apps/reports should see to it that the ABAP resources are utilized the most compared to DATABASE and SYSTEM resources. But, all throughout my

Sunday, March 20, 2011

OOP ALV toolbar button exclusion

A while ago after reading some stuff in SAP SDN site, I stumbled over this exclusion of alv toolbar buttons and found this pdf guide very useful, courtesy of

Thursday, March 17, 2011

Cluster Table reading

Points to Ponder:

1. It's better to read cluster table like BSEG without FOR ALL ENTRIES addition for better performance.
2. Put necessary static filters
3. As much as possible, compare all primary key or at least include the foreign keys

Wednesday, March 16, 2011

Optimization - Avoid DB access inside LOOP

Rule of thumb:

When dealing with large volume of records or involving several db tables, the best practice is to free your loop statement with db access. As much as possible, work with your internal tables or abap read table statement.

Watch out for my next blog.

Tuesday, March 15, 2011

ABAP FOR ALL Entries much better!

This morning, I have stumbled over this FOR ALL ENTRIES as I got missing entries on my result set.
I noticed that including FOR ALL ENTRIES statement resulted in a deletion of a duplicate records. Also, take note that if the internal table is blank, all entries will be considered in your table being selected.


1. The primary key fields of the driver table should all be included to avoid duplicate of records.

2.  Use all keys of driver table against the db table.

2. Sort the driver table by its keys.

EX. If you want to get the hkont field in EKKN table, always include the ebeln and ebelp key fields.

SORT at_it_ekpo by ebeln. "

INTO at_it_ekkn FROM ekkn
WHERE ebeln = at_it_ekpo-ebeln.

FOR ALL ENTRIES is like a join statement in open sql. This is a good alternative to minimize DB resources in your program.

Sunday, March 13, 2011

Internal Table control level processing

PREREQUISITE: Sort your internal table by the fields used in the control command

This is very useful when dealing reports!

ALV Splitter Screen Create Header

Steps in creating a header in a splitter screen:

DYNAMIC Open SQL statement

Just this morning I have created a dynamic sql. I have a sample code below:

Saturday, March 12, 2011

ABAP Parameters

I recommend for ABAPers to as much as possible create your data types as global by creating it in se11 to avoid constraint later on esp. if you are doing applications that involve SF and ALV.

Friday, March 11, 2011

OOP ALV splitter screen

Custom container can be divided into parts by a splitter screen class. Usually, developers can create different panel within a custom container to separate its selection screen header or the ALV data itself.

ABAP creating audit trail by change document table CDPOS CDHDR

There are some cases wherein you may want to create an audit trail or a history/log for your application. One way of doing this is by utilizing the CDPOS and CDHDR table by generating a program by it.

My banner

Thursday, March 10, 2011

OOP ALV events

Lately, I always practice to develop my applications in OOP ALV. By using cl_gui_alv_grid class compared to the FM reuse_alv_grid*, I noticed that the former uses EVENTS for the buttons or the mouse clicks to capture user actions over the alv.

To learn more about this events, please download the guide here from SAP AG itself. To give you an idea about this reference, it contains and lists the basic guidelines in using cl_gui_alv_grid. Some of the codes that for example to capture event DATA_CHANGED is not being explained here.

To trigger the data changed event, you may insert the code below and you can set the action you may want your event be triggered:

"activate data_changed 
  CALL METHOD g_alv_grid_ref->register_edit_event
      i_event_id = cl_gui_alv_grid=>mc_evt_enter  
"trigger event after ENTER is pressed
*    i_event_id = cl_gui_alv_grid=>MC_EVT_MODIFIED  
"or trigger once you go to next cell after modification 
(without pressing ENTER)
      error      = 1
      OTHERS     = 2.

Thank you!

ALV Object Model (OM)

Hi Guys, so far at least there are different types of approach in developing or creating an ALV depending on your needs and objective. One of them is called ALV Object Model which has been around for some time. This type of ALV can be created using a cl_salv_table class - a wrapper class of the previous ALV classes.

Wednesday, March 09, 2011

Internal Table Facts

Internal table with header line
   - With header line, the internal table has a header structure that works as a work area and a body that contains the details or the data itself.

Tuesday, March 08, 2011

Connecting MM, PS, & FI/CO modules

Table association between 3 modules modules:

Finding SAP tables

There are some cases wherein you have difficulties in looking for a table where the field belongs that appears in any SAP screen. One way of finding it is through ST05.

Debugging a dialog in SAP

There are some ways in debugging SAP when a dialog pop-up appears. Usually "/h" doesn't have an effect in the case when you transact via a pop-up, dialog, etc.

Adding an Image in a dialog

There are some cases wherein you may want to display an image in a sap dialog. In this topic I will show you how this can be done.

Reporting using ALV in OOP

In this topic I will show you how to generate a report using ALV in OOP. 



I will give you some basic idea regarding creating programs/applications in ABAP using OOP.

Friday, March 04, 2011

Debugging - sapscript

I will show you how to debug a transaction to be able to trace if what sapscript is being used.

Field symbols - the advantage


Good day to all, this is my first blog ever. Hope you will find this useful as I will start from this topic -> abap field-symbols.