Clean code in SAP ABAP
Clean ABAP is SAP’s adaptation of Clean Code to ABAP: names that say what things hold, snake_case, no Hungarian prefixes, small methods, exceptions over return codes, lines of 120 characters at most.
What does Clean ABAP ask for?
Use names that convey the content and meaning of things.
source
From Clean ABAP. SAP’s guide says where it comes from in its first line source.
How should SAP ABAP code look?
- Lines of 120 characters at most. source
How are names written in SAP ABAP?
What does cleaner SAP ABAP look like?
DATA: lv_cnt TYPE i,
lt_ord TYPE ty_orders.
CALL METHOD lo_db->read_orders
EXPORTING
iv_cust = lv_cust
RECEIVING
rt_orders = lt_ord.
DESCRIBE TABLE lt_ord LINES lv_cnt.DATA(orders) = order_db->read_orders( customer ).
DATA(order_count) = lines( orders ).Other languages
More on clean code: comments, functions, naming and the checklist.