SAP ABAP

How to fully specify the type of a returning parameter in method

CLASS zcl_it_Tsble_returning DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. TYPES: BEGIN OF structure_local, field1 TYPE string, field2 TYPE i, field3 TYPE float, END OF structure_local. TYPES: tt_table_local TYPE TABLE OF structure_local WITH KEY field2. “ WITH KEY above shows that the local internal table type is fully specified. When it is declared “without ‘WITH KEY’, …

How to fully specify the type of a returning parameter in method Read More »

How to modify internal tables in SAP ABAP

In the following code snippet, you will understand how to modify internal table of type standard with non unique keys. READ TABLE lt_internal_table WITH KEY field1 = field1_value ASSIGNING FIELD-SYMBOL(<ls_record>) <ls_record>-field2 = `field2_value_modified´ . Now the internal table will be updated with the modified value. So we have here modified the internal table without using …

How to modify internal tables in SAP ABAP Read More »

How to create different SARS COVID variants in SAP ABAP

Required Elements in creating the classifications. Structure – It includes the details such as variant id, variant name, amino acid changes, potential, spread. Interface Definition – The variant details of the sars covid 2 will be handled here. Abstract super class definition – This class implements the interface. The constructor is used to set the …

How to create different SARS COVID variants in SAP ABAP Read More »

How to do encapsulation in SAP ABAP

CLASS big_boss DEFINITION.    PUBLIC SECTION.    METHODS set_name IMPORTING i_name TYPE string.    METHODS get_name EXPORTING e_name TYPE string.    METHODS set_age IMPORTING i_age TYPE int4.    METHODS get_age EXPORTING e_age TYPE int4.    METHODS set_profession IMPORTING i_profession TYPE string.    METHODS get_profession EXPORTING e_profession TYPE string.    PROTECTED SECTION.    PRIVATE SECTION.    …

How to do encapsulation in SAP ABAP Read More »

Beispiel für Performance optimierten Code

Wichtige Felder selektieren ( Select * vermeiden ). DATA ls_corona TYPE corona. SELECT person_id  first_name FROM corona INTO  ls_corona.                 WRITE: / ls_corona-person_id, ls_corona-first_name. ENDSELECT. Statt IF-Anweisung WHERE Clause nutzen. SELECT person_id first_name FROM corona INTO ls_corona WHERE person_id = 100.                 WRITE: / ls_corona-person_id, ls_corona-first_name. ENDSELECT. Geschachtelter SELECTs vermeiden. Beispiel für schlechten Code. SELECT …

Beispiel für Performance optimierten Code Read More »