directory

SAPGUI Where Used List Jade knife – ABAP debugger Watch point Overmaster gun – ABAP debugger dynamic breakpoint Amour ring – ABAP code static scan – SAT parting hook – ST05 fist – Magic method??

Jerry wrote a total of 639 English-language blogs on SAP’s official community before he started writing in Chinese on the official wechat platform in 2018.

Here’s a 2013 blog post on ABAP debugging tips:

Six kinds of debugging tips to find the source code where the message is raised

Since 2016, there have been more than 150,000 views on the SAP community.

The actual number of reads is much higher than that, because after the community revision in 2016, the number of reads to the article was zero.

Before the 2016 redesign, THE SAP community had a mechanism called Gamification, where a blog writer would get 2 points for every “like” they received. The blog earned Jerry a lot of community points at the time.

Using a practical example, this blog introduces Jerry to six error message debugging methods accumulated over his years of ABAP programming. As a matter of fact, Jerry has relied on these six methods in his actual work, and I have found them to be quite effective for all manner of error messages that I have encountered, and very few cases where I have not been able to debug the exact code where the message was thrown.

Specific scenario: Enter a nonexistent program name randomly in SE38 and click the Display button to Display a prompt message. Our task is to find the exact location of the ABAP code that threw the message, either through debugging or using other tools provided by Netweaver.

One of Gu Long’s masterpieces, “Seven Weapons”, introduces seven fearsome and exquisite weapons, and CCTV’s “World Football” series has also used these seven weapons to compare football to those unique gods. As a fan of Ancient Dragon, Jerry also named the seven methods after the ancient Master’s seven weapons, in his honor.


Method 1: Immortal Sword – Use the Where Used List feature that comes with SAPGUI

In ancient China, the sword was called “prince of hundred soldiers” and was often regarded as a noble decoration. From emperors to literati, they liked to wear swords to show their status. In jin Yong’s and Gu Long’s classic works, swords are the weapons used by most of the characters in rivers and lakes.

Here is the Longquan sword Jerry used to suppress bugs:

Just as sword is the weapon most Used by people in rivers and lakes, I think every ABAP employee should have Used the Where Used List function in SAPGUI.

Click the Message displayed in SE38 to view the technical details of the Message: DS017, where DS stands for the Message Class ID and 017 is the Message Class number.

Transaction code SE91, open DS Message Class, locate the 17th message, click the icon to use the Where Used List function.

Turns out there are too many places in SAP’s standard program to throw this message…

In this case, I’ll just have to look at them one by one. Notice that the message we saw in SE38 shows a green light in front of it, so when the ABAP code throws this message, it delivers it with type S(Successful). So we only look at records like MESSAGE S017 in the result list. We ignore MESSAGE E017 because MESSAGE E017 throws messages with red light.

I quickly found this entry, but I’m not 100% sure yet. Double-click to go in, set a breakpoint, then go back to SE38 and hit the Display button again.

At this point, the breakpoint fires, indicating that line 813 of ABAP include LWBABAPF00 is exactly where I’m looking to throw the prompt message.

Method 2: Jasper Knife – Use the ABAP debugger’s Watch Point feature

Dao is also a weapon with a long history. As early as in primitive society, ancient people made knives of various shapes with stones, mussel shells and animal bones. Ancient people not only used knives as labor tools, but also carried them with them as self-defense weapons.

The Watch Point introduced in Method 2 is a tool with a long history as the knife. How old is it? It came out with SAPGUI before some of Jerry’s colleagues were born.

In Jin Yong’s gulong novels, there are many famous masters who use knives. The golden Lion King, Xie Xun, steals a copy of Seven Wounded Fists: From Beginner to Master from kongtong. In addition to seven wounded fists, the weapon he uses is a dragon sword. In Gu Long’s novels, there are more masters of dao, bai Tianyu, Fu Hongxue, and Ding Peng, who holds a scimitar of the full moon and can release the ultimate skill of “listening to spring rain in a small building for one night” :

