on 2016 May 24 1:46 PM
Dear gurus ,
i am trying to create a pop-up window through double_click event in OOPS ALV but i am facing a problem that i created a local class and i want to create object with CL_GUI_CUSTOM_CONTAINER for that local class.
is it possible ???
when i tried i am getting an error
''No CONSTRUCTOR has been defined for "C1" defined.'' |
please share your valuable knowledge to resolve this problem.
Thank you.
Venkatesh.
Are you creating an instance of the C1 class somewhere?
I think a CREATE OBJECT RC1 is missing before the SET HANDLER part
Edit:
that is besides the fact that you're using the RC1 for event handler and container? That are supposed to be two separate instances of different classes!
Example:
METHOD constructor.
CREATE OBJECT:
r_event_handler.
* Creating custom container instance
CREATE OBJECT r_ccontainer
EXPORTING
container_name = c_custom_control_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
* Creating ALV Grid instance
CREATE OBJECT r_alvgrid
EXPORTING
i_parent = r_ccontainer
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
prepare_field_catalog( ).
exclude_tb_functions( ).
CALL METHOD r_alvgrid->set_table_for_first_display
EXPORTING
is_layout = s_layout
it_toolbar_excluding = t_exclude[]
CHANGING
it_outtab = r_mb11->t_data[]
it_fieldcatalog = t_fieldcat[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
r_alvgrid->register_edit_event( EXPORTING i_event_id = cl_gui_alv_grid=>mc_evt_modified ).
SET HANDLER r_event_handler->handle_data_changed_finished FOR r_alvgrid.
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You will need to post some code of the event handler class that you have used. Otherwise it will be practically impossible to help you. For example what has been defined as C1 in your code.
In general you can define a local event handler class and call anything you want. You can call a popup function module or even another alv list
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is my code
CLASS C1 DEFINITION.
PUBLIC SECTION.
METHODS: DOUBLE_CLICK FOR EVENT DOUBLE_CLICK
OF CL_GUI_ALV_GRID
IMPORTING E_ROW
E_COLUMN.
ENDCLASS.
CLASS C1 IMPLEMENTATION.
METHOD DOUBLE_CLICK .
READ TABLE IT_VARI INTO WA_VARI INDEX E_ROW-INDEX .
CALL SCREEN 3000 STARTING AT 10 5 ENDING AT 25 5.
ENDMETHOD.
ENDCLASS.
DATA : RC1 TYPE REF TO C1 ,
RG1 TYPE REF TO CL_GUI_ALV_GRID .
------------------------------------------------------------------------------------------------------------------------------
SET HANDLER RC1->DOUBLE_CLICK FOR RG1 .
CREATE OBJECT RC1
EXPORTING
* PARENT =
CONTAINER_NAME = 'CCON1'
* STYLE =
* LIFETIME = lifetime_default
* REPID =
* DYNNR =
* NO_AUTODEF_PROGID_DYNNR =
* EXCEPTIONS
* CNTL_ERROR = 1
* CNTL_SYSTEM_ERROR = 2
* CREATE_ERROR = 3
* LIFETIME_ERROR = 4
* LIFETIME_DYNPRO_DYNPRO_LINK = 5
* OTHERS = 6
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT RG1
EXPORTING
* I_SHELLSTYLE = 0
* I_LIFETIME =
I_PARENT = RC1
* I_APPL_EVENTS = space
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
* EXCEPTIONS
* ERROR_CNTL_CREATE = 1
* ERROR_CNTL_INIT = 2
* ERROR_CNTL_LINK = 3
* ERROR_DP_CREATE = 4
* OTHERS = 5
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD RG1->SET_TABLE_FOR_FIRST_DISPLAY
* EXPORTING
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
* I_STRUCTURE_NAME =
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = IT_FINAL
IT_FIELDCATALOG = IT_FCAT
* IT_SORT =
* IT_FILTER =
* EXCEPTIONS
* INVALID_PARAMETER_COMBINATION = 1
* PROGRAM_ERROR = 2
* TOO_MANY_LINES = 3
* OTHERS = 4
.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
User | Count |
---|---|
69 | |
13 | |
10 | |
9 | |
9 | |
8 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.