on 09-30-2005 4:32 PM
I want to call a public method in a supcontroller from a main controller. It is no problem to call a method that is standard defined in the class CL_BSP_CONTROLLER2, but wen tryin to call one that I have defined my self it dumps.
DATA: sup_ctr TYPE REF TO cl_bsp_controller2,
w_username TYPE string.
Call from MAIN controller.
CALL METHOD me->get_controller
EXPORTING
controller_id = 'USER'
RECEIVING
controller_instance = sup_ctr.
Call own defined method (this goes wrong).
CALL METHOD sup_ctr->get_username.
Hi Micheal
try to take SUP_CTR type ref to as your child controller class name not cl_bsp_controller2.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Shiva, that worked.
DATA: sup_ctr TYPE REF TO cl_bsp_controller2,
user_ctr TYPE REF TO z_cl_c_z0020_user,
w_username TYPE string.
Call from MAIN controller.
CALL METHOD me->get_controller
EXPORTING
controller_id = 'USER'
RECEIVING
controller_instance = sup_ctr.
user_ctr ?= sup_ctr.
Call own defined method.
CALL METHOD user_ctr->get_username
IMPORTING
user = w_username.
Regards Michael
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.