Posts

Showing posts from June, 2022

Table Expression ( Read Alternative ) ABAP 7.4 and 7.5

Image
*&---------------------------------------------------------------------* *& Report z_table_expression *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT z_table_expression. *1. Segment read with index *(a)Simple read with index *(b)Read index with table expression *(c)table expression without try catch  using value  operator *(d)table expression with assign fs *2. Read using a without key and table key *(a)Simple read with condition *(b)Read with table expression *3.Check for line exist *4.Get table index *5.Performance comparision CLASS demo DEFINITION.   PUBLIC SECTION.     CLASS-METHODS main. ENDCLASS. CLASS demo IMPLEMENTATION.   METHOD main.     TYPES: BEGIN OF helper_type,              vbeln TYPE vbak-vbeln,              vkorg TYPE vbak-vkorg,              vkgrp TYPE vbak-vkgrp,              kunnr TYPE vbak-kunnr,              netwr TYPE vbak-netwr,        

Performance Comparison b/w table expression and read table operation

Image
*&---------------------------------------------------------------------* *& Report z_tab_expre_performance *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT z_tab_expre_performance. *-----------------------------------------------------------------------* CLASS lcl_demo DEFINITION . *-----------------------------------------------------------------------*   PUBLIC SECTION.     CLASS-METHODS main.   PRIVATE SECTION.     TYPES: BEGIN OF ty_struct,              id  TYPE i,              val TYPE i,            END OF ty_struct.     TYPES ty_itab TYPE SORTED TABLE OF ty_struct WITH UNIQUE KEY id.     DATA it_rand_no TYPE ty_itab.     TYPES:BEGIN OF ty_final,             text TYPE string,             time TYPE i,           END OF ty_final.     DATA:  it_final TYPE TABLE OF ty_final.     DATA repeat TYPE i.     DATA my_default TYPE ty_struct.     METHODS fill_rand_no_ta