ABAYTHON

Newly added field to ALV is not getting displayed

Sometimes the newly added field to the ALV Grid does not get displayed properly. Please follow the below solution. Solution: Please execute the following two programs. BALVBUFDEL BCALV_BUFFER_DEL_SHARED Log out from the SAP System. Log in again to check if the added field in ALV exists.

How to resolve the Error ‘Database table must be a flat structure’ in SAP ABAP

DATA: BEGIN OF ps_struct. INCLUDE STRUCTURE zss_db_table1. “ ==>Below syntax Error: “ZSS_DB_TABLE! must be a flat structure.                             “Internal tables, strings, references, and structures cannot be used as components. DATA field4 TYPE i. DATA: END of ps_struct. DATA lt_internal_table TYPE TABLE OF ztt_db_Table1. SELECT *FROM ztt_db_table1 INTO TABLE lt_internal_table. LOOP AT lt_internal_table ASSIGNING FIELD-SYMBOL(<ls_struct>).               …

How to resolve the Error ‘Database table must be a flat structure’ in SAP ABAP Read More »

How to Create an ALV Grid using CL_GUI_ALV_GRID in SAP ABAP

DATA lr_alv_grid TYPE REF TO cl_gui_alv_grid. DATA pt_internal_table TYPE TABLE OF ztt_Db_Table2. DATA lt_field_Catalog TYPE lvc_t_fcat. CALL FUNCTION ‘LVC_FIELDCATALOG_MERGE’               EXPORTING                             i_Structure_name = ‘ZTT_DB_TABLE2’               CHANGING                             ct_fieldcat = lt_field_catalog. lr_alv_grid = NEW cl_gui_alv_grid( i_parent = cl_gui_container=>default_screen ). SELECT *FROM ztt_db_table2 INTO TABLE pt_internal_table. DATA(lv_layout) = VALUE lvc_s_layo( grid_title = ‘Contact details’ ). lr_alv_grid->set_table_for_first_display( …

How to Create an ALV Grid using CL_GUI_ALV_GRID in SAP ABAP Read More »

How to create a simple ALV List using field catalog.

The following two entries are necessary to populate the fields of the ALV list. Field Catalog Internal Table DATA lt_field_Catalog TYPE slis_t_fieldcat_alv. DATA ls_field_Catalog TYPE slis_fieldcat_alv. DATA lt_internal_table TYPE TABLE OF ztt_db_table1. ls_field_catalog-fieldname = ‘CONTACT_ID’ ls_field_catalog-seltext_l = ‘Contact_identification’. APPEND ls_field_catalog TO lt_field_catalog. ls_field_catalog-fieldname = ‘CONTACT_NAME’. ls_field_catalog-seltext_l = ‘Contact name’. APPEND ls_field_catalog TO lt_field_catalog. ls_field_catalog-fieldname = …

How to create a simple ALV List using field catalog. Read More »

How to create a simple ALV List using DDIC structure

The following two entities are necessary to populate the fields of the ALV list. a. Database Table or Structure b. Internal Table Contact_Id Contact_Name Contact_Address 101 Mike Street 10 102 Raj Street 11 103 Thiru Street 12 DATABASE TABLE : ZTT_DB_TABLE1 DATA lt_internal_table TYPE TABLE OF ztt_db_table1. DATA ls_structure Like LINE OF lt_internal_table. SELECT * …

How to create a simple ALV List using DDIC structure Read More »

What is the difference between Upcasting and Downcasting in SAP ABAP?

Data lr_top_floor TYPE REF TO zcl_top_floor Data lr_ground_floor TYPE REF TO zcl_ground_floor lr_top_floor = New zcl_top_floor (). lr_ground_floor = New zcl_ground_floor (). Downcast: When you stand in the top floor, the view of the properties such as roads, other houses are visible easily. The view is widened in the top floor. So, we can call …

What is the difference between Upcasting and Downcasting in SAP ABAP? Read More »

Exception CX_SY_ITAB_NOT_FOUND in Table Expressions

This exception occurs when the specified table row is not found in the internal table. The Database Table ztt_db_table2 contains the following entries. Contact_id Contact_name Contact_address DATA lt_internal_table TYPE STANDARD TABLE OF ztt_db_table2. DATA ls_structure TYPE ztt_db_table2. SELECT contact_id contact_name contact_address FROM ztt_db_table2 INTO TABLE lt_internal_table. TRY. IF lt_internal_table [ contact_id = 105 ] – …

Exception CX_SY_ITAB_NOT_FOUND in Table Expressions Read More »