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.

Creating and Using Shared Memory Objects 14.2

The broker class has a number of public static methods, which can be seen in Figure

14.7. The best way to un derstand these is to see an example of how to use

them in ABAP programs; conveniently, this is the subject of Section 14.2.3.

Figure 14.7 Broker Class: Methods

14.2.3 Using Shared Memory Objects in ABAP Programs

Now that you have your root class and broker class set up, you can start using

them in your lovely ABAP programs. As might be imagined, there are two things

you want to do with persistent data (r emember: persistent data isn’t data that

keeps on and on at you and never gives up; it’s data that is permanently stored in

the database). You want to read such data and to create or change such data (a

write request).

The following subsections look at the two types of database requests you make—

read and write—one at a time, with examples of how to code such requests.

Coding a Read Request

In Listing 14.4, you see the code for getting the data out of shared memory; it’s

very simple—just a few lines. First, you need to create an instance of your broker

643

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

Saved successfully!

Ooh no, something went wrong!