When a MESSAGE is thrown using the ABAP keyword MESSAGE, the system variable sy-msgid is automatically populated with the MESSAGE Class to which the MESSAGE belongs, which in Jerry’s case is DS, and sy-msgno is populated with the number of the thrown MESSAGE, which in this case is 017. Therefore, create a Watch point in the debugger and maintain trigger conditions accordingly. When the program is running, once triggering conditions are met, watch point is triggered, and the ABAP statement executed at this time is the exact position where the message pops up.

Type /h in the command input field to open the debug mode, and click the Display button to pop up the debugger:

Create a Watch Point here in the debugger:

The condition is maintained as follows, then press F8 to continue the program, after which the debugger will automatically stop at the ABAP code that threw the message.

Every time Jerry used the observation point in the ABAP debugger to locate the source of the information I was looking for, he felt the thrill of Ding Peng splitting his opponent in half with a full moon scimitar.

Method 3: Overlord gun – use the ABAP command dynamic breakpoint in the ABAP debugger

Spear, king of soldiers, long and sharp, easy to use, the blade can Pierce, cut, Pierce armor. The gun is difficult to learn and master among the 18 martial arts. As the saying goes, “Nian cudgel, yue Dao, long practice gun”.

“One inch long, one inch strong”. Because guns are more powerful than sticks and other blunt instruments, many famous generals in ancient China used guns, such as Zhao Yun, Ma Chao and Jiang Wei in The Romance of The Three Kingdoms.

Guns in the hands of these high military value to display, the soldiers invincible; Once the ABAP dynamic breakpoint is out, the error message is not hidden.

Create a dynamic breakpoint in the debugger with type ABAP Commands set to MESSAGE. This way, the ABAP debugger automatically stops where the MESSAGE keyword occurs.

Many other types of Breakpoints can also be created from the Breakpoints->Breakpoint at menu, which is quite useful.

The message location approach introduced in approach 4 is no longer limited to using the ABAP debugger, but uses various useful tools available in SAP Netweaver.

Method 4: Amorous loop – ABAP source code static scan

This double ring no matter what caught, immediately tightly wrapped never out of hand, just like a passionate woman, so called amorous ring.

After Jerry learned the ABAP code static scanning skill, he became obsessed with the code scanning tool and couldn’t get rid of it.

Enter SE38 in transaction code SE93 to find the name of the ABAP program implemented by SE38 and the name of the development package.

The theoretical basis of method 4 is that since we see DS017 in SE38, MESSAGE S017 must appear in the implementation code of SE38. So in approach 4, we changed our thinking from dynamic debugging to the opposite.

Use the source code scanning tool RS_ABAP_SOURCE_SCAN to find all ABAP code locations in SE38 where MESSAGE S017 appears:

In less than a second, the exact location was found:

CODE_SCANNER, another transaction code, provides a similar ABAP code scanning capability with a slightly different interface than RS_ABAP_SOURCE_SCAN.

Method 5: Peacock feather – using ABAP to apply the performance analysis tool SAT

Peacock Feather is Jerry’s favorite game in the Seven Weapons series, and using SAT to locate ABAP messages is Jerry’s favorite method.

Peacock feathers is made of pure gold, shiny cylinder, which has two hubs, press the hub, the concealed weapon in the cylinder is shot out, and it is said that these concealed weapon, beautiful like a peacock, brilliant, however, just when you was deeply moved by this amazing creatures eyes stare when god fan, it has been to your life.

Li Xunhuan’s little Li flying sword, known as “the example is not empty hair”, but there are still miss, in the fight against the great Joy of the female bodhisattva, failed to do a single hit must kill. The peacock feather is different. According to Gu Long, it is a weapon with a 100% hit rate, and no one can escape from the peacock feather.

Unfortunately, the owner lost it in the end.

Jerry, looking back on his career as a message analyst, can’t seem to recall a single instance in which I used the SAT and failed to find the source of a message, which shows that the SAT, like peacock feather, is extremely powerful in finding where an ABAP message was dropped.

Enter the transaction code SAT and create a new trace for Variant, Aggregation. Remember to set it to None, otherwise you won’t get the full tree structure you expect when you view the results later.

Enter SE38 in the Transaction field and click the Execute button to start SE38 in trace mode.

Then, as before, click the Display button, and after seeing the prompt message, return to the SAT interface. In this way, the ABAP code executed by SE38 from startup to pop-up message to exit is recorded by SAT. You will see a progress bar that indicates the SAT’s progress in formatting the recorded content:

