Quantcast
Channel: ABAP Development
Viewing all 948 articles
Browse latest View live

SAP Australia User Group Conference 2016

$
0
0

SAP Australia User Group Annual Summit 2016

 

 

 

5th/6th September 2016, Hilton Hotel, Sydney

 

Before I start - last time I created a blog on SCN I was able to attach pictures, and have formatting e.g. make sections titles bold, and change the font and so forth, All that has vanished, but in return I can now paste in the contents of a word document. I don't know if that is better or worse. Anyway, leaving that aside, let us get going:-

 

We in Australia are lucky to have a large amount of SAP Conferences every year. One of the more important ones is the SAP Australia User Group, a not for profit organisation. SAP has an enormous market share in Australia and a truly staggering amount of organisations are represented at this event.

 

Naturally I could not go to every talk, and I was presenting myself which slightly limited the amount of presentations I could attend, but I will describe the ones I did go to, and try to avoid any mention of dustbins, or food reviews.

 

Day 1

 

image001.jpg

 

Figure 1: Dustbin

 

Keynote – Digital Economy – SAP

HANA

UI5

Internet of Things

Big Data

Mobile

Pokémon Go

Uber

 

Keynote – Clouds R Us – Lenovo

 

There was a survey about how many people in Australia are happy with their “digital experience” by which I think – hope- they are talking about online transactions. Anyway, the amount of people who are happy is 16%, which means companies have a long way to go.

 

One thing that was clear to me was that despite every year people saying this cannot go on, Moore’s law is still alive and well. In 2012 Lenovo presented at an SAP event a 200TB HANA database using 17 racks of beef. In 2016 they did a similar presentation, this time they only needed 7 racks.

 

In the final “Doctor Who” episode with Tom Baker “Logopolis” he went on about “bubble memory” which did not lose its contents when you turned the power off. He then went on to save the entire universe from destruction using this technology when the Master tried to rule the universe with a giant telescope, which, as a side effect, turned the power off.

 

Anyway, a lot of people are worried about a HANA database having all the data in memory in case the power goes off. Naturally, in HANA world all transactions are actually saved to persistent storage as well as being in memory, but apparently soon we will have “persistent memory” such as that used by the Doctor, and if the power goes off for fifteen seconds, the data in your HANA memory will still be there.

 

Morning Tea

 

For morning tea the first day there was a light salad. Half way through the SAP Senior Vice President of Sales and Marketing appeared, with an axe, covered in blood, and promised the delegates two things (a) there would be plenty of meat on the menu from this point forward during the conference and (b) the days of silly journalists constantly saying that SAP was being threatened by the likes of Workday, Salesforce, NetSuite, Microsoft and Oracle were over once and for all.

 

This was washed down with 10 year old cold tea served in a paper bag with “Run Simple” written on the side.

 

Breaks are a time for delegates to reflect on the content of the keynote speeches. One topic that keeps getting highlighted is the disruptive business of model of some sort of new Taxi firm. It succeeded where others have failed, by the use of the very latest technology, but more importantly changing the business model by deciding to bypass the things boring square traditional taxi drivers have done, like buying permits, paying tax, having insurance, being sober and generally doing all the things they were forced to do by law.

 

Panaya

 

I read on the BBC news the other day that due to the recent success at breeding Pandas in captivity, they might be taken off the “endangered” list.

 

This talk was not about Pandas however, Panaya is a company which has a cloud product which analyses your SAP system and tells you what you need to test, what is likely (or 100% going to) break when you install a support stack or do an upgrade.

 

As a disclaimer I have used their product twice during an Upgrade, once in Germany, once in Australia, and it gets a thumbs up from me.

 

Graham Robinson – Gateway Services

 

Graham was giving a dry run of his presentation for SAP TechEd in two weeks. In fact many of the other presenters were doing the same, and later on that day I was recapping a speech I had made at that event in Las Vegas last year. I just make this point to show that the sort of presentations you get at this event are often exactly the same as you get at mainstream SAP events in the USA.

 

Graham made the point there is very little material out there on how to best create Gateway Services, this whole subject is still a very new technology albeit one that is just entering the “exploding” stage where lots of companies are doing pilot projects all at once. I myself will be working on this full time for the next few months.

 

As such, Graham said that whilst he is still learning – as are we all, all the time – he would tell us the “gotchas” he had already encountered so we did not fall into the same traps.

 

Tips like not putting business logic in the “Data Provider Class” as that prevents re-usable code. Instead you need a “model” class for the sales order (or monster, or whatever) that sits apart from the framework and can be re-used by several different services, or indeed any other  caller from within or outside the SAP system. I know a German gentleman who would have been very angry to hear that.

 

The other top tip I recall is not to accept the text descriptions auto-generated by the framework, blank out all the values in that column, as if you accept the suggestions text symbols are generated, and if at some point you add a new field in the middle of the structure all the descriptions of the existing fields get messed up – oh dear!

 

Lunch

 

For lunch of the first day the centrepiece was “special kebabs” on solid gold skewers. Some delegates were deeply suspicious of the odd taste of the kebabs, and wondered exactly what sort of meat they could be made out of, especially considering the mysterious disappearance of Workday CEO Aneel Bhusri the day before.

 

This was washed down with 20 year old aged vodka, served in an inverted traffic cone with the phrase “Digital Transformation” written on it five thousand times.

 

More Graham Robinson

 

This is the sort of subject that cannot be covered in an hour – or even in a day most likely, but he managed to give us (well I can only speak for myself) a bucket load of information I did not know on this subject a few hours earlier, and I have done quite a lot of experimentation in this area myself.

 

Me – ABAP Channels

 

I gave this speech in Las Vegas last year at SAP TechEd, and also have a chapter on the subject in the second edition of my forthcoming SAP Press Book, released on September 19th.

 

The idea is that a lot of applications are very inefficient due to the need for constant polling – checking the database (or whatever) every second to see if anything has changed.

 

With the ABAP Channels technology this is replaced by a “publish and subscribe” mechanism where an application at start-up says “I want to know about all updates to Monsters at Laboratory 1000” and then other applications that make changes to Monsters publish the fact and the broker forwards on the changes to all interested applications which then auto update without the user having to do anything like press a refresh button.

 

This is intended for use where both applications are running in a browser. I am not supposed to say so, but this also works for two SAP GUI applications, which I think is the most wonderful improvement imaginable.  Sadly SAP is quite likely to remove the SAP GUI aspect of this technology in releases subsequent to 7.5, which would be a crying shame in my opinion.

 

The person who was supposed to MC my session did not turn up, so at the end I presented myself with a bottle of wine and thanked myself very much. I was very appreciative.

 

Afternoon Tea

 

For afternoon tea on the first day the centrepiece was “special burgers”. Some delegates were deeply suspicious of the odd taste of the burgers, and wondered what meat they could be made out of, especially considering the mysterious disappearance of Salesforce CEO Marc Benioff the previous day.

 

This was washed on with 40 year old aged rum, served in an emerald encrusted sold bronze goblet with “HANA Montana” written on the side.

 

Rawson Homes – Mobile Purchase Orders

 

The poor old CIO of Rawson Homes also had the person who was supposed to MC his session vanish, but lucky for him I was roped in to do the job instead, so he did not have to present himself with a bottle of wine at the end.

 

