Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
hardyp180
Active Contributor
910
NARRATOR: As you will probably be aware by now, the two biggest things happening in the SAP world are the introduction of the Cloud RAP (Restful ABAP Programming Model) and abapGit for version management, hence the title of this blog series, which narrates a horror story concerning both new concepts.

The night before the publication of the “ABAP to the Future 3” book two horrible things were happening simultaneously. First of all the author was writing the book in the first place, and if that was not bad enough in and off itself……



The Story So Far..

https://blogs.sap.com/2019/02/26/the-rappy-horror-abapgit-ture-show/

NARRATOR: Two invited guests to the SAP Press Gala Party – SAP and ABAP- these lovers decided that on the night before the SAP Press party they were to begin their journey to pick up Professor Hasso Plattner en route to said party to which they had all been invited. Little did they know what would await them on that – fateful – night? Meanwhile, the high level mapping of the proposed SAP solution to the Baron’s business process had been completed…

PDH: We start off by describing an application in SAP which can fulfil each step of the process, replacing the paper based solution from 1818. If I have to be honest the transition will not actually make things better than they were 200 years ago on go live day, but it will be better EVENTUALLY and that is what we are aiming for.

Do you know why go-live is so problematic? I bet you think it is all to do with bad project management, or implementation partners, or lack of properly defined requirements or some such. That is what, as someone somewhere once said, the “fake news” wants you to believe.

Some years ago my colleague David Saltwell alerted me to the root cause of the situation. In reality the evil entity known as EVIL OG is always at work trying to stop SAP go-lives, to put them in reverse, as it were, and he (OG) has an amazing rate of success. Just take LIDL in Germany for a recent example – 8 Billion Euros and 7 years and they had to abandon their SAP implementation and stick with their legacy system, all down to the machinations of EVIL OG.

There is also a sort of glue which has a scientific name of YCA GEL. You coat your current applications with this gel and they work together really well. This tends to make organisations stick to what they have always done and not implement new ERP systems.

Since most companies have that type of GEL all over the place, and EVIL OG working against you, then to be honest it is not surprising why 80% of ERP implementations fail.

In this case if EVIL OG tries to interfere then the Baron will send all his monsters after him. It will be a monumental battle, but if the Baron succeeds and EVIL OG is no more, or if (even more unrealistic) people actually listen to the sort of “new” concepts I espouse in the book (either would do) then maybe the 80% failure rate of ERP projects will decrease…

NARRATOR: Getting back on track might be an idea….

PDH: Ah yes, of course. What we need now is the business process restated, this time with a proposed (SAP based) technical solution after the appropriate steps.

Here we go with the business process plus required technical solutions:-

  • The Hunchback Order Taker is based at the “Catastrophic Slaughter Canter” (CSC) and captures customer requirements in a Variant Configuration style UI pop-up, in the Monster Order Front End (MOFE)

  • These requirements are characteristics or Z fields in the order item - there is a generic material, and the EVIL DEED code which is based on the requirements, and a free text description

  • An ATP check needs to be done (during order creation/change) on SAVE to see if any existing monsters match the requirements

  • If no existing monster can be found (or not enough on the planned day) the order items goes into NEEDS NEW MONSTER status and the ATP check pushes back the delivery date

  • If a Monster is available a "reservation" business object is attached to the sales order item. This can be changed up to the point of delivery.

  • A "Missing Monsters" report is needed to let Baron F know how many new Monsters he needs to make and by when.

  • Baron F then makes the new monster. He needs to know what ingredients need to go into the new monster. He would also like to be able to anticipate future customer requirements and so be pro-active. For this a “Monster Simulator” application is needed in SAP.

  • Then a new reservation can be created and attached to the order item. The order item is then in READY status

  • Order lines appear on the Atrocity Due List application in SAP. When the order is due, the central allocator then picks the Monster to do the vile deed, either the reserved one, or from list of available matching monsters

  • Hunchback at Laboratory dispatches actual deliveries on the Atrocity Monitor application in SAP, which lets the Monsters out of their cages to go and do the evil deeds. He does not need to go down to the cage, the application interfaces to the cage controller system and opens the cage. This is what the “Internet of Things: is all about, the “Things” being Monsters.


There we go, that is the wordy bit out of the way. As the Bee Gees once said “It’s only words, and words are all I have to take your functional specification away”. Time to turn this into a list of “ABAP Artefacts” that are needed to fulfil this business process, then we can jump right to the bottom and start working out the low level components needed.

