SAP YARD-athon August 2017 Result (New ABAP Syntax Special)

SAP ABAP Tutorial

We are closing the First Edition of SAP Yard-athon on a very high note. Hope you all experienced the same level of excitement participating in it, as we had presenting it to you. Within a week more than 1500 ABAPers checked our August 2017 Yard-athon and quite a few posted their answers. Please accept our sincere Gratitude for taking some time off from your busy schedule and looking into our humble effort.

If you have not checked our ABAP EhP 7.4 special August 2017 Yard-athon, then Check Here.

We also received numerous feedback as for why two internal tables have to be populated when at the end, we are just showing the number of entries. We also received quite a good number of requests where enthusiastic Developers want one Yard-athon every month. Some of them also suggested for SAPUI-thon, HANA-thon, Fiori-fication etc. We might need to file patents for these wonderful words. 🙂

Thank you all for such a tremendous response and feedback. Our team is really delighted and motivated to work hard to present similar Yard-athon on regular basis.

Coming back to the requirement.

Let us be clear. We wanted to see how good a Developer can make use of the new ABAP 7.4 syntaxes and replicate exactly all the things which were being done by the original program.

We had a note before the code. Many overlooked it. 🙂 . We deliberately wanted two internal tables to be populated.

Our ABAP team has prepared the below Before and After code snippet for the requirement. Hopefully, it will help all beginners in the new ABAP syntax and tickle them to explore more about the interesting new ABAP innovations.

1. The TYPES declaration remains unchanged

Unchanged in Original and New Program. We need it in both snippets.

2. Data and Type Declaration

None of the DATA declared in the original snippet is needed. In the new snippet, lv_regio is declared “in-line“. Also, a new TYPES ltt_plant_name is declared WITH DEFAULT KEY. It is important to have WITH DEFAULT KEY key-words to use the new VALUE syntax.

We briefly talked about WITH DEFAULT KEY in this EhP 7.4 post.

3. Data Selection from Database Table

@DATA is used for in-line declaration of Internal Table in the new snippet.

4. LOOP Statement and VALUE Statement

LOOP-ENDLOOP is replaced by VALUE key word in the new snippet. Check how WHERE condition is used in the VALUE statement.

Take the note of ls_plant work area. We do NOT explicitly need to declare the work area anywhere. It takes the properties of the ltt_plant_name automatically at run-time. Isn’t it cool? 🙂

5. Count Variable lv_count is not needed

Nothing new. Still thought of telling this. 😀

6. Write statement with New Concatenation Syntax

Write statements in quotes(‘ ‘) separated by comma (,) is replaced by || and {} to hold text and values of variables.
Please note, we do not need to save the count using LINES or DESCRIBE statement. { lines(lt_plan_name) } gives us our desired result.

Hopefully, you have figured out, anything within curly braces ({}) writes the value present in that variable. Also, keep in mind, there should be a space after opening curly brace ‘{‘ and a space before closing brace ‘}’.

You might like to just copy and test the complete new code snippet in your SAP ABAP editor.

Ohh!! You are expecting the before and after screen shot as well. 😀 . They won’t change my friend. 🙂 If you insist so much, here you go.

Original Output:


New Output:

Oh!! The spaces are uniform in the new output without any extra effort. Brownie point!! 😀

I think we need to complete the Hello SAP EhP7 Series for the benefit of all ABAPers.

Now coming to your Answers. We have published all the relevant answers in the comment section of the original post. Please check the Submissions Here.

And “Thank You” to all of you who went through our Yard-athon and also were a sport to participate in it. You guys rock!!

Be the Judge of the SAP Yard-athon August 2017 Contest.

Meanwhile, we need your help in deciding the best 10 submissions. Can you please check the answers and let us know your favourite 10? Please write the first 10 names of the ABAPers in the order you think is Best.


Please enter your comment!
Please enter your name here