Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

OO Transaction With Docking Containers

Former Member
0 Kudos

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,

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

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

2 REPLIES 2

former_member188685
Active Contributor
0 Kudos

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.

uwe_schieferstein
Active Contributor
0 Kudos

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