Anyway as can be seen, what we need is thus:-

APPLICATIONS

Monster Order Taking Front End (MOFE)

Missing Monsters Report

Monster Simulator

Monster Atrocity Due List

Monster Atrocity Monitor

BUSINESS OBJECTS (which need CRUD applications)

Monster Business Object (Cross between MARA and EQUI in SAP)

Monster Sales Order Business Object (Like VBAK/VBAP in SAP)

Monster Reservation Business Object (No direct equivalent)

Monster Delivery Business Object (Like LIKP in SAP)

Monster Village Business Object (Like a “Ship-To” in SAP)

Involuntary Contraction of the Diagram

What happens next in such a project? You are bound to know – the next step is to draw a load of pretty pictures. A UML diagram of some sort maybe, just for now the diagram is going to be how the assorted business objects relate to each other.

In other words the first step is to get the data model complete. That should be independent of how the data is going to be used, on the not unreasonable grounds that a data model that relates to the real world is fairly static, at least compared to the business requirements which are likely to change ten thousand times form project start to project finish.

So give me a minute to draw a diagram that shows how the various business objects relate to each other.

NARRATOR: Whilst the author was considering various diagrams a disaster had befell SAP and ABAP. On the way to the Hasso Plattner institute they had encountered a ferocious thunderstorm. To make matters worse their TESLA car had run out of electrical power in the middle of nowhere…

ABAP: Oh SAP, who are all those mad motorcycle drivers passing us, with SAPPHIRE NOW written on the back of their leather jackets?

SAP: I don’t know ABAP but those types clearly have no regard for their own lives, let alone anyone else’s, otherwise they would not be going to SAPPHIRE NOW. Anyway, the problem we have now is that our car has broken down. Mobile phones have not yet been invented so we need to get out of the car and hope we can find a house nearby with a phone.

ABAP: (Gets out of car, look around) Oh! That was easy! Look over there on the other side of the forest! It is Castle Frankenstein!

*----------------------------------------------------------------------------------------------*

Song: There is a Light

*----------------------------------------------------------------------------------------------*

[Verse 1: ABAP]

In the velvet darkness

Of the blackest vest

Burning bright, there's SAP PRESS

No matter what, even if you’re a vet

[Chorus: SAP and ABAP (+ Monsters)]

There's the third edition of “ABAP to the Future”

(Over at the Frankenstein Place)

There's the third edition of “ABAP to the Future”

(Burning in the fireplace, probably the only practical use for it)

There's the third edition of “ABAP to the Future”, right

In the darkness of everybody's bookcase

[Verse 2: RICEF]

The darkness must go

Down the river of night's dreaming

I hate Web Dynpro

Let the RSS feed come streaming

Into my life, into my life

[Chorus: SAP and ABAP (+ Monsters)]

There's the third edition of “ABAP to the Future”

(Over at the Frankenstein Place)

There's the third edition of “ABAP to the Future”

(Burning in the fireplace)

There's the third edition of “ABAP to the Future”, right

In the darkness of everybody's bookcase

NARRATOR: Meanwhile, the business object relationships were being formalised…

PDH: OK, here we have a diagram showing how the BOs relate to each other…



This is how a human would think of things. Naturally a computer has no idea of anything in the real world so you have to spell things out.

A CDS View to a Kill

If I cross my fingers, I could say it is possible that most of you reading this know what a CDS view is, although I would (a) not hold my breath and (b) I have my huge doubts that anyone in the world outside of SAP has actually made much use of them yet in a productive sense. In case you do not know, I will over-simplify and say it’s like a SE11 database view on steroids, and then give a concrete example of where you MIGHT think it is better. It is going to be a long hard slog (15+ years?) to get the usage of CDS views mainstream, whatever SAP may think.

As might be imagined not much is going to happen in our Monster application unless a database table is created for each of the blue blobs in the diagram above. We do that in the same way as always though I would note that you can now create the definition of SE11 tables in ABAP in Eclipse in a code based way. This makes a lot of traditional developers throw up in disgust, despite the fact they have been creating internal tables in pretty much the exact same way for 20 years.

As a result I think most people will be in their comfort zone when I teach my grandmother how to suck eggs and say we need to create a bunch of Z domains, and then Z data elements, and then Z structures and Z tables in SE11. Nothing radical there so far I hope? You can do all that n ABAP in Eclipse now, as I mentioned, most people will not, but you COULD and I encourage you to do so.

