Data Declaration in ABAP on HANA

With ABAP on HANA we can define variables/internal tables/structures/field symbols easily and quickly. Lets see some examples of data declarations.

Here is a simple data declaration for a variable.

    SELECT SINGLE ebeln FROM ekpo INTO @DATA(lv_ebeln)
      WHERE banfn = ’100000’ 
        AND loekz = @space.

An internal table/structure definiton.

Select matnr, spras, maktx 
into table @data(lt_makt) 
from makt 
where matnr in @lr_matnr.

Loop at lt_makt into data(ls_makt).
..
Endloop.

 

Data declarations in call method statement.

  CALL METHOD go_alvgrid_vrd->get_selected_rows
    IMPORTING
      et_index_rows = DATA(lt_rows).

Also in read table statement for structure and field symbols.

 READ TABLE gt_mvt_list INTO DATA(ls_mvt_list) INDEX ls_rows-index.
 
READ TABLE gt_mvt_list ASSIGNING FIELD-SYMBOL(<lfs_mvt>) INDEX <lfs_ls_good>-row_id.
   

In Describe Table statement.

DESCRIBE TABLE gt_mvt_list LINES DATA(lv_lines).

 

It’s getting easier, isn’t it?

ABOUT Ekrem Güngörmez

https://tr.linkedin.com/in/ekremgungormez

COMMENTS

comments powered by Disqus