Start of Content Area

Background documentation Calling a Business Add-In from the Application Program

As previously discussed, the application developer creates an instance of the generated class in the application program and calls the corresponding method at the appropriate time. The filter value is passed to the method as an export parameter.

Report businessaddin.
class cl_exithandler definition load.
data flt type de_land.
data exit type ref to if­_ex_businessaddin.
data wort(15) type c value 'Business Add-in'.

start-of-selection.
  perform formatlist.
  call method cl_exithandler=>get_instance
        changing instance = exit.
  write:/'Please click here'.

at line-selection.
  new-page.
  write:/ 'Original word: ',word.

   call method exit->method
         exporting
            flt_val = flt.
         Changing
            parameter = word.

  write:/ 'Original word: ',word.

The subroutine formatlist looks like this:

form formatlist.
write:/'USA            -> Conversion to upper case'.
flt = 'USA'.
hide flt.
write :/'Ireland        -> Conversion to lower case'.
flt = 'Ireland'
hide flt.
write :/'Italy       -> Conversion to...'
flt = 'Italy'.
hide flt.
endform.

 

If a filter-dependent BAdI is called using one filter value only, it is possible to establish whether or not there is an active implementation for this filter value using the function module SXC_EXIT_CHECK_ACTIVE. If this is not the case, it is no longer necessary to create an instance or to call methods.

 

End of Content Area