Skip to content

Commit 1163554

Browse files
authored
added docs
1 parent 7b6e57e commit 1163554

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

prefer-insert-into-to-append.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[code pal for ABAP](../../README.md) > [Documentation](../check_documentation.md) > [Prefer INSERT INTO TABLE to APPEND TO](prefer-insert-into-to-append.md)
2+
3+
## Prefer INSERT INTO TABLE to APPEND TO
4+
5+
### What is the intent of the check?
6+
7+
This check searches for `APPEND` statements and reports a finding. `INSERT INTO TABLE` works with all table and key types, thus making it easier for you to refactor the table's type and key definitions if your performance requirements change.
8+
9+
### How to solve the issue?
10+
11+
Use `INSERT INTO` instead of `APPEND TO`.
12+
13+
### What to do in case of exception?
14+
15+
In exceptional cases, you can suppress this finding by using the pseudo comment `"#EC PREF_INSERT_INT`:
16+
17+
```abap
18+
DATA prefer_insert_into_table TYPE TABLE OF string.
19+
APPEND `example` TO prefer_insert_into_table. "#EC PREF_INSERT_INT
20+
```
21+
22+
### Example
23+
24+
Before the check:
25+
26+
```abap
27+
DATA prefer_insert_into_table TYPE TABLE OF string.
28+
APPEND `example` TO prefer_insert_into_table.
29+
```
30+
31+
After the check:
32+
33+
```abap
34+
DATA prefer_insert_into_table TYPE TABLE OF string.
35+
INSERT `example` INTO TABLE prefer_insert_into_table.
36+
```
37+
38+
### Further Readings & Knowledge
39+
40+
* [Clean ABAP - Prefer INSERT INTO TABLE to APPEND TO](https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-insert-into-table-to-append-to)

0 commit comments

Comments
 (0)