Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
haeuptle
Advisor
Advisor
Having a code base, which is readable and maintainable is essential for sustainable development. The book Clean Code from Robert C. Martin and some other books contain many best practices around maintainable code.Some months ago Florian Hoffmann and me started an internal repository about best practices for maintainable and readable ABAP Code. Through info sessions with many hundreds of participants, intense discussions, and great contributions, SAP colleagues helped turn this into a treasure trove for modern ABAPers.
From the exchange with customer and partners, we know that there is a huge need for such kind of best practices. Besides, many of you asked whether this would become available as a book, and whether we would be allowed to share it with our customers and partners. We came to the conclusion that this initiative gains its drive from its community, and that it needs to remain part of that community.
Therefore, as of now, Clean ABAP is an Open Source contribution:


Under the CC BY 3.0 license and open to contributions from inside and outside of SAP, we hope that this repository will help developers worldwide to make their ABAP code a little cleaner, day by day.






Based on the ask from many colleagues, we are additionally publishing a book clean ABAP to help developers with learning and implementing clean ABAP as an individual, as a team and as an organization.

Besides, there has been a podcast published recently. More details can also be found behind the following links :

Subscribe to Newsletter: Collaboration on Improving


If you do not miss an update on Clean ABAP, Clean SAPUI5, test automation, testability and other engineering / craftsmanship / architecture topics, subscribe to the brand new newsletter. The newsletter will not only be used for sharing knowledge, but also offer opportunities for collaboration, building communities and co-creation.
44 Comments
pokrakam
Active Contributor
As a big fan of clean code principles, I can only say this is a wonderful initiative. Thanks for making it public!

It's amazing how difficult it is to convince people to write easily readable code, this will help.
larshp
Active Contributor
Great reading, thanks for sharing
JeffCarty
Explorer
0 Kudos
This is pretty great, amazing work!
nabheetscn
Active Contributor
0 Kudos
Great stuff!
bruno_alves
Explorer
0 Kudos
Awesome, thanks for sharing,
Föß
Active Participant
0 Kudos
Excellent job! Thanks for sharing this great stuff with the community. Every ABAP developer should know and use Clean Code. This makes the ABAP world a bit better for all of us.
Mattias
Active Participant
0 Kudos
Great, there's a great need (I would almost say desperate) for this, will definitely share it with my team. I did put the Clean Coder book in our bookshelf, no one has touched it 🙂
developerone
Contributor
0 Kudos

Thank You klaus.haeuptleand 222floh222for this great initiative.

abdul_hakim
Active Contributor
0 Kudos
Great Stuff!!
samdibach1
Explorer
0 Kudos
This is a great and usefull initiative!
chairat_onyaem
Participant
I love to see ABAP to support method name longer 30 characters.
UweFetzer_se38
Active Contributor
Every training I give starts with the chapter "Clean Code". With the "new" ABAP it's so easy to implement, but a bit hard to teach (like the use of Eclipse).

Thank you for this initiative.
Private_Member_5521
Participant
0 Kudos
Bookmarked in the section "important", thanks for an awesome contribution.
matt
Active Contributor
I've spotted stuff that I'm doing right... and stuff I do that maybe I'll think about changing!
BKesav
Explorer
0 Kudos
This is really a fantastic initiative...Thanks for sharing the great things for ABAPers...kudos Klaus
Siarljp
Active Participant
I really appreciate a blog on this topic, coding best practices in ABAP has been neglected for far too long! We can sure make use of this where I work, looks like I have some reading to do though!
mmcisme1
Active Contributor

Just amazing!  Awesome blog – great initiative.

jelena.perfiljeva2 bfeeb8ed7fa64a7d95efc21f74a8c135  

hardyp180
Active Contributor
I have been reading this online document the last few days. Lars Hvam told me about it in Copenhagen over the weekend.

I don't think any programmer will ever agree with 100% of it, but the vast majority makes a lot of sense to me.
BaerbelWinkler
Active Contributor
Thanks for putting this together! I'm just scratching the surface at the moment, poking around a bit here and there and already found lots of stuff we should (perhaps) do differently. Not too suprisingly, I also happened upon several items which fly right over my head as I just don't do much programming (and then just a little bit with OO) nowadays.

Definitely lots of food for thought to digest and then share with others!

Cheers