STOP – do not do any of this. Go back to using WRITE statements

As a general divergence here there has been huge resistance in traditional ABAP world to crazy ideas like OO programming in general, and concepts like Test Driven Development. Partly that has been down to people saying “do this whatever it is because 95% of programmers in the world have been doing it for years and it worked for them” rather than actually saying WHY doing whatever it is could benefit you.

I hope that is what my blogs on OO and TDD have been about. Saying the benefits – and the drawbacks – rather than just “do this because everyone else who has done this is REALLY COOL”.

My friend Jelena noted that just because 99% of the programming world does something it does not mean it is automatically a good thing. After all at one point 99% of people would have thought the sun revolved around the Earth and saying anything else would result in death by being burned at the stake.

In the same way she says “Just because the 99% of programmers in the world jump off a bridge, would you jump off that bridge as well?”

ABAP is indeed a small minority of the worldwide programming community, based on the amount of code written worldwide every day... by that criteria we are maybe not even 0.1%!

Nonetheless a lot of the core business logic run by the vast majority of the big companies in the world today run on ABAP – if that was not the case why we would any of us even be bothering? And it has WORKED to date at least. So why change?

So the philosophical  question becomes – has the world changed so much that the development approach used by companies such as (AWS / Google / Facebook) and so on has been so successful that companies that run SAP need to reconsider if “jumping off the same bridge” that those companies have done is worthwhile or nor?

I can say for a fact that SAP as a company is jumping off that bridge. I asked Bridge Jones and even she said she is going to use OO & TDD in the future, to stop the character played by Hugh Grant, who has come back from the dead, coming after her.

NARRATOR: This is a “BRIDGE TOO FAR”. Get back on track at once!

PDH: Sorry! I need to get back on the subject of creating DDIC tables in SAP which leads me to talk about Circular Quay in Sydney Harbour, which of course is near the Harbour Bridge. Its original name was “Semi-Circular Quay” for the very good reason that it is indeed a semi-circle. However Circular Quay must have sounded better, so that is its name now.

If you depart Circular Quay from the opposite side from the Opera House you will encounter the Mercantile Hotel (where I met my wife). All pubs in Australia are called hotels due to the fact that a long time ago the law stated all pubs must offer accommodation. Keep going and then you will pass the Harbour View Hotel (which does not actually have that good a view of the harbour but has a pretty good view of the Harbour Bridge as it is right underneath it) and then you will be in Lower Fort Street where you will find the Hero of Waterloo which is where I used to start my drinking every weekend for many years.

Now I have talked about Circular Quay I can move on to talking about the primary key of the database tables I want to create. For a while it was really fashionable to have a GUID as a primary key of a database table, and indeed all BOPF tables have such a key. I however never liked that very much, I am an old fashioned dinosaur who likes the fact that VBAK and VBAP are linked together by VBELN and POSNR neither of which is a GUID. Luckily for me the SAP needle has moved and now having logical fields for the primary key is back in fashion again. You can even use BOPF for such tables though a bit of a workaround is needed.

So I will have the Monster header and item table use GUIDs as primary keys, and the delivery table for good measure, just to demonstrate that this is what BOPF likes, but the other tables will have sensible primary keys like order number and order item number, which is what everyone outside of SAP is comfortable with.

Modern Romance

Now is the time to talk about the downloadable code which accompanies the book. I initially thought that when you bought a book you would get a secret code or something which granted you access to such code, but in actual fact SAP Press have decided it is far easier to just let anyone who wants it have it for free. You just go to the “associated materials” bit of the home page of the book. Naturally the code does not make a whole load of sense without having the book as a reference.

I have the downloadable code in three flavours, depending on how “modern” you or your organization are.

  • Transport files, which naturally contain every single type of object, but they will all be created as “foreign” objects in your SAP system

  • SAPLINK nuggets, which create “native” objects in your system. However not every type of object can be installed using SAPLINK e.g. no CDS views. Moreover you get an error trying to install an ABAP ZIF interface which has an event. I document how to get around that in the associated material, it does require a code change to one of the SAPLINK classes.

  • Everything is also on a GitHub repository.

  • https://github.com/hardyp/AbapToTheFuture03


