!--a11y-->
Supply Function 
A supply function is a script associated with a business anchor hierarchy that is written to relate business anchors when no business relation exists between the data sources associated with these anchors. The supply function creates a dependency between the two data sources, using the properties of the parent data source to query the database and to supply the child data source with the appropriate data.

You want to relate the customer and opportunity anchors by creating a business anchor hierarchy between them.
Customer business anchor (data source is
the customer business
object)
Opportunity business anchor (data source is the opportunity business object)
When no business relation between the customer and opportunity business objects exists, you need to write a supply function for the opportunity business anchor.
You write a supply function to link the two data sources and retrieve the required data at runtime. A supply function establishes a relationship between two data sources in the business anchor hierarchy when no relationship exists between them in the database.
There are two types of supply functions:
· The local supply function can be used only within the interaction component containing the business anchor hierarchy. The supply function code is generated exclusively for this interaction component and is included in the interaction component’s class file. It cannot access the variables of any other interaction component.

The supply function written for a tile is local to a tile and when you generate the code, it is included in the tile class file.
· The global supply function can be used by all tile sets and tiles belonging to the user interface hierarchy defined by this business component. The code generated for a global supply function code is included in the code for the parent business component.

Using a global supply function, you can access variables of other interaction components. This is not recommended because an interaction component can be accessed by other applications.
See also: