10-22-2008 8:15 AM
Hi,
I have developed a OO Transaction with two docking containers. On the left docking container, I have a tree and on the screen I have some fields which are in invisible mode.
My requirement is, Whenever user double clicks on a respective node in the tree, I need to get the screen on the right hand side and with the fields in disable mode.
I can able to capture the event when the user double clicks. But I could not able to enable fields on the screen.
Here is the sample code.
CALL METHOD LO_ALV_TREE->GET_SELECTED_ITEM
IMPORTING
E_SELECTED_NODE = LV_SELECTED_ITEM
E_FIELDNAME = LV_FIELDNAME
EXCEPTIONS
NO_ITEM_SELECTION = 1
CNTL_SYSTEM_ERROR = 2
FAILED = 3
others = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE lty_t_node_ref INTO lv_t_node_ref WITH KEY NODE_NO = LV_SELECTED_ITEM.
IF lv_t_node_ref-EVENT IS NOT INITIAL.
Message i001(i) with 'Double click FROM' lv_t_node_ref-EVENT.
loop at screen.
screen-input = 1.
modify screen.
endloop.
Regards,
10-22-2008 8:36 AM
Hello Srinivas
Your coding sample is incomplete because we do not know when this coding is executed.
Assuming that this is part of your event handler method (HANDLE_DOUBLE_CLICK) then the MODIFY SCREEN statement(s) are at the wrong place.
Below you find my suggestion:
METHOD handle_double_click. " implementation
CALL METHOD LO_ALV_TREE->GET_SELECTED_ITEM
IMPORTING
E_SELECTED_NODE = LV_SELECTED_ITEM
E_FIELDNAME = LV_FIELDNAME
EXCEPTIONS
NO_ITEM_SELECTION = 1
CNTL_SYSTEM_ERROR = 2
FAILED = 3
others = 4.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE lty_t_node_ref INTO lv_t_node_ref WITH KEY NODE_NO = LV_SELECTED_ITEM.
" Store event in global variable, e.g.:
gd_event = lv_t_node_ref-EVENT.
" Trigger PAI of the dynpro
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'DUMMY'.
ENDMETHOD.
Logic in PBO module:
MODULE modify_screen.
CHECK ( gd_event IS NOT INITIAL ).
Message i001(i) with 'Double click FROM' lv_t_node_ref-EVENT.
loop at screen.
screen-input = 1.
modify screen.
endloop.
ENDMODULE.
Regards
Uwe
10-22-2008 8:34 AM
if you are talking about trees , just check this approach.
SAPSIMPLE_TREE_CONTROL_DEMO
SAPLIST_TREE_CONTROL_DEMO
SAPCOLUMN_TREE_CONTROL_DEMO
i am still doubtful what you are showing on the other side. is it a grid report.
10-22-2008 8:36 AM
Hello Srinivas
Your coding sample is incomplete because we do not know when this coding is executed.
Assuming that this is part of your event handler method (HANDLE_DOUBLE_CLICK) then the MODIFY SCREEN statement(s) are at the wrong place.
Below you find my suggestion:
METHOD handle_double_click. " implementation
CALL METHOD LO_ALV_TREE->GET_SELECTED_ITEM
IMPORTING
E_SELECTED_NODE = LV_SELECTED_ITEM
E_FIELDNAME = LV_FIELDNAME
EXCEPTIONS
NO_ITEM_SELECTION = 1
CNTL_SYSTEM_ERROR = 2
FAILED = 3
others = 4.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE lty_t_node_ref INTO lv_t_node_ref WITH KEY NODE_NO = LV_SELECTED_ITEM.
" Store event in global variable, e.g.:
gd_event = lv_t_node_ref-EVENT.
" Trigger PAI of the dynpro
CALL METHOD cl_gui_cfw=>set_new_ok_code
EXPORTING
new_code = 'DUMMY'.
ENDMETHOD.
Logic in PBO module:
MODULE modify_screen.
CHECK ( gd_event IS NOT INITIAL ).
Message i001(i) with 'Double click FROM' lv_t_node_ref-EVENT.
loop at screen.
screen-input = 1.
modify screen.
endloop.
ENDMODULE.
Regards
Uwe