14.01.2020 Views

ABAP_to_the_Future

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Creating Enhancements 6.2

After you have added a new parameter, you will see it has the Optional checkbox

selected, in order to avoid breaking any existing programs that may call that module.

You can also see that there is a new column called Enhancement Implementation

to indicate that the new importing parameter is not SAP standard but was

rather added by an enhancement. You can do exactly the same to add a new

export parameter (you don’t have to create a new enhancement implementation

this time; you get asked if you want to use the existing one). As a rule of thumb,

all related changes should be in th e same enhancement implementation: An

enhancement implementation should be able to be switched off without affecting

anything, so if you had a new parameter in one implementation and code referring

to that parameter in another, then you could not switch them off independently.

This is all lovely, but now you want to do something with these parameters, so

you need to change something inside the code of the function module. Go to the

Source Code tab of the function module (still in display mode), and navigate to

Edit 폷 Enhancement Operations 폷 Show Implicit Enhancement Options. You’ll

see a line of quotation marks on the first line of the function module. Select that

line and navigate to Edit 폷 Enhancement Options 폷 Create Implementation.

You’ll see the screen shown in Figure 6.5.

Figure 6.5 Inserting a Source Code Plug-In

Click the Code button, and you will see an ENHANCEMENT/ENDENHANCEMENT block in

which you can add your own code. Not on ly do you have access to your new

import parameter and the real import parameters of the function module, but you

also have access to the global data of the function group and can change it. Be

careful!

231

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

Saved successfully!

Ooh no, something went wrong!