The GitHub repository is the way forward. Every type of object (apart from BRF customising) can be downloaded via this method and they all come out as “native” as well. Most importantly if you find errors in my code, or just think the way I have done something is incredibly stupid, you can fix up the code yourself and submit a “pull request” to the repository. You may wonder why anyone would go to the bother of correcting or improving code of a made up business process relating to monsters, and in doing so helping me with my next book, that would be crazy, no-one would do that! In fact due to human nature if someone thinks I am wrong/a fool then they will be physically incapable of not telling me this fun fact by whatever mechanism they can find. The series of blogs about BOPF that came out when I wrote the first edition is a case in point.

So the very first step is to install abapGit. You will not regret it, I only hope your organisation is forward thinking enough to allow such a thing. I give instructions on how to do this in the book but honestly it is so easy you could figure it out in your sleep. Just follow the following link:-

 

https://docs.abapgit.org/

 

Since in the not so distant future abapGit will be replacing the STMS change and transport system (CTS) you had better get used to it in a hurry, any other sort of attitude would be like King Canute trying to order the tide not to come in.

 

Anyway in the GitHub repository underneath the topmost SRC node the folder structure mirrors the SAP package hierarchy I created, using the exact same names of the packages.


Package View Inside SAP


Package View Inside GitHub

Note that the most important package is ZMONSTERS_C00_DDIC_OBJECTS and nothing else will work without that as it contains the domains and data elements and structures and what have you that all the other chapters rely on. Hopefully because of the word “MONSTER” in the name of all these objects there will not be a naming conflict in your system, unless you are as bonkers as I am.

 

NARRATOR: Meanwhile whilst the plans for how to download the code were unfolding, on that – fateful – night, the night before the SAP Press gala party, our hero’s SAP and ABAP had made it to Castle Frankenstein. They were welcomed at the door by the hunchbacked butler RICEF who is also an ABAP developer himself. All SAP and ABAP wanted to do was access a phone so they could report that there car had broken down, but instead all RICEF wanted to do was introduce them to some other staff at the castle, namely MDG and C/4 HANA, along with assorted monsters and describe the correct things to say when doing a speech at an SAP conference like SAPPHIRE NOW or TECHED. To demonstrate this they sang a song that the CEO of SAP Press had sung at a major SAP event.

 

Here was the press release:-



And the song went like THIS….

*----------------------------------------------------------------------------------------------*

Song: The Paradigm Shift

*----------------------------------------------------------------------------------------------*

RICEF:

I am seething;

It’s Emotionally Pleasing;

Indirect Licencing Fees take their toll

But listen closely...

MDG:

Not for very much longer

RICEF:

I love change control

I remember doing the Paradigm Shift

Drinking those moments when

The Buzzwords would hit me

RICEF:

And the SAP HANA VORA would be calling...

Monsters:

Let's do the Paradigm Shift again

Let's do the Paradigm Shift again

Narrator:

It’s one million tons of bananas

All:

And then a change of the game

Narrator:

It works straight out of the box

All:

You bring your blocks in chains

But it's the constant product name changes

That really drives you insane

Let's do the Paradigm Shift again

Let's do the Paradigm Shift again

MDG:

Its so dream box, oh fantasy cuckoo clocks,

So you can't see me, no, not at all

I’ve been design thinking, with my garden sprinkler,

Well secluded, I’ve got a Digital Core

RICEF:

With a bit of a sunrise

MDG:

You're into the intelligent enterprise

RICEF:

And nothing can ever be the same

MDG:

You're spaced out on sensation

RICEF:

Like you're undergoing a digital transformation

All:

Let's do the Paradigm Shift again

Let's do the Paradigm Shift again

C/4 HANA:

Well I was walking down the street, just a twisting and turning

When Leonardo the Turtle gave me some Machine Learning

He shook-a me up, he took me by surprise

He had a self-driving electric truck, and the devil's eyes

He stared at me and talked of IOT

I felt big data washing over me

All:

Let's do the Paradigm Shift again

Let's do the Paradigm Shift again

Narrator:

It’s one million tons of bananas

All:

And then a change of the game

Narrator:

It works straight out of the box

All:

You bring your blocks in chains

But it's the constant product name changes

That really drives you insane

Let's do the Paradigm Shift again

Let's do the Paradigm Shift again

NARRATOR: Here we leave things for the time being, with the author about to actually start creating the various ABAP artefacts needed for the downloadable code, and SAP and ABAP in Castle Frankenstein where they – foolishly – think they are going to be able to phone for help regarding their broken down self-driving electric car. What unspeakable horrors await all three “actors” in this waking nightmare? Find out in next week’s episode of the Rappy Horror abapGiture show….

https://www.sap-press.com/abap-to-the-future_4751/
Labels in this area