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.

9

BRFplus

have a Check button at the top, with the scales icon you know and love from all

over the SAP system—that is, the same iconyou see in SE38 for performing a syntax

check. If something is wrong, you’ll see a warning or error message at the top

of the screen.

In the same way, at the top of the screen for defining objects in BRFplus, there is

always an Activate icon, which looks like a matc hstick (again, the same as in

SE38 and with the same purpose). Just like in SE38, the Activate icon does a

check first; if there are any problems, you get error messages instead of the object

being activated.

9.2.3 BRFplus Rules in ABAP

The last step in the process of creating rules in BRFplus is to call the BRFplus function

in ABAP. As it turns out, there is not a great deal involved in calling the BRFplus

function; as a programmer, your main responsibility is making sure that you

pass suitable variables to and from the function signature. The code for this is

shown in Listing 9.2.

CONSTANTS: gc_ingredients_dermination TYPE fdt_uuid

VALUE '005056B92F471ED3BEEDEC044A8177D1'.

DATA: ld_sanity TYPE zde_monster_sanity VALUE 80,

ld_usage TYPE zde_monster_usage VALUE ‘BALLROOM_DANCER’,

ld_evilness TYPE zde_monster_evilness,

ld_scariness TYPE zde_monster_scariness,

ld_rages_pers_day TYPE zde_monster_rages_per_day,

ld_ingredients TYPE zde_monster_ingredients,

"BRFplus Definitions

lo_function TYPE REF TO if_fdt_function,

lo_context TYPE REF TO if_fdt_context,

lo_result TYPE REF TO if_fdt_result,

lx_fdt TYPE REF TO cx_fdt.

FIELD-SYMBOLS: <ls_message> TYPE if_fdt_types=>s_message.

TRY.

"Say which function we want

lo_function = cl_fdt_factory=>if_fdt_factory~get_instance( )->

get_function( iv_id = gc_ingredients_dermination ).

"Get structure of function signature

lo_context = lo_function->get_process_context( ).

"Fill up input parameters

lo_context->set_value( :

iv_name = 'SANITY' ia_value = ld_sanity ),

386

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

Saved successfully!

Ooh no, something went wrong!