Eliminate database read/write times with ABAP shared memory

Eliminate database read/write times with ABAP shared memory

The average SAP developer has never even heard of ABAP shared memory much less worked with it or even utilized it to their advantage. This was the subject of Alex's first tip. He boasted that using this development

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

will buffer data to help alleviate database read/write times on any custom program that it is associated with. He mentioned that there is virtually no learning curve when dealing with shared memory as the buffered data is easily viewable and debugged.

View the shared memory data easily in Tcode SHMM. Double click on an item to view the details.
On the left side of the image we can see the product structure "ET_PRODUCTS", click on "17 Entries" to dive deeper into the details. Here we can see the 169 products that are associated with this particular product structure, and it is here that we manage the shared memory.
First, to create the shared memory area we go to Tcode SHMA. A root class name must be provided as well as other parameters that can be left to the default settings until it becomes clear how these changes would affect the program.
The difference between a regular class and a generated shared memory root class can be found in the properties tab where we find the check box that will make the class "shared memory enabled".
The data that is put into the shared memory area could be standard SAP types or custom types that allow structured data to be available.
To build the shared memory area use the "BUILD" method name and throw the root name as well as the area handle in there and cap it with the select statements.
Now we move on to the append statements, acquiring the necessary information from the shared memory area.
Now that we have all this data an application is needed for our efforts to be applied to. Here we reference the same data, plugging in the necessary information, and looping it.

This was first published in October 2007

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.