After 100% completion, go to the SAT results display page and click on the Call Hierarchy TAB. All ABAP statements executed by SE38 are listed below. Use the search button that comes with SAT, type MESSAGE S017, and run to get the result. Double-click to access the corresponding ABAP code.

Although the SAT is primarily used for application performance analysis and optimization, in the scenario Jerry described, it also serves as a message location aid.

As an aside, the SAT Processing Blocks interface displays the hierarchical invocation of ABAP code in a tree structure, which is also very helpful for analyzing and learning the execution logic of complex applications.

Method 6: Parting hook – Use the ABAP database to execute the tracking and performance analysis tool ST05

Look at the introduction of parting hook in ancient text.


“A parting hook is a weapon, a hook.”

“If it is a hook, why is it called parting?”

“Because the hook, whatever it catches, is parting. If he hooks your hand, your hand must be separated from your wrist; If it catches your foot, your foot must be separated from your leg.”

“If it hooks me by the throat, DO I part with the world?”

“Yes.”

“Why did you use such a cruel weapon?”

“Because I don’t want to be forced to part from those I love.”

“I see what you mean.”

“Do you really understand?

“You use parting hooks only to get together.”

“Yes.”


J: I’d like to remind you that the ST05 is as effective as the exit hook in helping you locate messages. But if you turn on the performance analysis switch on the ST05 in the customer production system and forget to turn it off, you may have to leave your job.

ABAP practitioners who suspect that an application’s performance bottleneck is at the database level often turn the database trace switch on in transaction code ST05 and re-run the application in trace mode to obtain the trace results to analyze the performance of the database. In this example, Jerry uses ST05 to track the execution of the transaction code SE38, and can get the names of all database tables accessed during the process, and the performance of accessing them.

Why does Jerry need to know which database tables SE38 accesses? According to our experience, when we enter the name of the program in SE38 and click the Display button, the implementation of SE38 must search for the name from a database table (that is, the database table in Netweaver that stores all ABAP program names). If the search fails, it means that the program does not exist. Throw a message to the user.

In other words, SE38 uses OPEN SQL to query a database table based on user input, and throws a prompt message. The two code locations must be adjacent. As long as we find the location of the database table that queries the report name in SE38, we are not far away from the location of the code that throws the prompt message.

Jerry was completely unconcerned about the performance of SE38 to access database tables and ignored it. In the result list of ST05, I only look at the database table Name displayed in Object Name, PROGDIR is too prominent in it. SELECT ‘NAME ‘= ‘ASDASDD’ AND’ STATE ‘= ‘A’ from ABAP OPEN SQL WHERE ‘NAME’ = ‘ASDASDD’ AND ‘STATE’ = ‘A’

I entered the program name ASDASDD in ST05 tracing mode, so SE38 tried to find A program named ASDASDD in the PROGDIR table that was in the a-activated state.

Click the Display button above to see the code for accessing the database table PRODDIR, on line 774:

Scroll down a bit, and line 813 is where we want to find the code that threw the prompt. They’re really close enough, aren’t they?

Method 7: Fist – use a search engine to search by the keyword DS 017, or directly ask an expert you know for help

The other six weapons are made of metal, but the fist is made of flesh and blood. Perhaps because of this reason, boxing is not seen much in Jin Yong’s novels. Seven wounds boxing is one of the more famous boxing skills.

The five elements of Yin and Yang air, heart injury lung attack liver bowel. Hide from the essence frustrated trance, three jiao qi inverse soul flying!

There are Yin and Yang and qi in the human body, the lung belongs to gold, the liver belongs to wood, the kidney belongs to water, the heart belongs to fire, and the spleen belongs to earth and five elements. The so-called “seven injuries” refer to these seven injuries.

Those who have mastered the seven wounds of boxing can send out different forces at the same time, either fierce or feminine, to destroy the enemy’s viscera. The power of boxing is complex, and the power is amazing. However, this magic boxing technique can hurt both the enemy and yourself. Every time you practice it, your internal organs will be damaged once. This is “seven injuries in one practice will hurt all seven. First hurt yourself, then hurt the enemy “origin.