Bärbel
carlos_valentini3
Participant
0 Kudos
Good Morning.
Excellent news
ChrisSolomon
Active Contributor
VERY nice! Good to see something "new" finally come out after seeing the same old style/standards guide from back in the 1990s still making the rounds! haha
Jelena
Active Contributor
In my experience, there is never 100% agreement among programmers on anything. 🙂
Jelena
Active Contributor
Some books should come with self-destruction mechanism. 🙂

ABAP guidelines were published back in 2009 by SAP Press though, but I find even those would still be novelty to some developers.
Tomas_Buryanek
Active Contributor
We can agree on that 🙂
Jelena
Active Contributor

Personally, I find the whole “Uncle Bob” cult following annoying and, by association, dislike the words “Clean Code”.

But I am a big fan of the streamlined and optimized code (I just simply call it “code” ? ) and this is really an excellent initiative! I like the “cheat sheets” a lot, this is very handy. And the fact that this is available on Git and not as a $60 book – this is just fantastic. Well done and thank you for sharing!

Well deserved title of probably the most liked and commented SCN blog of 2019. ?

kjyothiraditya
Participant
0 Kudos
Very good content !

 

Thanks!

I disagree. 😉

BMEIJS
Active Participant
0 Kudos
This is so recognizable.
ekekakos
Participant
0 Kudos
Just Wonderful.

Thanks a lot.

Elias
pokrakam
Active Contributor
Correction: ARE a novelty to MANY developers, even whole organisations.

Even though everything in that book is also in the ABAP online documentation.
kjyothiraditya
Participant
0 Kudos
very nice article !
p244500
Active Contributor
0 Kudos
Thank you for this initiative, its way to go
former_member610590
Participant

Thanks for the blog

In Correctness and Quality of ABAP help they say: that as a good practice to run not only unit tests but scenario tests also. You have mentioned nothing about scenario tests for ABAP-environment.

However still for now in fact the scenario testing is important testing.

Do you need such kind of “drive from … community” about automation scenario testing in ABAP-development ? )

 

joao_sousa2
Active Contributor

“We encourage you to get rid of all encoding prefixes.”

From my exprerience that wlll be one of the hardest! ABAPers do like their prefixes.

Edit: After reading it all, I just have to congratulate you guys on a job well done. I'm going to apply this for all this greencode because I agree with like everything and the examples "Do" and "Don't" give an excelent picture. Unfortunately most of the code you see today uses the "don't" examples. 

loyd_enochs3
Participant
Excellent work!

Lots of topics to evaluate and discuss, particularly for those of us on older versions.
joachimrees1
Active Contributor
I was made aware of the Github link via the Fediverse some time ago and now also found this blog.
Very nice, I like it a lot!

best
Joachim
pramodrepaka
Participant
0 Kudos
It is so nice to see how SAP is evolving and always up to the market and sometimes even ahead. Thank you klaus.haeuptle for this blog.
ipravir
Active Contributor
0 Kudos
Thanks for sharing klaus.haeuptle

Praveer.
joachimrees1
Active Contributor
0 Kudos
Interesting to see this blog still featured on the community front page - in as 'most liked' and 'trending'



 

...shouldn't there be some kind of cap, maybe?! OK for it to be "most liked" for as long as that's the case - the metrics are easy here (just count + compare likes).

But if something is trending for about a year already? What exactly is the metric here?
tunakaner
Participant
0 Kudos
Thanks to all contributers for this amazing work!
matt
Active Contributor
A contrary view: It's probably time to stop recommending Clean Code

(Same web site contains 3 really innovative and mind-blowing hard science-fiction novels!).
jibinmathews
Explorer
0 Kudos
Good one.
ruediger_hodapp
Discoverer
Thanks for this styleguide!

Every SAP Developer should read this guide.

I am wondering when SAP itself will write clean code. I just had a look at the central function module of material requirement planning. Even the name violates clean principles "DO_DISPOSITIONSRECHNUNG" 🙂 When will SAP stop with "Denglish"

If you look into the code of DO_DISPOSITIONSRECHNUNG nearly every line of code is against the  principles.

 

 

 

 

 

 
RAF
Active Contributor

ruediger_hodapp  If Time_Machine invented.

Time_Machine->GoBackinTimeAndAlterCode( fm = DO_DISPOSITIONSRECHNUNG  style = CleanCode years = 25 ). endif.