SAPABAP

How does OData service works

OData services works through entity sets and entities. Data is represented in the form of Tables. Tables are referred as Entity sets and the lines of record are referred as entities. The Data is accessed through the following OData methods. These OData methods are referred as CRUD methods. OData Method Http Method Description and its …

How does OData service works Read More »

What is OData service in SAP

It is a http type protocol The protocol is between the other applications (Web browser etc) and SAP system. The OData-open data protocol supports two formats Atom and JSON. It can also be controlled in different ways through URLs. It follows the REST Architecture (Client/Server). The Data from the source side and the server side …

What is OData service in SAP Read More »

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 »