During the housebuilding phase the builders at Rawson Homes had to create a lot of manual purchase orders which was a very paper based horrible process. Moving this to a mobile application worked wonders, which was a great success, as I know first-hand how adverse a lot of people in the building industry are to new technology.

 

Drinks

 

Networking is a very important part of conferences. The idea is that due to the large number of delegates present from a variety of different organisations, if you mingle with new people then chances are you will encounter someone who has come across the exact same problem you have currently got, and can you tell how they solved it. Over time you will build up a strong network of contacts who will stay and touch and use their collective brain power to solve problems encountered by any individual in that network.

 

So of course 99% of people spend the evening drinking and talking with the colleagues they came to the conference with, and when I suggested to one of my colleagues once that we go and find someone we didn’t know, and talk to them, they looked at me like I was Jack the Ripper.

 

Networking drinking binges are a time for delegates to reflect on the content of the keynote speeches. One topic that keeps getting highlighted is the disruptive business of model of some sort of new rental firm. It succeeded where others have failed, by the use of the very latest technology, but more importantly changing the business model by deciding to bypass the things boring square traditional landlords have done, like paying tax, having insurance, complying with building regulations, not having evil clowns hiding under the bed and generally doing all the things they were forced to do by law.

 

Day 2

 

image002.png

Figure 2: Myself preparing for my speech

 

Keynote – Digital Business – Ray Wang

 

Ray Wang is a fantastic speaker. He jumps up and down and shouts at the audience, makes jokes and keeps us all entertained, which is vital in any sort of public speaking.

 

He asked the audience how many people had a particular sort of smart phone in 2006, lots of people put their hands up, and he said it was not released till 2007. That makes me laugh, but then I am very childish.

 

He made lots of points, the main ones that struck home were that in the 1950’s the average company lifespan (from incorporation to going bankrupt or getting acquired) was about 60 years. Nowadays it is about 7 – 12 years. Since 2000 about half of the Fortune 500 companies are no more, and in 2015 half of the surviving ones lost money. So the current business environment is a lot more turbulent than you might think.

 

Keynote – Digital is Really Good – UXC Oxygen

HANA

UI5

Internet of Things

Big Data

Mobile

Pokémon Go

Uber

 

Morning Tea

 

For morning tea on the second day the centrepiece was described as “hot dogs with special sausages”. Some delegates were deeply suspicious of the odd taste of the sausages, and wondered what sort of meat they were made out of, especially considering the mysterious disappearance of NetSuite CEO Zach Nelson the previous day.

 

This was washed down with 60 year old aged wine, served in a ruby encrusted solid silver goblet with the five thousand names the BW product has had in its history written around the side in a spiral pattern.

 

Breaks are a time for delegates to reflect on the content of the keynote speeches. One topic that keeps getting highlighted is the disruptive business of model of new start-up DoctorUB. It succeeded where others have failed, by the use of the very latest technology, but more importantly changing the business model by deciding to bypass the things boring square traditional Doctors have done, like going to medical school, paying tax, having a licence to practice medicine, being sober whilst operating and generally doing all the things they were forced to do by law.

 

UX – SAP – One – Roadmap for Fiori/UI5

 

When I was writing the second edition of my good old SAP Press book, my editor was really worried that I opened the chapter on UI5 with what appeared to be a really savage attack on SAP’s user interface and how people hated it.

 

I replied that I was thinking of the past rather than the present/future and quoted the CIO of Nestle who had said that using SAP was like peeling an onion – it has many layers, and it makes you want to cry.

 

SAP is now actually getting awards for the user interface design of some of its latest applications, which is a gigantic turnaround. This talk was given by an SAP employee so he could not be overtly negative about the past, but to be there seemed to be a tacit admission of how bad the SAP GUI has always been, which is of course not news to anyone.

 

The arguments for UI5 were that “you did not need a degree to understand the screen” and the monetary benefits were reduced training costs and reduced errors due to people not getting confused by over complex screen designs. The fact that a huge bunch of such benefits – both hard and soft – are claimed for UI5 implies that none of those benefits have ever been there before on SAP screens.

 

SAP now say they no longer claim that they know what the end user wants more than the end user themselves. I am glad they admit this used to be the case – it was what I always thought they meant by “best practice” i.e. “this is way you should be doing it, you fool”.

 

Another key strand of the Fiori design is “coherence” which again is the opposite of what went before where the SD, MM and FI modules had screens which looked absolutely nothing like each other.

 

SAP have now announced “Fiori 2.0” which is for S/4 HANA really by the looks of things, and does look really groovy I have to admit. Some elements are only in S/4 HANA like the “notifications” section of the screen (a sort of workflow inbox on steroids, which comes looking for you rather than you checking it periodically) but most will be available in ABAP version 7.50/7.51.

 

Since all the screens in S/4 HANA are supposed to come via the web, and there are a lot of such screens, naturally they are not all UI5 as yet. As an interim step SAP are making the remaining transactions – accessed via WDA or the SAP GUI for HTML – look like Fiori applications.

 

The BUILD tool was mentioned (I talk about that in the new version of my book as well) for rapid prototyping, and automatic code generation based on such a prototype.

 

Much was made of the Apple/SAP partnership, where you can build Fiori applications that work natively on Apple devices using the iOS.

 

Next came the SAP version of Siri/Cortana which they called “Co-pilot” this week though that will not be the final name. To me it seemed like the famous Microsoft Paperclip (“It looks like you are trying to kill yourself, shall I order some rope?”) only with artificial intelligence and machine learning. This and the addition of “bots” is aimed at having a “Conversational UX”.

 

UX – SAP – Two – Fiori Elements

 

The more things change the more they stay the same and the one thing that stays the same at SAP is renaming every single thing every day. I wonder if the marketing people realise what a laughing stock that makes them?

 

SAP say that thus far they created 949 UI5 “apps” and that is still only scratching the surface of what is needed, so they need to create them a billion times faster than before, and for that they need to have better tools inside the Web IDE for creating such applications.

 

The artist formerly known as “Smart Templates” inside the Web IDE are now known as “Fiori Elements” this week. The best name SAP ever came up with for such things was “floorplans” as in “Floorplan Manager” as you can get your head around that – screen designs for similar applications where you can find the same sort of information in the same place each time.

 

UI5 application started off where you code everything yourself, and lots of people loved that. Then SAP came out with “freestyle templates” which are just like floorplans and the code is generated and then you mess about with it yourself, thus avoiding  writing the boilerplate code but then you can change it however you want.

 

A “smart template” however is controlled by the backend system (model) i.e. you have the  model view and controller all inside the model, in fact inside the database as this is all controlled from a CDS view with annotations. How do you like that for a separation of concerns, boys and girls?

 

Instead of generated code on the front end the “elements” are generated at runtime based on what has been defined in the back end – you have so called “smart controls” reacting to annotations inside the CDS view. You can also have an annotation file sitting in the Web IDE as well which over-rides the annotations in the back end.

 

Let us end with some definitions:-

 

“card” – area of the screen which contains some sort of control e.g. a list, a table, whatever.

 

“break out” – this is a user exit, where you add or remove sections of your floorplan screen, or have some pre-processing before a section is rendered and so forth. I am not sure how or where you code these.

 

“analytical list page” – a better sort of ALV (my description) where you have assorted graphical and clickable filters at the top as well as the sort of filters we are used to

 