Similarly, when confronted with information that we find difficult to locate, we can directly use the search engines, or turn to the experts we know for help.

Jerry tried to search for DS 017 on Baidu and found an article about it:

I am really grateful to my friend “March Traveler” from Jianshu community who took the trouble to translate my English blog into Chinese:

This is his Jane books address: www.jianshu.com/p/4aae58102…

The warrior who uses seven injury-boxing, no matter can send out seven different internal forces, such as fierce, feminine, soft, soft, horizontal, straight, or inward, to achieve a quick victory, but he will also be affected by seven injury-boxing.

Similarly, the use of search engines or experts, although can quickly solve the immediate problem, but may lose the opportunity to use this problem to improve their ability, so we must carefully consider before using this method.

conclusion

“History of Song · Biography of Yue Fei” : “Battle after battle, the art of war; The best thing to do is to concentrate on it.” ABAP Netweaver provides us with a large number of tools, I wish you can use these tools flexibly, fully exploit their potential to solve practical problems. Thank you for reading.

Read more

  • Jerry’s ABAP, Java and JavaScript stew

  • What should ABAP developers learn in the future

  • Jerry’s 2017 May Day Holiday: ABAP implementations of eight classical sorting algorithms

  • Jerry’s collection of original ABAP technical articles

  • Three hundred lines of ABAP code implement a simplest blockchain prototype

  • Call functions in ABAP on-premise system using Java+SAP Cloud Platform +SAP Cloud Connector

  • Consume ABAP on-premise OData services in the CloudFoundry environment of SAP cloud platform

  • ABAP vs Java, breaststroke vs freestyle

  • Talk about C and ABAP

  • Use ABAP Channel to develop some small tools to improve daily work efficiency

  • All the boring things I’ve done with ABAP

  • Don’t like SAP GUI? Try using Eclipse for ABAP development

  • Write and activate ABAP Code using Visual Studio Code

  • Has your ABAP program been opened to Buddha? Let’s try Jerry’s trick

  • Write the first ABAP program in SAP cloud platform ABAP programming environment

  • ABAP programming specification issued by SAP

  • Do you know the hidden features of ABAP Code Inspector?

  • Are you using ABAP for secondary development of SAP products? Learn about this new concept of secondary development

  • The parasitic programming language inside ABAP Netweaver

  • Start with a blog post on the SAP community to talk about the sentiment behind SAP product naming

  • Cloud ABAP Restful service development

  • How to expose CDS View as OData service in SAP cloud platform ABAP programming environment

  • Use abapGit to transfer code between the ABAP ON-premises system and the SAP cloud platform ABAP environment

  • 30 minutes To develop a Fiori application with Restful ABAP Programming model to support add, delete, change, and query

  • Jerry walks you through the implementation of Action and Validation, part 2 of the Restful ABAP Programming Model series

  • Jerry takes you through Restful ABAP Programming Models series 3: Cloud ABAP Application debugging

  • How to consume third-party services in ABAP programming environment on SAP cloud platform

  • It’s time for ABAP developers to go to the cloud – now you can use a free trial version of the ABAP environment for SAP cloud Platform

  • The origin and application scenario of ABAP programming environment on SAP cloud platform

  • Trident application in SAP cloud platform

  • How to develop and deploy a Fiori application that supports add, delete, modify and query based on Restful ABAP Programming model

  • SAP 2019 TechEd Key Note: How do SAP practitioners do secondary development in the cloud era?

  • What ABAP keywords and syntax won’t work in the ABAP cloud environment?

  • The ABAP development environment finally supports automatic formatting of ABAP variable names with camel name

  • Complete a real work task using ABAP 740’s new REDUCE keyword

  • A shiver of ABAP code

  • Yesterday’s Halloween ABAP monster code mystery, revealed the answer

  • This paper introduces an efficient copy method of inner table in ABAP kernel state

  • A practical example of developing OData using the SAP Cloud Application Programming model

  • When ABAP met Prometheus

  • Draw scalable vector diagrams using ABAP

  • ABAP development environment syntax highlighting things

For more of Jerry’s original articles, please follow the public account “Wang Zixi “: