Use this tag for questions regarding ABAP internal tables.
Questions tagged [internal-tables]
141 questions
1
vote
1 answer
A short syntax to fill ABAP table from another table?
In the old ABAP syntax I have to loop over the source table, and inside of the loop append value to the table.
For example:
DATA:
it_source_table type table of mara,
et_result_table type table of matnr.
loop at it_source_table into…

Denis
- 167
- 3
- 20
1
vote
3 answers
LOOP itab vs VALUE FOR filtering, which is more efficient?
I am trying to write a for-loop statement for the following scenario:
I have used a select to get multiple tvarvc entries data into…

isekaid_maou
- 273
- 1
- 9
- 19
1
vote
1 answer
LOOP vs parallel cursor LOOP performance?
I'm interviewing for a job, and on the test they sent me they provided the following image of 2 ABAP loops on an internal table, and asked which loop will execute faster:
After checking heavily on the internet I came to this 2 different…

Yuval Moshe
- 21
- 3
1
vote
1 answer
Appending non-empty lines to itab with COND operator
I have an internal table in which I have to move line items based on value on 3 variables using the value operator.
types:
ty_table type standard table of string with default key.
Data(Lv_var_1) = 'LINE 1'.
Data(Lv_var_2) = 'LINE…

HatriGt Ace
- 43
- 6
1
vote
1 answer
Merge two nested tables of identical structures?
Is it possible to merge 2 structures with nested table fields with a single instruction in ABAP? I tried with MOVE-CORRESPONDING but I didn't manage to get it.
Below I wrote a simplified version of what I need to do, my real structure has more…

RaTiO
- 979
- 2
- 17
- 33
1
vote
3 answers
Conditional itab grouping alike HAVING clause in SQL
This is a follow-up question for this one but instead of aggregation I want to process groups based on some condition and cannot figure out the proper syntax for this. I need to exclude groups which contain documents with status "deleted", if at…

Suncatcher
- 10,355
- 10
- 52
- 90
1
vote
2 answers
How to replace append lines of in ABAP 7.5?
I have the following code snippet, that I would like to write in functional style :
data(lt_es) = me->prepare_process_part_ztoa1( ).
APPEND LINES OF me->prepare_process_part_protocol( ) to lt_es.
How to rewrite the code above in new ABAP 7.5?

softshipper
- 32,463
- 51
- 192
- 400
1
vote
2 answers
Count duplicates in an internal table?
I just want to ask on how to count duplicates in an internal table. I wanted to this in order for me to count per customer and put it into the Customer count column.
Sales Employee Customer Customer Count
a 1 …

gwapo
- 178
- 2
- 4
- 28
1
vote
3 answers
Finding duplicates in ABAP internal table via grouping
We all know these excellent ABAP statements which allows finding unique values in one-liner:
it_unique = VALUE #( FOR GROUPS value OF IN it_itab
GROUP BY -field WITHOUT MEMBERS ( value ) ).
But what about…

Suncatcher
- 10,355
- 10
- 52
- 90
1
vote
1 answer
Update itab from another itab?
My program simply put the locks on users if the 'LOCK' checkbox is selected.
Everything works and the users records are updated in the USR02. When this change occurs I want that it also be reflected in IT_USR02, i.e. DB table USR02 and itab it_usr02…

oceanlab1
- 21
- 1
- 9
1
vote
3 answers
How to filter unpaired lines from table?
I created the following table in SAP:
How can I print only these lines, where the employee has signed in (KOMMEN), but not signed out (GEHEN)?
In this example I want print only the last line.

doomsweb
- 51
- 8
1
vote
2 answers
Is it a good practice to sort an internal table which is already sorted?
Is it a good practice to sort an internal table (which is already sorted based on three fields) based on one field for the purpose of read table using binary search?
for example:
SORT itab by field1 field2 field3.
READ TABLE itab WITH KEY field1…

Rajasekharreddy Panditi
- 59
- 1
- 2
- 11
1
vote
1 answer
Changing internal table without header using index
How to change the old BW3.x code (tables with header) to BW7.x (tables without header)
OLD code:
LOOP AT p_package.
gv_tabix = sy-tabix.
" changing header ... and more
MODIFY p_package INDEX gv_tabix.
Here the header line gets changed and the…

Thorsten Niehues
- 13,712
- 22
- 78
- 113
1
vote
1 answer
Difference between Internal Table declarations OCCURS and TYPE TABLE OF?
And which one should be preferred / why?
So I have a TYPE defined locally:
TYPES:
BEGIN OF CUSTOMER_STRU_TYPE,
KUNNR TYPE KNA1-KUNNR,
NAME1 TYPE KNA1-NAME1,
END OF CUSTOMER_STRU_TYPE.
and I think these 2 statements seen…

Koray Tugay
- 22,894
- 45
- 188
- 319
1
vote
2 answers
Conditional loop clearing of HR infotype itab lines?
I have no idea about ABAP - but my colleague (also no idea about it) showed me some code he came up with and it consisted of wayyy too many if-statements.
In JavaScript I could've improved it but in ABAP I'm a bit lost because I'm missing my Arrays…

Cold_Class
- 3,214
- 4
- 39
- 82