“belize” – a new theme replacing “blue crystal” which is so five minutes ago. The Blue Crystal Theme, when activated, made your SAP screen look like you had just taken a large amount of LSD, so hopefully the new one is a bit calmer.

 

Lunch

 

For the second days lunch the centrepiece was what were described as “special pies”. Some delegates were deeply suspicious of the contents of the pies for three reasons (a) the striking resemblance of the pie fillings to the consistency of human brains (b) the sighting of famous chef Hannibal Lecter in the kitchen area of the hotel and (c) the mysterious disappearance of Microsoft CEO Satya Nadella the previous day.

 

This was washed won with 80 year old aged whiskey, served in a pearl encrusted solid gold goblet with “The best digital e-businesses run SAP” written on the side.

 

Guerrilla UX Design – Simon Kemp

 

I think this time I am going to summarise Simon’s talk in a series of bullet points, a mixture of what he said and my reaction to it, if any.

On a bus or a train, everyone has their head down, looking at smart devices. Those devices must have an acceptable UI, or people would look out the window instead or – horrifying as it may seem – talk to each other.

 

Application design used to be about what the business experts thought the end user wanted, plus what IT said was technically possible. The radical new idea is to actually involve the person who will use the application. In my company we picked five people, who did one task all day every day in SAP, and sent them away in different rooms and told them they had fifteen minutes to design a screen they would use all day, every day, for the rest of their time with the company. That focused their minds I can tell you, and one of the resulting designs was a corker.

 

Traditionally the user acceptance testing was right at the end, one day before go-live and if the users said it was rubbish, the solution was not to change the application but send ten billion dollars on training.

 

The business experts often have no idea what the business wants, IT even less. Even the end users may not know what they want.

 

Do not SHOW the end users your prototype. Make them use it.

 

SAP has had a radical new idea – they have committed recently to trying to understand what the problem is first, before fixing it. I wish some of the people at my company would adopt that attitude.

 

You test the application before you build it. If that sounds impossible, look up “test driven development” on the internet.

 

The only way you will ever get this right is to shadow the end users. Watch what they do over their shoulders. Install hidden cameras on their desk when they are not looking. Go through their garbage. Dress up as a vending machine and follow them about. They won’t suspect a thing.

 

If you want the user’s feedback on something, piggy back off another meeting that has brought a group of end users to the main office. They came in to be trained on something, at the end of the meeting rush in and get them to test your new application before you let them out of the room.

 

Simon’s mum thinks the “camera” icon on Skype looks like a hot water bottle. Now it looks like one to me as well. The moral is that users do not see things the same way you do.

 

Simon is getting a t-shirt printed which says “I am not the user” many times in different colours. I am guilty of the crime of thinking I knew what they wanted. I replaced a “classical” SAP GUI table control with an editable ALV grid and thought people would like it. They did not. They said the squares were to small, you could not easily tell where the cursor was, and had to blank out zero values before entering new ones.

 

Do not use system language, but business terms. Before SAP I really wonder if anyone ever said “Ship-To” instead of “Delivery Address?” I always called suppliers “suppliers” before SAP, now I call them “vendors”.

 

What do end users want? In an application, for, example, I would like to be able to change my email address and phone number, if I had typed them in incorrectly by accident. In my SCN account details I had typed in my email address slightly wrong by accident. Now I cannot change it – the field is greyed out. I contacted SAP support who said:-

 

Unfortunately we cannot process your request to change the email to your user account.

By receiving your request we automatically put you on a list of users which will get notified once this new feature is released.

 

 

It never occurred to them end users might want this facility, and letting you correct faulty data you have entered will be an exciting new feature released at some point in the far future. Does that sound like having “empathy” with your user base?

 

Complex Fiori Applications – Chris Rae

 

I think Chris gave this talk as well at SAPPHIRE in Orlando earlier this year. It was all about lessons learned during a massive UI5 implementation at a Government department here in Australia. There were about 30 UI5 apps developed, and just as a bonus Hybris was involved in the mix as well. As you can tell the government in Australia is a very heavy SAP user and likes to go gangbusters with all the new technology.

 

The room was quite full, so a lot of Australian organisations represented. Chris asked who had created a Fiori app thus far and do you know, half the room put their hands up.

 

Anyway the advice was to stick to the original principal – one app does one task – even if some recent SAP training courses say the opposite. This one to one thing was the original purpose of all this, to move away from one screen that did a thousand things, like VA01.

 

“Deep Linking” is where one app calls another app, so you can still have navigation from one completed task to the next. Doing the flow one app at a time is better than one huge app, as the latter would have a long loading time, which is not good on a mobile device.

 

He re-iterated a point made by Graham Robinson earlier that you should not have any business logic in the Gateway “data provider class” as that hinders re-usability. Further information on such design can be found on SCN in some blogs by Leigh Mason.

 

When it comes to record locking UI5 uses the standard HTML5 concept of ETAGS which in Australia we use to pay for road tolls when we go through a motorway. The groovy thing about UI5 is that if you have ten fields on the screen, you change two, and then press SAVE and the update fails because the record is locked and has just been changed by someone else, the new state of the object you are playing with comes back, and the eight fields you have not changed are updated with the new values in the database but not the two you have just changed. This happens by Black Magic without you having to code anything.

 

In my book I mention SAP’s new concept of saving a record in a “draft” state where you have not yet filled in all the fields, and so in a traditional transaction like VA01 you could not save the record. In 7.5 there were some prototype classes in the BOPF framework to do this, but they did not work that well and an SAP person told they those classes were for the chop. It looks like the draft concept is only going to be implemented in S/4 HANA, another reason to force us to make the jump.

 

Afternoon Tea

 

For the last meal of the conference a huge pile of branches was assembled in the middle of the exhibition area and set on fire. On top of this was set a huge pot of water, out of which was served to the delegates something described as “Fillet of Larry Ellison” whilst the entire SAP senior management team, clad only in loincloths, swung through the trees on ropes, and then set about banging the bongos for all they were worth and chanting, to appease the hundred foot tall gorilla which lives on the other side of the island from the conference centre.

 

This was washed down with 100 year aged port, served in diamond encrusted solid platinum goblets with the mysterious acronym “ESOA” written on the side.

 

Me – Migrating to SAP HANA

 

Amazingly, I also talk about this subject in one of the chapters of my forthcoming book.

 

The ECC R/3 Business Suite reaches end of life in 2025, and those who desire to stay with SAP will have to migrate to S/4 HANA at some point. Naturally this means the entire SAP customer base moving to a HANA database as opposed to Oracle or whatever.

 

2025 will be here sooner than you think, but you can start preparing your custom code right now for the transition, with SAP provided tools.

 

SAP have gone out of there way to make this as complicated/confusing as possible, with over seven disparate products all with the name “S/4 HANA” some of which have nothing to do with ERP at all.

 

In essence, for an ERP system, there are three choices when moving to HANA. All of which you can do right now.

 

Move to “Suite on HANA” which is in essence a database upgrade, but needs a careful review of your custom code. This option runs out in 2025.

 

Move to the on-premise version of S/4 HANA, you can keep all your custom code, but it needs a radical review

 

Move to the cloud version of S/4 HANA. The entire custom code base needs to be rewritten in simplified ABAP or Java/JavaScript.

 

