Component Usage – Part 1 (Call Method of another ABAP WebDynpro)
In this example, I will detail all the steps required to call a method of one ABAP WebDynpro application from within another ABAP WebDynpro application.
Step 1: Create an ABAP WebDynpro component with a method to share with other WD apps.
ABAP DynPro Name: ZWD_CMP_SHARED_METHODS
Step 2: Create a method (check as Interface) on the Component Controller.
This WD application is complete and looks something like this:
Step 3: Create another ABAP WebDynpro component which we will use to call the method above.
ABAP DynPro Name: ZWD_CMP_CALL_SHARED_METHODS
On the Used Components tab, add an entry for your ZWD_CMP_SHARED_METHODS component
Step 4: In the main view, create a Component Usage for both the Shared Component and the Shared Component’s Interface Controller.
Step 5: In the main view, add the following code to the hook method: WDDOINIT.
That’s it! It’s that simple. In debug mode, you will see the call to the method in the component and the value “HELLO_WORLD” is returned.