05-24-2023 11:50 AM - edited 06-07-2023 2:13 PM
This discussion thread is to submit your solution for Week 3 of the May 2023 Developer Challenge - Open-Source ABAP .
Week 3 – ABAP Mustache https://github.com/sbcgua/abap_mustache
Mustache is a big deal in the web development world. It's a template syntax that doesn't use logic, letting you whip up a text template, stick some tags in there, and then swap those tags with dynamic content straight from your program – anything from individual values to full lists of values. Mustache is a real champ when it comes to generating bits of HTML (or entire pages), or pretty much any other text you want to template. Plus, the Mustache syntax is used in a huge number of languages.
Community member @atsy has put together an implementation of the mustache processor in ABAP, and named it - you guessed it - ABAP Mustache. So, for your third-week challenge, we're putting the spotlight on the ABAP Mustache project. Your challenge is to simply create an ABAP application which leverages this framework and outputs some data to the console. How you use ABAP Mustache is totally up to you - it's your chance to get creative and show us what you've got. Whether you want to keep it simple or go all out is completely your call. Once you're done, all you need to do is share your working ABAP code and give us a screenshot of the output in the console to prove you've nailed the challenge.
Resources
❗You will get credit for this weeks’ challenge by posting in this discussion thread the working ABAP code (a screen shot of your code, or via a link to your GitHub repo), and showing a screen shot of the output in the console. To give you an idea, here's an example screenshot below.
Have Fun 🤩
05-24-2023 7:47 PM
Hello!
I am trying to test a similar class to the example above. However, when I run it, I get the following dump:
"Access using a 'ZERO' object reference is not possible."
Below is my code:
Does anyone here know what the problem could be?
05-24-2023 9:20 PM
It's your shortcut for newline - the c_nl that is the issue. You never create an instance of that object you just type like cl_abap_char_utilities. So, it's not a valid object reference. Change that to the full, original object or create a specific newline shortcut like so:
DATA(c_nl) = cl_abap_char_utilities=>newline.
Have a look at the solution here: abap-hello-world/zcl_mustache_test_guilherme.clas.abap at main · jung-thomas/abap-hello-world · GitH...
05-25-2023 1:11 PM
05-24-2023 8:46 PM
06-04-2023 8:19 PM - edited 06-04-2023 8:19 PM
05-25-2023 5:12 AM
Seems I have to convert the macros to methods to activate the classes in ABAP cloud environment. Working with chatGPT to achieve that. @thomas_jung pls let me know if there is any easy way I can use this project in ABAP cloud.
05-25-2023 6:28 AM
05-25-2023 7:10 AM
05-25-2023 7:34 AM
05-25-2023 7:09 AM
05-25-2023 7:30 AM
05-25-2023 7:43 AM
05-25-2023 7:48 AM
05-25-2023 7:32 AM
05-25-2023 11:48 AM
05-25-2023 1:42 PM
Hello,
for this challenge someone already pulled ABAP Mustache repository into my instance of SAP BTP Cloud trial. But it was main branch which can not be activated on ABAP on Cloud (no SAP GUI). So I unlinked Z package, deleted objects and pulled "steampunk" branch of the repository, which is compatible with ABAP Cloud . Cheers mate 😉
Here is my implementation class. I tried to use ABAP Mustache to fill a demo "HTML e-mail template":
And screenshot of console output:
Valid HTML page output:
05-25-2023 3:25 PM
05-26-2023 6:37 AM
05-26-2023 1:43 PM
05-25-2023 2:17 PM
Here's my submission.
bohranooru17/May2023DeveloperChallenge (github.com) - look for "src/yd215_opensrc_wk3.clas.abap"
05-25-2023 4:20 PM
My submission for this week: https://github.com/Ennowulff/hello_world/blob/main/src/zcl_code_dojo_mustache_enno.clas.abap
05-25-2023 7:00 PM
Hello, Mamikee!
Here's my code:
My repository with the code for this challenge: https://github.com/ggarcia-de-souza/helloWorldClassAbap.git
05-26-2023 2:41 PM
05-26-2023 12:17 AM
Always nice to learn something new, and after a small improvement of the ABAP Mustache render class (https://github.com/sbcgua/abap_mustache/pull/12) I got this:
05-26-2023 10:14 AM
05-26-2023 2:43 PM - edited 05-26-2023 2:43 PM
05-26-2023 6:26 PM
05-26-2023 11:53 AM
05-26-2023 12:18 PM - edited 05-26-2023 12:22 PM
Here we go.. just toa make the point. You need an onprem, because it is not Cloud Ready! Make sure to take the correct branch --> https://github.com/sbcgua/abap_mustache/tree/steampunk
05-26-2023 12:33 PM
05-30-2023 8:29 AM
05-26-2023 2:05 PM
Hello, here's my participation!
https://github.com/alinecanteiro/alinecanteiro-sap-dev-cc-open-source
05-26-2023 3:29 PM
05-26-2023 3:54 PM
05-26-2023 5:51 PM
05-26-2023 10:46 PM
05-26-2023 6:07 PM
Great Challenge!
I had issues when I tried to run this solution on an instance of ABAP Environment!
I had to change a couple of instructions that are not ready for the new version of ABAP: ABAP for Cloud Development.
Finally it worked!
05-26-2023 10:23 PM
05-26-2023 10:49 PM