ABAYTHON

Modifying the internal table contents using MODIFY statement

Using the MODIFY statement, we can modify more than one data record in an internal table. It is modified with the contents of the structure along with the additional conditions such as WHERE, INDEX, USING KEY. Using the ‘TRANSPORTING’ keyword, we can specify which component of the structure in the internal table must be transferred. …

Modifying the internal table contents using MODIFY statement Read More »

How to use Table Expressions to modify internal table

              It is much similar to the READ TABLE technique. The table expressions can be used from ABAP 7.40 SP02 version. Particular data record is assigned to the field symbol. The pointers refers to the respective line of record in the internal table. DATA lt_internal_table TYPE TABLE OF ztt_db_table2. FIELD-SYMBOLS <ls_record> TYPE ztt_db_table2. SELECT *FROM …

How to use Table Expressions to modify internal table Read More »

How to Delete records from the internal table in SAP ABAP

The Data records present in the internal table can be deleted in following ways. Key or work area (structure) WHERE conditions. Index From Index TO Index Clean, Refresh, free DATA lt_internal_table TYPE TABLE OF ztt_db_table2. DATA ls_structure TYPE ztt_db_table2. SELECT *FROM ztt_db_Table2 INTO TABLE lt_internal_table.               ls_structure – contact_id = 102.               ls_structure – contact_name …

How to Delete records from the internal table in SAP ABAP Read More »

How to use VALUE# (), REF# (), enclosed Internal tables for Table expressions.

DATA(ls_contact) = VALUE # ( lt_contact[ 1 ] ). WRITE: / ls_contact-contact_id. DATA( ls_contact_ref) = REF # ( lt_contact[ 1 ] ). WRITE:/ ls_Contact_Ref->contact_id. The difference is clearly evident from the syntax. The former one is a value and the latter one is a reference. The above table shows clearly that an internal table is …

How to use VALUE# (), REF# (), enclosed Internal tables for Table expressions. Read More »

How to use ‘LOOP AT’ IN SAP ABAP

LOOP AT is used to read more than one data record in an internal table. The Data record is assigned to a local work area or field symbol. DATA lt_contact TYPE TABLE OF ztt_db_table2. DATA ls_contact TYPE ztt_db_table2. SELECT *FROM ztt_db_table2 INTO TABLE lt_contact. LOOP AT lt_contact INTO ls_contact.               WRITE:/ ls_contact-contact_id. ENDLOOP. The performance …

How to use ‘LOOP AT’ IN SAP ABAP Read More »

In built Function LINE_EXISTS() in Table Expressions

IF line_exists( lt_contact[ contact_id = 102 ] ).               WRITE: / ‘Record exists’. ELSE               WRITE: / ‘Record does not exists’. ENDIF Contact_id Contact_Name Contact_Address 100 Mike Street 10 101 Tom Street 14 102 Richard Street 18 The line exists condition is true as the Data record with contact_id = 102 exists in the Internal …

In built Function LINE_EXISTS() in Table Expressions Read More »