14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

14

Shared Memory

checks on requests, perform calculations (return calculated values), and store

really complicated data structures. In other words, the root class is a normal class,

and thus you create it via SE24 as you would any other class. The important part,

as shown in Figure 14.1, is to select the Shared Memory–Enabled checkbox.

Figure 14.1 Shared Memory–Enabled Check Box

In this example, you will buffer the entire monster table from the running monster

example. That may not be the most realistic example the world has ever seen,

but it will demonstrate the basic principl es. The idea is that you will store the

entire monster table in shared memory an d then have an access method to get

one record at a time. Initially, this will seem pointless, because you can slay this

vampire of a problem by setting the table to be buffered. However, later you will

move on to using the same technique fo r more complicated data structures that

you cannot buffer, so you need to start with the basics.

First, you need to add an attribute to store a copy of the database table. Up until

SAP ERP 6.0, you would have had to createa DDIC table type with a line type that

matched the table definition, such as table type VBAP_T. However, that sort of

thing just bloats the data dictionary; nowadays, you can define your own type by

clicking on the Types tab, as shown in Figure 14.2.

After you click the Direct Type Entry button, you are taken to the source code–

based view of SE24 (one of the best improvements to SE24 ever), where you can

directly type the table just as you would inside an ABAP program. The code for

this is shown in Listing 14.1.

636

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!