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.

15

ABAP Programming for SAP HANA

The second step in the process is to re plicate the import an d export structures

from the stored procedure in the ABAP dictionary. To do this, you need to go into

ABAP in Eclipse and create a database procedure proxy. Open Eclipse, and select

the package in which the proxy is to be created. Right-click this package, and follow

the menu path New 폷 Other ABAP Repository Object 폷 Dictionary 폷 Database

Procedure Proxy.

You will be asked for a name (e.g., ZMONSTER_PROXY) and what SAP HANA stored

procedure you want to link the new ABAP proxy object to. A name is then proposed

for an ABAP interface (e.g., ZIF_MONSTER_PROXY), which will be created to

store the TYPE definitions for the input and output parameters.

When you click Finish, the interface is created in your ABAP system along with a

database procedure proxy that can be called from an ABAP program. An example

of a generated interface is shown in Listing 15.16.

INTERFACE zif_monster_proxy PUBLIC.

TYPES: in TYPE zs_monster_inputs,

out TYPE zs_monster_outputs.

ENDINTERFACE.

Listing 15.16 Generated Interface

Once the interface and proxy have been generated, you can call the newly created

ZMONSTER_PROXY, which will in turn call the SAP HANA stored procedure from an

ABAP program (Listing 15.17).

DATA: in TYPE zif_monster_proxy=>in,

out TYPE zif_monster_proxy=>out.

CALL DATABASE PROCEDURE zmonster_proxy EXPORTING in = in

IMPORTING out = out.

Listing 15.17 Calling a Database Procedure Proxy

That’s simple enough, but you’re wo rking in two development environments,

and the whole concept is not really very object oriented. You can see why this

was only intended as a stopgap measure until the real solution (top-down development)

was ready.

15.3.3 Transporting Changes

With the bottom-up approach, there’s no automatic link of changes made in the

SAP HANA environment and the ABAP environment. This is problematic,

680

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

Saved successfully!

Ooh no, something went wrong!