You may have heard buzzwords like “columnar storage” and the like. What does this mean in practical terms?

 

Cluster tables like BSEG become “real” tables, and are thus much easier to access

 

You no longer need 99.9% of secondary indexes on database tables – every column acts like it has an index on it

 

You no longer need redundant storage i.e. same field in more than one table with the same value e.g. master data values in transaction data tables, or index tables of any sort e.g. LIS

 

The order the fields come back in from a database read will most likely no longer be in primary key order

 

An enormous amount of tables are removed with the move to S/4 HANA.

 

This starts off with index tables like BSIK/BSAK which are just subsets of the data in BSEG, and in both finance and materials management 75%+ of the tables vanish. There is no more mixing of master data with transaction data.

 

The tables (such as BSIK) look like they are still there, but in reality they are now just views. This means a custom SQL read will carry on working just as before, but if you have custom Z fields in such a table they will need to find a new home.

 

Much more ominous, in S/4 HANA whole chunks of functionality have been removed – usually when there are multiple solutions for the same problem, SAP has whittled this down to one. For example, SD based Credit Management goes out the window, as does the traditional way of creating and maintaining vendors and customers (LFA1 and KNA1 tables) – you have to use “business partners” now.

 

If you go for the S/4 HANA on-premise model you can carry on more or less as before with your vast swathes of custom code, subject to the changes already mentioned.

 

In the cloud however the code base is shared, and is updated by SAP every quarter. Since the idea is that such updates cannot possibly break the existing standard SAP code (of course not) the amount of user exits and Z programs you can use is heavily restricted.

 

User exits will be in the form of BADIS with a restricted set of ABAP commands e.g. no dynamic programming, cannot use “unreleased” API’s to access standard SAP functions e.g. unreleased function modules and the like.

 

Large bespoke developments are supposed to be done using “side by side” extensibility where you write such applications in the SAP Web IDE and they communicate with the core ERP system. Moreover, you can use any programming language you want – as long as it is not ABAP.

 

SAP have created a range of new code inspector checks, so that when you do an analysis of your custom programs using the code inspector (which you do all the time I hope) potential problems that could occur when moving to a HANA database are highlighted.

 

This generally relates to presumptions as to which order records will be returned in from a database read, or attempts to access the underlying database table behind a cluster table, which will no longer work on a HANA database.

 

It is worth noting that many problems the code inspector highlights at the moment will result in even bigger problems in a HANA database – like the old chestnut where you only need two columns from a really wide table and do a SELECT * to bring every single column back. That caused big problems before, it will cause death in the new world.

 

In recent SAP releases the amount of dynamic check tools have increased dramatically.

 

What I mean by this is the ability to track every single thing that happens in production, by means of “Usage Procedure Logging” (UPL) for the whole year so you can take account of year end, and see how often custom code is executed right down to the subroutine level.

 

You will perhaps be surprised to find that 75%+ of your custom code is never used at all, as it was created to address problems that no longer exist. The tendency is to just add more and more Z code each year and never remove any, even after the need for it has gone.

 

Knowing what is not used is very important, that way you can concentrate on not breaking the custom code that IS used.

 

There are also tools to import the productive data into the development system where you can analyse custom code for expensive SQL statements which could benefit from HANA specific features like having more logic run inside the database. Such “code push down” is a task for after the migration generally, though you can create so called CDS views on an Oracle (or whatever) database if you are on 7.4 or above, ready for the migration. Such views would not run any faster on an Oracle database though,

 

As the changes associated with S/4 HANA are quite dramatic SAP have provided a tool to help you work out what will break.

 

You will need an SAP system that is on ABAP 7.50, either create a sandbox system for yourself or use the SAP “Cloud Appliance Library” to create a temporary system just for this purpose.

Then you install an extractor program on your current real ERP development system, and extract data about all your custom objects into a file. This involves getting the “where used list” up to date, which can take a week or more.

 

You then run a job whereby the 7.5 system goes and looks on the web where SAP has the most current information about the changes in S/4 HANA.

 

This is the “simplification database” and the latest information is stored on your 7.5 system.

 

Lastly you upload the file containing the information about your current custom code to the 7.5 system, it compares that information to the “simplification database” information and comes back with a big list of what is probably going to break.

 

When you see the list of what is going to break you will most likely have a heart attack and drop dead on the spot.

 

If you survive, you will come to realise what is being reported is just the same few warnings many hundreds of times, rather like the error log you get from Java programs.

 

For each such warning you are pointed to an OSS note which details the potential problem and what to do about it. The good news is that these OSS notes are generally rather better written than what you may have become accustomed to.

 

For example you are told when your custom programs are writing to Z fields in tables that no longer exist, or doing a “call transaction” to a TCODE which is simply not there in S/4 HANA.

 

Marble Bar

image003.jpg

 

Figure 3: Marble Bar

The Marble Bar sits underneath the Sydney Hilton Hotel and is well worth a visit. Down a short staircase from the busy George Street, which is currently a huge construction site, rebuilding the trams that were ripped out many years ago, is another bygone world of elegance. My American mates would be happy is there is table service, which is far from a given in Australian drinking places.

 

After conference drinks in a venue that looks like it is several hundred years old is a time for delegates to reflect on the content of the keynote speeches. One topic that keeps getting highlighted is the disruptive business of model of GetCashQuickUB. It succeeded where others have failed, by the use of the very latest technology, but more importantly changing the business model by deciding to bypass the things boring square money lenders have done. This new business model involves going into a bank with a sawn off shotgun, shooting all the staff and bystanders, blowing up the safe with dynamite, and then swanning off to the South of France with the loot. Even better, there is no pesky financial institution wanting the money you have borrowed back, and no interest to pay. It’s obvious why all commentators in the technological space keep on about how successful new businesses like this have been, and how we should all follow their lead.

 

Conclusion

 

This was one of the better SAUG conferences in recent years; I think all the “pre-TechEd” speeches gave it the edge, so it is no surprise that next year’s event is going to be at the same time.

 

The even better news is that the Sydney Darling Harbour Exhibition Centre is finally going to re-open after having been knocked down several years back. The SAUG conference will be there next year, and in fact I imagine a lot of SAP conferences will be returning to Sydney, which is bad news for Melbourne.

 

The quality of the dustbins was also very high this year, and the unusual food served gave the whole event a certain “je ne sais quoi”. I can’t wait till next years!

 

Cheersy Cheers

 

Paul


A simple tool to display product hierarchy in an ALV tree

$
0
0

Recently I start to study SD and I found the product hierarchy in transaction code V/76 could not be viewed in tree style and it is not so convenient to check:

clipboard1.png

So I wrote a simple report to retrieve hierarchy data from table T179 and display the data in a tree as below:

clipboard2.png

The source code of report is listed below:

*&---------------------------------------------------------------------*

*& Report ZDISPLAY_HIERARCHY

*&---------------------------------------------------------------------*

*&

*&---------------------------------------------------------------------*

REPORT zdisplay_hierarchy.

 

