ABAYTHON

What is the difference between overloading and overriding in OOPs?

Description Overloading Overriding Achieved It is achieved by having different methods with the same name and different signature It is achieved by redefining the method in the sub class. The class is originally defined in the super class. Same The methods names are the same. Only the signature varies. The method definition (name) including the …

What is the difference between overloading and overriding in OOPs? Read More »

How to set the column position using the class CL_SALV_COLUMNS_TABLE?

The column position in the ALV Display can be controlled using the set_column_position method of the class CL_SALV_COLUMNS_TABLE. There are two parameter used in the method call. The column name identifies the column to be positioned. The position parameter mentions the position of the column in ALV Display. Let us look at the following example: …

How to set the column position using the class CL_SALV_COLUMNS_TABLE? Read More »

What is the difference between data reference and object reference in SAP ABAP

PARAMETER DATA OBJECT DEFINITION DATA lr_ref TYPE REF TO data. DATA lr_object TYPE REF TO object. CREATION CREATE DATA lr_ref TYPE REF TO (‘ZIF_INSTANCE’). CREATE OBJECT lr_object TYPE (‘ZCL_CLASS’). DEREFERENCE It can be dereferenced. The object or any value can be assigned to dereferenced reference variable.lr_ref->* = lr_object Object references cannot be dereferenced. This notation …

What is the difference between data reference and object reference in SAP ABAP Read More »

How to create an object dynamically in SAP ABAP

Name of the class: ZTC_CHECK_CLS. Name of the method: METHOD_ONE. DATA lr_check_cls TYPE REF TO object. CREATE OBJECT lr_check_cls TYPE (‘ZTC_CHECK_CLS’). CALL METHOD (‘ZTC_CHECK_CLS’)->(‘METHOD_ONE’). If the class ‘ZTC_CHECK_CLS’ is not available in your repository. it will throw a runtime error as the object is created only during the runtime.

How to rename columns in SAP ALV DISPLAY of type CL_SALV_COLUMNS_TABLE.

The columns can be renamed with the object of the class cl_salv_column_table. There are four methods available such as SET_SHORT_TEXT (), SET_MEDIUM_TEXT(), SET_LONG_TEXT and SET_TOOLTIP(). The method can be chosen based on our requirement of text length. DATA lr_salv_columns_table TYPE REF TO cl_salv_columns_table. DATA lr_salv_column_table TYPE REF TO cl_salv_column_table. DATA lv_short_text TYPE scrtext_s. DATA lv_medium_text …

How to rename columns in SAP ALV DISPLAY of type CL_SALV_COLUMNS_TABLE. Read More »

How to insert and delete column in SAP ALV Display of type CL_SALV_TABLE.

The column is inserted through the field catalog of the ALV Table. It is set during the method call FACTORY (). Step1: Extend the structure either locally or globally through the Transaction SE11 with the additional field. TYPES: BEGIN OF ty_contact.                             INCLUDE STRUCTURE ztt_db_table2.                             TYPES: contact_age TYPE ZDE_contact_age.               END OF …

How to insert and delete column in SAP ALV Display of type CL_SALV_TABLE. Read More »

How to hide the column in new SAP ALV Display of type CL_SALV_COLUMNS_TABLE

The column can be edited using the column object. The Column object can be retrieved from the get_columns( ) method of the ALV object. Step1: Get the columns object from the ALV object. DATA lr_columns TYPE REF TO cl_salv_columns_table. Lr_columns = lr_alv_object->get_columns( ). Step2: From the columns object, get the particular specific column object ‘CONTACT_ID’. …

How to hide the column in new SAP ALV Display of type CL_SALV_COLUMNS_TABLE Read More »

How to use events of class CL_SALV_EVENTS_TABLE in SAP ABAP ALV Display

The new ALV Display provides different events based on the class CL_SALV_EVENTS_TABLE. It is much lesser compared to the old ALV Display. The Events can be found in the ‘Events’ tab of the class. Let us discuss about the following important Events of the class CL_SALV_EVENTS_TABLE. Events Description DOUBLE_CLICK This event will be triggered, when …

How to use events of class CL_SALV_EVENTS_TABLE in SAP ABAP ALV Display Read More »

How to insert functions to the Functions toolbar of new SAP ALV Display CL_SALV_TABLE

The new ALV Display based on the class CL_SALV_TABLE offers you the possibility to add a new function. It is completely based on the Display mode. In the container mode, the function is added through the functions object. In the complete mode, it is added through the GUI status for the Dynpro. Adding functions in …

How to insert functions to the Functions toolbar of new SAP ALV Display CL_SALV_TABLE Read More »

How to activate the functions Toolbar of new ALV Display CL_SALV_TABLE

By default, the function toolbar is not displayed in the new ALV Display. It must be activated. The functions object is retrieved from the ALV Object. In order to activate the complete function toolbar, the set_all( ) method of the function object must be called. DATA lr_functions_list TYPE REF TO cl_salv_functions_list. lr_functions_list = lr_alv_object->get_functions( ). …

How to activate the functions Toolbar of new ALV Display CL_SALV_TABLE Read More »