ABAYTHON

How to do Sorting and grouping in ALV Table through CL_SALV_SORTS

The sorting and grouping of data in ALV Table can be programmatically achieved. The method add_sort( ) of the class CL_SALV_SORTS can be used to sort or group the data. This sorting object is created from the get_sorts( ) method of the ALV Object. DATA lr_salv_sorts TYPE REF TO cl_salv_sorts. Lr_salv_sorts = lr_salv_table->get_sorts( ). Lr_salv_sorts->add_sort( …

How to do Sorting and grouping in ALV Table through CL_SALV_SORTS Read More »

How to do Aggregation using the class CL_SALV_AGGREGATION

The column of the ALV Display can be aggregated using the add_aggregation( ) method of the class CL_SALV_AGGREGATION. DATA lr_salv_aggregation TYPE REF TO cl_salv_aggregation. Lr_salv_aggregation = lr_salv_table=>get_aggregations( ). Lr_salv_aggregation->set_aggregation_before_items( abap_true ). Lr_salv_aggregation->add_aggregation( columnname = ‘AGE’                                                                 aggregation  =  if_salv_c_aggregation=>average ). The following aggregation types are available. If_salv_c_aggregation=>minimum. If_salv_c_aggregation=>maximum. If_salv_c_aggregation=>average. If_salv_c_aggregation=>total. If_salv_c_aggregation=>none.

How to fill icons in SAP ALV Display of type CL_SALV_TABLE

In order to fill icons in ALV Table, we must add an additional field of type ICON_D. The type ICON_D is of datatype CHAR with length 4. This is later filled with the icon code. Step1: Define the icon field TYPE-POOLS: icon. TYPES: BEGIN OF ty_contact.                   INCLUDE STRUCTURE ztt_db_table2.                   TYPES: icon_field …

How to fill icons in SAP ALV Display of type CL_SALV_TABLE Read More »

How to color the cells of SAP ALV Display of type CL_SALV_COLUMNS_TABLE

Step 1: Desired cells of the SAP ALV Display can be colored using the structure lvc_s_scol. The color codes must be set to each line of record. Therefore the structure of the ALV Display must be extended with the additional field with an internal table of type lvc_t_scol. TYPES: BEGIN OF ty_contact.               INCLUDE STRUCTURE …

How to color the cells of SAP ALV Display of type CL_SALV_COLUMNS_TABLE Read More »

How to color the complete column of the SAP ALV Display of type CL_SALV_COLUMN_TABLE

The method set_color of the class CL_SALV_COLUMN_TABLE can be used to color the column of SAP ALV Display. The color codes are much similar to old ALV Display of type CL_GUI_ALV_GRID DATA lr_all_columns TYPE REF TO cl_salv_columns_table. DATA lr_single_column TYPE REF TO cl_salv_column_table. Lr_all_columns = lr_salv_table->get_columns( ). Lr_single_column ?= lr_all_columns->get_column(‘CONTACT_NAME’). DATA ls_color_column TYPE lvc_s_scol. Ls_color_column-col …

How to color the complete column of the SAP ALV Display of type CL_SALV_COLUMN_TABLE Read More »

What is the difference between OOP and Functional programming

Parameter Object Oriented Programming Functional Programming Definition A programming paradigm based on the concept of objects which contains data in the form of fields called attributes and code in the form of methods A programming paradigm based on the concept of procedure calls Paradigm Approach Bottom-up Approach Top-down Approach Data Control In OOP data in …

What is the difference between OOP and Functional programming Read More »

What is the difference between check box and check box hotspot cell type in CL_SALV_TABLE?

Checkbox Checkbox Hotspot It is used just as a display of checkbox. It mentions that the particular line of record is selected. It can be used to trigger an event of type LINK_CLICK. The value of the checkbox cannot be changed. The value of checkbox can be changed. It is not used to manipulate the …

What is the difference between check box and check box hotspot cell type in CL_SALV_TABLE? Read More »

How to use various cell types in new SAP ALV Display of type CL_SALV_TABLE?

               The various cell types can be used both in container mode and complete mode. The cell types are constructed based on the Attribute of the Interface ‘IF_SALV_C_CELL_TYPE’. Type of cell Attribute of IF_SALV_C_CELL_TYPE Display mode container / complete Event Text => Text Both – Checkbox => Checkbox Both – Checkbox hotspot => checkbox_hotspot Both …

How to use various cell types in new SAP ALV Display of type CL_SALV_TABLE? Read More »

How to optimize the width of the column of type CL_SALV_COLUMNS_TABLE

               The width of the column is optimized through three methods. Optimize all columns. Optimize one single column. Manually set the width of columns. The optimization is based on the content of the ALV Table. Optimize all columns. In order to optimize all the columns of the ALV Table, call the set_optimize method of the …

How to optimize the width of the column of type CL_SALV_COLUMNS_TABLE Read More »

How to explain Method overloading and Method overriding in German language?

Method Overloading – Methoden überladung                Die Klasse hat mehrere Methoden mit dem selben Namen. Die Methode hat aber unterschiedlicher Signatur. Der Parameter hat verschiedene Datentyp. Die Anzahl der Parameter sind unterschiedlich. Method Overriding – Überschreiben der Methode                Überschreiben der Methode ist zwischen der Klasse. Die Methode von der übergeordneten Klasse wurde in der …

How to explain Method overloading and Method overriding in German language? Read More »