DATA: g_alv_tree TYPE REF TO cl_gui_alv_tree,  gt_data TYPE STANDARD TABLE OF zcl_alv_tool=>ty_displayed_node,  ok_code LIKE sy-ucomm,  save_ok LIKE sy-ucomm,  ls_data LIKE LINE OF gt_data.
END-OF-SELECTION.  DATA(lo_tool) = NEW zcl_alv_tool( ).  DATA(lt_fieldcat) = lo_tool->get_fieldcat_by_data( ls_data ).  PERFORM change_label.  CALL SCREEN 100.
MODULE pbo OUTPUT.  SET PF-STATUS 'MAIN100'.  SET TITLEBAR 'MAINTITLE'.  IF g_alv_tree IS INITIAL.  PERFORM init_tree.  CALL METHOD cl_gui_cfw=>flush  EXCEPTIONS  cntl_system_error = 1  cntl_error = 2.  ASSERT sy-subrc = 0.  ENDIF.
ENDMODULE. " PBO OUTPUT
MODULE pai INPUT.  save_ok = ok_code.  CLEAR ok_code.  CASE save_ok.  WHEN 'EXIT' OR 'BACK' OR 'CANC'.  PERFORM exit_program.  WHEN OTHERS.  CALL METHOD cl_gui_cfw=>dispatch.  ENDCASE.  CALL METHOD cl_gui_cfw=>flush.
ENDMODULE. " PAI INPUT
FORM change_label.  READ TABLE lt_fieldcat ASSIGNING FIELD-SYMBOL(<id>) INDEX 1.  <id>-seltext = <id>-reptext = <id>-scrtext_m = <id>-scrtext_s = <id>-scrtext_l = 'Hierarchy ID'.  <id>-outputlen = 20.  READ TABLE lt_fieldcat ASSIGNING FIELD-SYMBOL(<text>) INDEX 2.  <text>-seltext = <text>-reptext = <text>-scrtext_m = <text>-scrtext_l = 'Description'.  <text>-scrtext_s = 'Text'.  <text>-outputlen = 40.
ENDFORM.
FORM init_tree.  g_alv_tree = lo_tool->get_tree( ).  DATA l_hierarchy_header TYPE treev_hhdr.  PERFORM build_hierarchy_header CHANGING l_hierarchy_header.  CALL METHOD g_alv_tree->set_table_for_first_display  EXPORTING  is_hierarchy_header = l_hierarchy_header  CHANGING  it_fieldcatalog = lt_fieldcat  it_outtab = gt_data.  PERFORM create_tree.  g_alv_tree->frontend_update( ).  lo_tool->expand( ).
ENDFORM.
FORM create_tree.  DATA(lt_data) = lo_tool->get_hierarchy_data( ).  lo_tool->draw_tree( lt_data ).
ENDFORM. " init_tree
FORM build_hierarchy_header CHANGING p_hierarchy_header TYPE treev_hhdr.  p_hierarchy_header-heading = 'Material hierarchy'.  p_hierarchy_header-width = 30.  p_hierarchy_header-width_pix = ' '.
ENDFORM. " build_hierarchy_header
FORM exit_program.  LEAVE PROGRAM.
ENDFORM. " exit_program

In order to use the report, all you need is to just create a new screen :

clipboard3.png

And drag a custom container to screen with name "CCONTAINER1":

clipboard4.png

The source code of utility class zcl_alv_tool could be found from this blog.

Quick take on Dump with exception LCX_VALIDATION_ERROR in PPM

$
0
0

Hi all,

 

Here I am with my first blog, probably first on any platform

 

This is about an issue which I faced on my current project recently. Many of the users and team members started getting below error during opening a PPM(Project Management or Portfolio Management) item

Frontend Error.JPG

 

ST22 details are as below:

Dump and Text.JPG

 

 

Initially, we thought that it is due to some role issue as not everyone was getting this error. Second, since this message was about 'Company Code', and corresponding WebDynpro component had custom field for Company Code, we thought that some issue in custom enhancement of this screen and started looking for it.

 

After few hours of struggle, I came across SAP Note https://launchpad.support.sap.com/#/notes/2166738 which explains the reason and solution for this problem.

 

Reason:

Help documentation of some data elements contains hotlinks which cannot be properly rendered by WebDynpro. As WDA try to display help text same as help in the WebDynpro frontend, processing gives error. (e.g. data element BUKRS)

Data Element-Help.JPG

 

Above help text was converted as below string and that is where code was giving mentioned error, as text "GL: company_code" is not a tag.

The <GL:company_code>company code</> is an organizational unit within financial accounting.

 

 

Solution:

As per SAP Note, for an individual user, this can be solved by disabling 'Quick Help' on user screen.

I tried this for hours by disabling the 'Quick Help' on 'Summary' screen of PPM items, but nothing changed. That is when I thought to take a tea-break

 

It(tea-break) really worked I got this thought that probably disabling Quick Help need to be done at next screen where I am getting this error. Question was - How?

 

Solution-1

So I used this dirty trick(I would say it 'dirty trick' as there is a standard & better way of doing it, which I came across later):

1. On the screen where we are getting error in front-end, right-click and 'Properties', which will give URL of the screen

Properties.JPG

 

2. Copy this link and paste in your browser.

3. Search for term APPL_MODE and change the value to '3' and then press Enter.(It will ask user credentials)

4. Now, you can see the PPM Item screen without any data. Right click and click on 'Hide Quick Help'.

Hide Quick Help.JPG

 

5. Try now from regular process and you will be able to see details for current application.

 

Problem with above approach is that

1. we cannot fix it for someone else as it needs their credentials.

2. It requires few technical steps which every user may not be able to perform

 

Solution-2

So, here is the Standard/Admin approach to fix this:

 

Each WebDynpro configuration is unique in terms of user customization. Here what happened is that user clicks on 'Display Quick Help' on a screen and this setting is registered for user and configuration combination.

Using WDA 'WD_ANALYZE_CONFIG_USER' , we can delete this combination of user and personalization, which will default the Quick Help setting to 'Hidden'.

Below are the steps:

1. Get Component configuration for component as below

Know Component Configuration.JPG

 

2. Run WDA WD_ANALYZE_CONFIG_USER, provide all inputs and click on 'Display'

Run WDA.JPG

 

3. Below details will be displayed. Select relevant entry and click on 'Delete'

Delete Personalization.JPG

 

4. Next -> Party time

 

 

Above two solutions are for individual users and not at a system level. As per SAP Note 2166738, in order to fix it for all users, we need to change the help-text of  fields creating problem. Detailed steps for this can be found in SAP Note(2166738) itself.

 

I've tried to put maximum details of issue and solution. If you feel that something can be added/enhanced, please do let me know.

 

Thanks for reading!!

 

Warm Regards,

Shyam Agrawal

SAP Communicator 2.0 Part 1

$
0
0

                                                      1.jpg

Followed to my last blog,


Let's Chat in SAP GUI

 

The same application has been enhanced with lots of more new options, which we all use so often in other Chat Applications.


Below are new points has been added in application.

1.User Categorized by

    1. a.Online
    2. b.Off line
    3. c.Bookmark &
    4. d.Group

2.User Setting

3.Set chat font

4.Set Chat Back ground colour

5.Set chat font colour

6.Set User chat Picture

7.Set Chat background picture

8.User Current Status

9.Chat with Multiple user at same time.

10.  Add smiles in chat text

11.  Send Files

12.  Send document information

13.  Change status based on work.

14.  Listen chat information


User Category


Below is initial screen of chat, initially screen contains no user information.

                                   2.jpg

By using search option, user can search all users from current system.

