
Complete Guide to New Syntax in SAP ABAP 7.4 & 7.5: READ TABLE, CONCATENATE, MODIFY, COLLECT, SORT, APPEND & More
If you have been writing ABAP for a few years, you already know the feeling — pages of variable declarations before a single line of real logic, verbose string operations that span multiple statements, and table reads that require manual sy-subrc checks everywhere. That was the ABAP of the past.
With versions 7.4 and 7.5, SAP delivered something genuinely exciting: a modern, expressive syntax that lets developers write less code, make fewer mistakes, and actually enjoy the process. The new syntax in SAP ABAP is not just a style preference — it is the direction SAP is taking the language for S/4HANA and beyond. Developers who get comfortable with SAP ABAP new syntax today are better positioned for every project that follows.
This article walks through every major statement that has been updated or improved — from READ TABLE and CONCATENATE to SORT, APPEND, MODIFY, COLLECT, DELETE, CONDENSE, CASE, CALL TRANSACTION, and more. Each section includes a side-by-side look at the classic approach versus what you can write today, so the improvements are immediately obvious.
1. Internal Table Syntax in SAP ABAP: The Foundation
Before diving into individual statements, it helps to understand the single biggest shift that underlies almost all of the improvements in internal table syntax in SAP ABAP — inline declarations using DATA(...).
In the classic style, you had to declare every variable at the top of a program or method, even if it was only used in one place. With ABAP 7.4+, you can declare variables right where you need them. It sounds like a small thing, but it changes how you read and write code day to day.
Old SyntaxDATA: ls_employee TYPE ty_employee. READ TABLE lt_employees INTO ls_employee WITH KEY empid = '001'.New Syntax (7.4+)
READ TABLE lt_employees INTO DATA(ls_employee) WITH KEY empid = '001'.
That one line replaces two. Multiply that across a large codebase and the difference is substantial. Inline declarations work with nearly every modern ABAP statement, so you will see DATA(...) appearing throughout the rest of this guide.
2. READ TABLE Syntax in SAP ABAP
The read table syntax in SAP ABAP has always been reliable, but the old approach required a work area, a read statement, and then a sy-subrc check before you could safely use the result. ABAP 7.4 introduced table expressions, which cut all of that down to a single line.
DATA: ls_order TYPE ty_order. READ TABLE lt_orders INTO ls_order WITH KEY order_no = lv_no. IF sy-subrc = 0. WRITE ls_order-status. ENDIF.New Table Expression (7.4+)
TRY. DATA(ls_order) = lt_orders[ order_no = lv_no ]. WRITE ls_order-status. CATCH cx_sy_itab_line_not_found. " Handle not found ENDTRY.
When the row does not exist, the table expression raises a cx_sy_itab_line_not_found exception, so you handle the miss in a proper CATCH block rather than a scattered IF sy-subrc check. You can also read using a field symbol for cases where you want to modify the row directly:
READ TABLE lt_orders ASSIGNING FIELD-SYMBOL(<ls_order>) WITH KEY order_no = lv_no.
This approach gives you a direct reference to the table row, so any change you make to the field symbol updates the table immediately — no extra MODIFY needed.
3. CONCATENATE New Syntax in SAP ABAP
String operations used to be one of the more painful parts of writing classic ABAP. The concatenate new syntax in SAP ABAP replaces the old CONCATENATE statement with string templates — a far more readable and flexible approach.
DATA: lv_fullname TYPE string. CONCATENATE lv_firstname ' ' lv_lastname INTO lv_fullname.New String Template Syntax (7.4+)
DATA(lv_fullname) = |{ lv_firstname } { lv_lastname }|.
String templates use pipe characters (|) as delimiters and curly braces ({}) to embed variables. They also support formatting options directly inside the braces, which is something the old concatenate syntax in SAP ABAP could never do inline:
DATA(lv_message) = |Order { lv_order_no } created on { lv_date DATE = USER }|.
Need to combine multiple templates? Use the && operator to chain them:
DATA(lv_info) = |Name: { lv_name }| && | | && |Status: { lv_status }|.
The old form still compiles, but anyone reading modern ABAP code expects to see string templates. It is worth updating them whenever you touch a piece of code.
4. CONDENSE Syntax in SAP ABAP
The condense syntax in SAP ABAP is used to trim unwanted spaces from strings — leading spaces, trailing spaces, or all extra gaps. The classic statement still works fine, but ABAP 7.4 introduced built-in string functions that let you do the same thing inside an expression.
Classic CONDENSECONDENSE lv_text NO-GAPS.New Functional Approach (7.4+)
DATA(lv_clean) = condense( val = lv_text del = ` ` ).
The real benefit shows up when you chain functions. Instead of writing multiple statements, you can nest them:
Chained String FunctionsDATA(lv_result) = to_upper( condense( lv_input ) ).
Other useful built-in string functions in the same family include to_lower(), strlen(), replace(), substring(), and contains(). Together they remove the need for many standalone string manipulation statements.
5. SORT Syntax in SAP ABAP
The sort syntax in SAP ABAP has not changed dramatically in its core structure, but it pairs much more naturally with the rest of the modern language. Sorting an internal table is still a single statement, and it is just as readable as it always was.
Standard SORTSORT lt_employees BY department ASCENDING salary DESCENDING.
Where things get more interesting is when you combine SORT with the new table construction operators from 7.4 and 7.5. You can build a sorted copy of a table using VALUE and FOR:
DATA(lt_sorted) = VALUE ty_emp_table( FOR ls_e IN lt_employees ( ls_e ) ). SORT lt_sorted BY salary DESCENDING.
In ABAP 7.5, the REDUCE operator and GROUP BY addition to LOOP AT take this further, letting you build aggregated, grouped results without a separate SORT call in some cases.
6. APPEND Syntax in SAP ABAP
The append syntax in SAP ABAP is something every ABAP developer writes dozens of times a day. The classic style works, but it takes several lines just to add a single row to a table. The VALUE #(...) constructor changes that.
DATA: ls_line TYPE ty_record. ls_line-id = '001'. ls_line-status = 'A'. APPEND ls_line TO lt_records.New VALUE Constructor (7.4+)
lt_records = VALUE #( ( id = '001' status = 'A' ) ( id = '002' status = 'B' ) ).
The BASE addition is especially handy when you want to extend an existing table rather than replace it:
lt_records = VALUE #( BASE lt_records ( id = '003' status = 'C' ) ).
For the append lines of syntax in SAP ABAP — merging one table into another — the classic statement remains the most efficient option:
APPEND LINES OFAPPEND LINES OF lt_source TO lt_target.
7. MODIFY Syntax in SAP ABAP
The modify syntax in SAP ABAP is used when you need to update a row that already exists in an internal table. The classic statement is fine for bulk updates, but for targeted modifications the modern approach using field symbols or table expressions is cleaner and faster.
Classic MODIFYMODIFY lt_orders FROM ls_order TRANSPORTING status WHERE order_no = lv_no.Direct Modification via Table Expression (7.4+)
lt_orders[ order_no = lv_no ]-status = 'COMPLETED'.
For updating multiple fields in a loop, the field symbol approach is the way to go:
Using FIELD-SYMBOL in a LoopLOOP AT lt_orders ASSIGNING FIELD-SYMBOL(<ls_order>) WHERE order_no = lv_no. <ls_order>-status = 'COMPLETED'. <ls_order>-closed_on = sy-datum. ENDLOOP.
Because the field symbol points directly to the table row in memory, your changes take effect immediately — there is no copy being made and no MODIFY statement needed at the end of the loop.
8. COLLECT Syntax in SAP ABAP
The collect syntax in SAP ABAP has been around for a long time and does one thing well: it aggregates numeric fields when a matching key already exists in the target table. No manual SUM logic, no extra checks.
Classic COLLECTDATA: ls_total TYPE ty_summary. ls_total-region = 'NORTH'. ls_total-revenue = 5000. COLLECT ls_total INTO lt_totals.
For complex grouping scenarios, ABAP 7.5 introduced the GROUP BY addition to LOOP AT, which is more powerful and explicit:
LOOP AT lt_sales INTO DATA(ls_sale) GROUP BY ls_sale-region INTO DATA(lv_region). " Access all rows in this group and aggregate ENDLOOP.
For straightforward totals, COLLECT is still the most concise option available. For anything involving multiple grouping keys or complex aggregation, the modern REDUCE and GROUP BY operators are worth the investment.
9. DELETE Syntax in SAP ABAP
The delete syntax in SAP ABAP for internal tables has always been fairly readable, and modern ABAP has built on that foundation with a few useful additions.
Classic Conditional DELETEDELETE lt_orders WHERE status = 'CANCELLED'.DELETE with Table Expression (7.4+)
DELETE TABLE lt_orders FROM VALUE #( order_no = '1001' ).
Removing duplicates is a pattern that comes up constantly. The combination of SORT and DELETE ADJACENT DUPLICATES remains the standard approach:
Remove DuplicatesSORT lt_records BY key_field. DELETE ADJACENT DUPLICATES FROM lt_records COMPARING key_field.
10. FOR ALL ENTRIES in SAP ABAP Syntax
For all entries in SAP ABAP syntax is the standard way to fetch database records that match a set of keys stored in an internal table. It is used in nearly every business application, and with ABAP 7.5 Open SQL, the syntax got a cleaner look with the @ prefix for host variables.
IF lt_order_ids IS NOT INITIAL.
SELECT *
FROM vbap
INTO TABLE @DATA(lt_items)
FOR ALL ENTRIES IN @lt_order_ids
WHERE vbeln = @lt_order_ids-vbeln.
ENDIF.
11. CASE Syntax in SAP ABAP
The case syntax in SAP ABAP is one of the most frequently used control structures. ABAP 7.4 introduced two inline alternatives — SWITCH and COND — that let you express conditional logic inside assignments rather than in separate multi-line blocks.
CASE lv_status. WHEN 'A'. lv_label = 'Active'. WHEN 'I'. lv_label = 'Inactive'. WHEN OTHERS. lv_label = 'Unknown'. ENDCASE.SWITCH Expression (7.4+)
DATA(lv_label) = SWITCH #( lv_status WHEN 'A' THEN 'Active' WHEN 'I' THEN 'Inactive' ELSE 'Unknown' ).
For condition-based logic (equivalent to IF/ELSEIF chains), use the COND operator:
DATA(lv_discount) = COND #( WHEN lv_amount > 10000 THEN '10%' WHEN lv_amount > 5000 THEN '5%' ELSE '0%' ).
Both SWITCH and COND are especially powerful when used inside VALUE constructors, letting you build complex tables with conditional field values in a single expression.
12. EXPORT Syntax in SAP ABAP
The export syntax in SAP ABAP is used to store data objects to memory or the database so they can be retrieved later — often to pass data between programs or across transaction boundaries.
Export to MemoryEXPORT lv_data = lt_records TO MEMORY ID 'MY_DATA'.Import Back
IMPORT lv_data = lt_records FROM MEMORY ID 'MY_DATA'.
The core EXPORT/IMPORT syntax has not been overhauled in 7.4/7.5, but inline declarations work smoothly on the import side:
Import with Inline DeclarationIMPORT lv_data = DATA(lt_imported) FROM MEMORY ID 'MY_DATA'.
13. CALL TRANSACTION Syntax in SAP ABAP
The call transaction syntax in SAP ABAP is the standard way to programmatically navigate to an SAP transaction, typically with automated screen input through BDC (Batch Data Communication). The statement structure itself is consistent across versions.
CALL TRANSACTION with BDCCALL TRANSACTION 'VA01' USING lt_bdcdata
MODE 'N'
UPDATE 'S'
MESSAGES INTO lt_messages.
While the syntax has not changed significantly in 7.4 or 7.5, it integrates naturally with modern inline declarations for the BDC data table and message container. Pairing it with proper TRY/CATCH error handling also makes the code much more robust than the classic sy-subrc pattern.
14. CALL SUBSCREEN Syntax in SAP ABAP
The call subscreen syntax in SAP ABAP belongs to the world of Module Pool (Dialog Programming) development. It is used to embed one screen inside another — a common pattern in classic SAP UI development.
CALL SUBSCREENCALL SUBSCREEN sub_area INCLUDING sy-repid lv_dynnr.
This statement is placed in the PBO (Process Before Output) module of the main screen, telling the runtime where to render the embedded subscreen. While Fiori and UI5 have taken over for new developments, this syntax is still important for anyone maintaining or extending classic Module Pool applications.
15. CHECKBOX Syntax in SAP ABAP
The checkbox syntax in SAP ABAP is used in selection screens to give users a simple yes/no parameter. It is one of the most common elements in classic ABAP reports.
Selection Screen CHECKBOXSELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001. PARAMETERS: p_check AS CHECKBOX DEFAULT 'X'. SELECTION-SCREEN END OF BLOCK b1.
At runtime, p_check holds 'X' when the box is ticked and a blank space when it is not. You can evaluate it directly in a condition: IF p_check = 'X'.. It is a simple feature, but it comes up constantly in report programs and background job configurations.
Summary: Old vs. New SAP ABAP Syntax at a Glance
Here is a quick reference comparing classic ABAP patterns with their modern equivalents in 7.4 and 7.5:
| Statement | Classic Approach | Modern 7.4 / 7.5 Approach |
|---|---|---|
| Variable declaration | DATA: lv_x TYPE string. |
DATA(lv_x) = ... (inline) |
| READ TABLE | READ TABLE lt INTO ls WITH KEY... |
DATA(ls) = lt[ key = val ] |
| CONCATENATE | CONCATENATE a b INTO lv_str. |
DATA(lv_str) = |{ a }{ b }| |
| CONDENSE | CONDENSE lv_str NO-GAPS. |
DATA(lv_clean) = condense( lv_str ). |
| APPEND | APPEND ls TO lt. |
lt = VALUE #( BASE lt ( ... ) ) |
| CASE / SWITCH | CASE... WHEN... ENDCASE |
SWITCH #( ... WHEN ... THEN ... ) |
| IF / ELSE inline | Not possible | COND #( WHEN ... THEN ... ) |
| LOOP with GROUP | Not available | LOOP AT ... GROUP BY ... |
Why You Should Move to New SAP ABAP Syntax Today
It is a fair question — if the old code still works, why bother updating it? Here is why it is worth the effort, especially if you are working on a system that is moving toward S/4HANA:
- Less code to write and fewer places where bugs can hide — inline declarations and VALUE constructors cut out a lot of boilerplate.
- Better readability — string templates and SWITCH/COND expressions read almost like natural language compared to their classic counterparts.
- Improved runtime performance — modern internal table operations are better optimized by the ABAP kernel.
- Future-proof development — SAP's own tools and guidelines for S/4HANA development are built around these modern styles.
- Easier code reviews and onboarding — compact, expressive code is faster for new team members to understand.
- Better integration with ABAP Unit — testable, functional code is a natural fit with the new syntax patterns.
If you are looking after a large legacy codebase, you do not have to migrate everything at once. Start with the highest-frequency patterns — inline declarations, string templates, and table expressions — and work outward from there. Even partial adoption makes a noticeable difference.
Wrapping Up
Modern ABAP is a genuinely different experience from the ABAP of ten years ago. The new syntax in SAP ABAP introduced across versions 7.4 and 7.5 touches almost every area of the language — from how you read and write internal tables to how you handle strings, conditions, and screen elements.
Whether you are picking up ABAP for the first time or coming back to it after years of classic development, investing time in these patterns pays off quickly. The code you write is shorter, cleaner, and easier for everyone on your team to follow.
Start with the things you use every day — READ TABLE, CONCATENATE, LOOP AT, and inline declarations — and the rest will follow naturally as you work through the language.
Ready to Level Up Your SAP ABAP Skills?
Explore ERPVITS' expert-led SAP ABAP training programs and take your development career to the next level.
Explore SAP ABAP Training