More Than One Address Controller in the Same Application

Use

It is possible without problems to have more than one address controller in the same application. For example, the Business Partner Master Data could have one address controller in the detail controller for the address overview and another one to maintain the address-independent communication data.

Procedure

Having more than one address controller is possible without problems. There are only three things the application developer has to be careful about:

...

       1.      If the different address controllers are on the same level (that is, both are ODC1), then the parent object key will not suffice to distinguish between the two; so the application may run into problems when trying to determine the address key in method GET_ADDRESS_KEY. To solve this, the screen structure used in the layout by the second controller must not be CRMT_BSP_ADDRESS but CRMT_BSP_ADDRESS_2. Similarly, the field group used in the layout must be ADR_DETAIL_2 and the toolbar group used must be ADR_DETAIL_2 as well.

Since the method GET_ADDRESS_KEY also provides the screen structure, this will allow the application to correctly determine the address key for the current controller.

       2.      For the different address controllers, the method GET_ADDRESS_KEY of class CL_BSP_APPLICATION_ADDRESS must return different values in the field EV_CONTEXT.

       3.      For each value of EV_CONTEXT, a different entry must be maintained in the blueprint tables under 'Navigation for Application Log'. Each entry must point to the controller corresponding to the respective value of EV_CONTEXT.

The same method also works with three or more controllers in the same application. In this case, further dummy structures like CRMT_BSP_ADDRESS_2 must be created.