Search string could be user name or like name or blank to get all online or offline users.


                              3.jpg

Based on selected tab, either online or offline, users will display in search window to selected any one user to start chat.

                                  4.jpg

By selection of any of user from search window, chat window will option (as below)


                                    5.jpg

Chat window title would be based on selected user.

Selected chat user will add in main application window, if the same does not exist after closing chat window.

                                     

                                       6.jpg

Every user contains three options in display with name.


1.7.jpgUser chat picture, this can be change by setting.



2. 8.jpgBookmark user for fast access through bookmark tab



3. 9.jpgAdd in group to categorize user id in groups.


By selection of bookmark option, it turns to green colour and selected user will be adding in bookmark tab.

                                     10.jpg                        


To add user into a group, select 12.jpgoption. By selection of group option, a pop-up screen will open to select an existing group or create new one.


                                      13.jpg

Initially, group drop-down contains, ‘NEW GROUP’ option, by selection of this option another screen open to provide a new group name.

                                      14.jpg

After enter group name, selected user will be display under group tab under selected group name.

                                        15.jpg

New group name will display in group pop-up/drop-down to add another user into same group.


User Setting


                                       17.jpg


User setting option covers below option.

a.      Set chat font

             Chat fonts option contains all font information, by selection of font from drop down, selected font style will be display "this  is sample of selected font".


b.      Set chat font colour and Chat Back ground colour

            By selection of 20.jpgoption, a new pop-up window will open to choose font and chat colour.

Default or selected colours will be at the top with * option. Both font and chat background colour cannot be same. System will raise an exception message if both colours are same.

                                     21.jpg

C.      Set User chat Picture & Set Chat background picture.

             By default user picture will be same as displaying in above setting page. User can change chat picture by using “Set User Chat Pic” option. Note: size limit cannot be more then 0.5MB for user and 1MB for background picture for chat.

On acceptance of changes, if picture got changes, then user needs to provide a valid customize package name and transport request to store the selected picture in MIME folder.


SAP Communicator 2.0  Part 2



Happy Learning

Praveer Kumar Sen


SAP Communicator 2.0 Part 2

$
0
0

Hi,

 

Continue to part 1 of SAP Communicator 2.0

 

SAP Communicator 2.0  Part 1


Chat Screen Characteristics

                                            22.jpg


Selected use will be display under blue circle and the title will be the name of selected user.

By using 24.jpgbutton, user can add number of users in current chat windows. Once the number of users will increase, a thin scroll line will display (as in above picture) and user can scroll to select next users for chatting.

if user is receiving a message from a user who is not added in chat windows, then system will add the received user icon in queue.

                                           

25.jpg(Document): by using this option user can send document to selected use. The respective user can store the same into their local system.


                                                26.jpg

27.jpg(Status): By using this option, user can set current status and the same information will appear all other users, who are currently chatting with same.

                                              28.jpg

29.jpg(Smiles):  This is the same option what we use in other chat application to express our emotions.

                                                30.jpg

31.jpg(Display old Chat): In initial release, given “earlier conversation” option to load older chat information. In this release, given a different option to choose dates to display older conversation.

                                                      32.jpg

  It's a range option to display old chat information based on entered date range.

Output:

                                                          33.jpg

In output window, dates are hyperlink, by selection of date the respective date chat information will collapse or expand.

At a time only one day chat will display.

Send document information

With this option user can send a document number through chat, received user no need to open respective t-code to display document contents with provided document no.

User only needs to select document number  (hyperlink); system will open an option window to selected document information or type like interactive ALV option.

                                                          34.jpg

To send a document number user needs to enter information as below,

##Document No

In above picture, user sends DD03L table information by entering below chat string in chat.

                                                           35.jpg

In chat window, the same will display as hyperlink. By selection of information a new pop-up window will open to selected document type.

                                                                36.jpg

After selection of document type, document will open in separate session with selected t-code/document type.


Listen chat information

This is a new option, to listen the chat text. As per written logic, if chat text contains more than 100 characters, then a sound icon will be display.

                                                                37.jpg                                                               

By selection of sound icon, user will be able listen the full chat text.


User notification on login:

If any online user sends any message to offline user, then after login in system respective user will receive another information pop-up, which will contains messages.

                                                              38.jpg

By selection of OK button, chat application will open, where user will able to see the same notification as number in front of every user.

                                                   39.jpg

Final chat conversion Output with all options:

                                                40.jpg

System Configuration steps:

      Do not change name of any file, it may cause program display error.


Download sap communicator.rar from below GitHub link.


GitHub - ipravir/SAP-Communicatore-2.0: A chat application in SAP GUI


1.Unzip sap communicator.rar file, contains folders

    a.Header

    b.smiles

    c. objects


2.User ZSAPLINK program to upload all below files from object folder

    a.*.nugg

    b.*.slnk

    c.  Structures from structure folder


https://sap.assembla.com/spaces/saplink/wiki/SAPlink_plugin_list

3.Structure information is attached in text file, which needs to be creating manually.


4.Transaction name should be

    a.ZCHAT

    b.ZCHAT_ACTIVE

    c.ZCHAT_MSG


5.Enhancement SUSR0001 (T-Code CMOD) needs to be implement. Check ZXUSRU01 program.


6.Activate all objects (Domain, Data element, Class, Function groups, Programs)


7.Execute ZCHAT_ACTIVE program and follow all steps to create MIME folders, objects and initial data for all configuration related tables.

    Below folder will create in under SAP->PUBLIC MIME folder


41.jpg


The Application is created on SAP Netweaver 750 version with SAP GUI 7400.3.8.151 version patch level 8.


let me know if any error found on execution of program.



Happy Learning

Praveer Kumar Sen



Adding Incompletion log entries to Incompletion Log Internal Table XVBUV

$
0
0

The in-completion log reminds you when data important for further processing is missing from the sales document.


When you enter a sales document, the system usually proposes much of the necessary data from customer and material master records, and you can also enter additional data or change proposed data manually. The sales document then forms the basis for various subsequent functions, such as delivery processing and billing.


However, subsequent functions can often only be carried out if the data in the original sales document is complete. To guarantee completeness, the system logs all missing data in an in-completion log. The data needed to process subsequent functions is defined by your system administrator for each sales document type.


Path for finding Incomplete Procedures:

IMG -> Sales and Distribution -> Basic Functions -> Log of Incomplete Items or Go to T-code OVA2


1. The incompletion log have block at following in-completion groups

  • Sales - Header
  • Sales - Item
  • Sales - Sched. Line
  • Partner
  • Sales Activity
  • Delivery header
  • Delivery item



   Screen Shot - 1

Groups.png



2. Each in-completion group may have set of incomplete procedures/Error procedures.


   Screen Shot - 2

Procedures.png



3. Consider Incomplete Procedure ‘Z1’ and go to ‘Fields'

  

    Screen Shot – 3

Fields.png



  • ‘Fields’ of the Procedure contains following fields

      1. Table: - Specifies the table in which the field exists.

      2. Field name: - Specifies the Field name in the table.

      3. Description: - Description of the field (The error log message that displays during the Incompletion Log)

      4. Screen: - The function code displays the screen on which we can enter the incomplete data.

      5. Status Group: - Specify the corresponding status group.

      6. Warning: - Checking this field the system gives a warning when the user does not make an entry in the required field.

      7. Sequence: - Determines the sequence in which the system checks for the incomplete fields.



  • ‘Status Group Controls’ which subsequent documents can be blocked for processing, if the data in the mandatory field is missing.

    

    Screen Shot – 4

Status Group.png

Here if we check delivery we cannot create the delivery document if the data in the mandatory field is missing to which this status group is       assigned.



Consider an example how to add In-completion Log entries to the In-completion Log Internal Table


Based on a business logic/requirement user wants to display an in-completion message avoiding the order to be deliverable.


Consider field ZZBUYGRP which is not a screen field and appended to table VBAK. Whole idea of in-completion log is if certain field is blank system prompts us to fill that field before saving an order.


FromScreen Shot – 3 the field ZZBUYGRP is defined with description ‘Buying Group Approval’ under Sales Header Group. An in-completion log message ‘Buying Group Approval’ should trigger for missing Buying Group approval and when the document is saved with in-completion status then in general fields VBUK-UVVLK and VBUK-UVALLis set to ‘A’.


  

   Screen Shot – 5

Incompletion Log.png


And if the certain field is not blank then in-completion log message should not trigger setting fieldsVBUK-UVVLK& VBUK-UVALL to ‘C’ and SAP thinks the order is deliverable as the field VBAK-ZZBUYGRP assigned to Status Group 02 as per the Screen Shot – 4.


As a standard convention VBAK-ZZBUYGRP = ‘X’ when certain field is not blank which means there exists no In-completion log and VBAK-ZZBUYGRP = space when certain field is blank.


Since the In-completion log has to be triggered at Sales Header level, add the below code under all valid USER Exit inside MV45AFZZ.


* Set initial Values
vbak
-zzbuygrp    = ‘X’.

* For Create and Change

IF t180-trtyp = ‘H’ OR t180-trtyp = ‘V’
OR t180-trtyp = ‘A’.

* Only for Sales Document
IF vbak-vbtyp = ‘C’.

    IF (certain field) is not blank.

      CLEAR vbak-zzbuygrp.

    ELSE.

      vbak-zzbuygrp = ‘X’.

* Clear from incompletion log if exits.
READ TABLE xvbuv ASSIGNING <ls_xvbuv> WITH KEY vbeln = vbak-vbeln

                                                                                               tbnam = 'VBAK'

                                                                                               fdnam = 'ZZBUYGRP'.

      IF sy-subrc = 0.

* Delete the Entry from standard Incompletion table

        DELETE xvbuv INDEX sy-tabix.

      ENDIF.

    ENDIF.

ENDIF.

ENDIF.


Even if the certain field is not having value and the In-completion log is not triggering & this is due to record with respect to the ‘ZZBUYGRP’ doesn’t exist in the In-completion Log internal table, XVBUV.


Check all other possible User Exit available in MV45AFZZ. If still the In-completion log is not triggering even the certain field is blank, add the below code adding in-completion log entry to the In-completion Log internal table XVBUV.


Field TVAK-FEHGR willcarry the Error Procedure (Z1) inside MV45AFZZ and using Error procedure, Z1 get all the records defined inside the ‘Fields’ as shown in Screen Shot – 3 using Table TVUVF.


DATA: ls_tvuvf TYPE tvuvf.

* Set initial Values
vbak
-zzbuygrp    = ‘X’.

* For Create and Change

IF t180-trtyp = ‘H’ OR t180-trtyp = ‘V’
OR t180-trtyp = ‘A’.

* Only for Sales Document
IF vbak-vbtyp = ‘C’.

    IF (certain field) is not blank.

      CLEAR vbak-zzbuygrp.

      READ TABLE xvbuv TRANSPORTING NO FIELDS WITH KEY vbeln = vbak-vbeln

                                                                                                  tbnam = 'VBAK'      

                                                                                                            fdnam = 'ZZBUYGRP'.

      IF sy-subrc <> 0.

        SELECT SINGLE *

             FROM tvuvf

             INTO ls_tvuvf

             WHERE fehgr = tvak-fehgr

             AND   tbnam = 'VBAK'

             AND   fdnam = 'ZZBUYGRP'.

        IF sy-subrc = 0.

          xvbuv-mandt = sy-mandt.
          xvbuv
-vbeln = vbak-vbeln.
          xvbuv
-tbnam = ls_tvuvf-tbnam.
         xvbuv
-fdnam = ls_tvuvf-fdnam.
         xvbuv
-fehgr = tvak-fehgr.
         xvbuv
-statg = ls_tvuvf-statg.
         xvbuv
-msgkz = ls_tvuvf-msgkz.
         xvbuv
-sortf = ls_tvuvf-sortf.

         APPEND xvbuv.

      ENDIF.

    ENDIF.

ELSE.

      vbak-zzbuygrp = ‘X’.

* Clear from incompletion log if exits.
     
READ TABLE xvbuv ASSIGNING <ls_xvbuv> WITH KEY vbeln = vbak-vbeln

                                                                                                     tbnam = 'VBAK'

                                                                                                     fdnam = 'ZZBUYGRP'.

      IF sy-subrc = 0.

* Delete the Entry from standard Incompletion table

        DELETE xvbuv INDEX sy-tabix.

      ENDIF.

   ENDIF.

ENDIF.

ENDIF.


Tcode's related to In-completion Log

Tcode

Description

OVA2

To define incompletion procedure

VUA4

To assign incompletion procedure to delivery type

VUPA

To assign incompletion procedure to Partner functions

VUC2

To assign incompletion procedure to Sales Activities

OVA0

To define Status groups

VUA2

To assign incompletion procedure to Sales Document Header

  V.02

Execute to get a checklist of incomplete sales orders

VUA2

To set a warning or error message on document save

VUP2

To assign incompletion procedure to Sales item category

VUE2

To assign incompletion procedure to Schedule line category


Key tables to check Incompletion Logs

Tables

Description

VBUV

Incompletion log - Sales documents

VBUK

Header incompletion

VBUP

Item incompletion

TVUVG

Groups

V50UC

Incompletion log − Deliveries

V50UC_USER

Incompletion log − Deliveries − Enhancements

TVUV

Procedures

TVUVF

Fields

TVUVS

Status groups

TVUVFC

Fcodes

FMII1

Funds Management Account Assignment Data

Waiting for lock objects to release - using lock modes U and V

$
0
0

Over the last couple of weeks, I had the same question posed to me a couple of times, so I thought I would share this in a blog post. There are several times in programming that you are calling a set of function modules in succession that need the same lock object. This may be different ones in succession, such as doing an operation on a sales order, followed by a delivery or the same object several time, such as updating characteristics as discussed in this example BAPI_OBJCL_CHANGE Lock errors . In these circumstances, often by the time the second function is called, the lock object is not yet released by the first one, so you get an error.

 

There are several ways to address this issue that I will touch on, and why I like this solution the best.

1) Introduce a wait statement

This is not a very stable way to achieve this. There are many variables that can affect how long the locks take to be released. Not in the least, there will a difference between your development box and production system. Server and Database loads affect the time and so does the number of iterations the same objects are processed.

 

There is also additional time penalty here because you are always starting off with the forced wait time.

 

2) Use function module ENQUEUE_READ

In this case, you would use the function ENQUEUE_READ to see which locks are still active. While this is a much better way, because you are waiting for the specific action of a lock not being present. If the locks are still active, then implement a wait time and retry. While this is popular method and works well, I am not a fan for the following reasons.

  • You are still implementing the wait and retry loop yourself
  • You have to filter through the return to determine if the exact object you are looking for is still locked or not.
  • For the above, you have to know the format of the lock object key
  • The wait times that you implement are exactly on the second when using WAIT UP TO x SECONDS. This in rare circumstances when two users are trying to get to the same table, but also have other locks open, can cause deadlocks (See https://en.wikipedia.org/wiki/Deadlock and https://db.apache.org/derby/docs/10.0/manuals/develop/develop75.html  for an explanation of deadlocks).

 

3) Use the DEQUEUE_XXXX function module

Simple... don't do it. The locks are on for a reason. These function modules are for when you are in full control of the data and logic, not when you are calling an SAP function and not in full control of everything that is happening in the system.

 

4) Use the ENQUEUE_XXXX function module with modes U or V

When you use the appropriate function module and use the mode U, V (or W), it will check for lock collisions. This is detailed in SAP help here Example: Using Lock Modes U, V, and W - SAP Lock Concept - SAP Library. What is not mentioned here is the _WAIT parameter. Setting this parameter on (abap_true or 'X') will make the function call wait for a predetermined time for the lock to release. The beauty is this not only works with the standard modes where you are setting a lock, but it also works with the collision checks.

 

The code is really simple... in this example, I am checking and waiting for a lock on the sales order to release.

 

CALL FUNCTION 'ENQUEUE_EVVBAKE'

  EXPORTING

    mode_vbak      = 'V'              " Lock mode for table VBAK

    vbeln          = l_sales_order    " 02th enqueue argument

    _wait          = abap_true

  EXCEPTIONS

    foreign_lock   = 1

    system_failure = 2

    others         = 3.

 

The benefits of this approach are...

  • No need to manually implement a wait logic.
  • You are already checking against the exact object of concern (here the sales order in the variable l_sales_order that I used in other parts of my program), so no need to filter through lock entries.
  • You are passing individual key fields and don't have to construct a properly formatted key in your own program.
  • The final benefit of preventing deadlocks, I will explain in a little more detail below.

 

Notes:

The maximum wait time is set to a default of 5 seconds with a retry of every one second by default. These settings are all controlled by system parameters that you can change if you need different behavior on your system. You can use transaction RZ11 to view and change these parameters and their documentation. I will give a quick overview of some of them here, but for more information, they are all pretty well documented right in RZ11.

 

enque/delay_max - This controls the maximum time to wait. Default is 5 seconds.

enque/delay_max_refine - How many times per second to retry. Default is 1, so with the default delay_max, it will retry 5 times, once a second for 5 seconds.

enque/delay_jitter - This is the magic that helps prevent deadlocks and two users repeating a request at the same time over and over. Default is 400ms. What this will do is vary the retry time by up to plus or minus 400ms on each try. So, even though the delay_max_refine says retry once a second, this setting will vary by a random duration up to ±400 ms each time.  There is a more detailed example in the RZ11 documentation of this offset.

enque/deque_wait_answer - Default is off which makes the checks asynchronous. By turning this setting on, the check changes to a synchronous check for the dequeue to complete.

Selection Screen Variants

$
0
0

What are variants?

 

In SAP ABAP reports have a mechanism for entering values for database selection or for performing different calculations through SELECTION SCREENS.

 

Selection screen provides a user an option to execute the reports or transactions as per his requirements and thus provide a range of values as an input.

 

Whenever there is a requirement to execute a report with the same set of input values again and again, for large selection screens entering the same values can be a tiresome and boring task. Thus SAP has provided a functionality to save these values in a set called as VARIANTS.

 

Variants can prove to be useful in various ways:

  1. As mentioned above, when there is a requirement to execute a report with a same set of values every time.
  2. When a report needs to be executed in background mode, variants are the only way to pass values to the report.
  3. Variants can ensure the integrity of the data being passed as an input and thus minimize the risk of incorrect data entry.

 

TYPES OF VARIANTS:


Variants values can be Static or Dynamic.

 

STATIC: Static values are fixed values and do not change over the course of time.

 

Example: Let us suppose there is an organization with 10,000 employees and the HR executes a  monthly report having the personnel number as input ,each month. Then in this case we can use the static value giving the range as 1 to 10,000 for this.

 

DYNAMIC: Dynamic values in a variant can change over time.

 

Example: The HR wants to execute the report daily and gives the current date as the input. The requirement is that next day when the report is executed the date should be changed to current date.

In such case we can use dynamic values. If the dynamic value is a date , we can use the different date calculation options provided by SAP.

In other cases we can use the values stored in table TVARVC.

 

PROTECTION OF VARIANTS:

Variants can be saved as protected variants so that only the creator has the authority to change the variant at a later point of time. This can be done by selecting the checkbox for variant protection at the time time of saving variant attributes.



Variants are client dependent.


 

VARIANT VALUES: The variant values are stored in a cluster table named VARI.

 

VARIANT DIRECTORY: The table VARID is a directory of  variants present in system.


This table stores values such as : Variant Name , Report name for which variant is created , Information about when and by whom the variant was created ,version of variant , protected , transport and environment information.


  1. Protected: This tells whether the variant is protected or not.If a variant is a protected variant then it can be modified only by the user who has created it.
  2. Transport: This gives the information whether a variant can be transported to other systems or not.
  3. Environment: Gives information about the variants usage in foreground or only in background processing.

 

 

How to change protected variants? : To change protected variants we need to remove the protected flag from VARID table for a given variant. SAP has provided a standard program for this purpose.

Program : RSVARENT can be used to unprotect the variants. It takes report and variant name as input.

 

How to use table TVARVC for dynamic variants ?: The table TVARVC can be used for creating variants where input data needs to be changed frequently.

 

We have to first maintain high and low values for a field in the table TVARVC .Transaction STVARVC can be used to maintain  these values in client 000. In other clients the table can be directly maintained in SM30.

 

This values can be then used in variants while saving the variant attributes.

 

To create dynamic value for any field, Click on Selection variable and then press F4.

 

The F4 for the selection variable shows the following options.

T – Table Variable for TVARVC

D –  Dynamic data calculation.

 

When T is selected values will be  fetched from TVARVC table . Press 'F4' on 'Name of Variable' for the field and select the desired entry.

When D is selected  it corresponds to dynamic date calculations and hence is suitable for date fields.



SAP Function Modules which can be used in reports / programs to achieve certain requirements.

 

 

Function ModuleDescription
RS_CREATE_VARIANTTo create variants for reports
RS_VARIANT_EXISTSTo check whether a variant exists for a report
RS_VARIANT_CATALOGReturns the variant list for a report in an internal table
RS_VARIANT_FETCHTo get the variant attributes of an existing variant
RS_VARIANT_COPYTo copy an existing variant
RS_CHANGE_CREATED
_VARIANT
To change the contents of an existing variant
RS_VARIANT_CONTENTSTo get the variant contents
RS_VARIANT_ATTR_SAVETo save the variant attributes. Helpful for dynamic variants
RS_VARIANT_VALUE_SAVE  To save the variant values.

 

 

Suggestions and Comments Welcomed

 

~Tanmay


Viewing all 948 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>