Application Development and Automation 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: 
Read only

Split screen or docking container help

Former Member
0 Likes
941

Hi all,

My program

i have a docking control where the user configure his own programs as nodes on the left pane

Requirement:

On double click of node corresponding program has to appear or get executed on the right pane.

How do i achieve this.

Can any one help me.

Regards,

Lisa

6 REPLIES 6
Read only

Former Member
0 Likes
867

Hi Lisa,

you must register the events in the left pane and then capture them for the right pane.

For example, if you are using a tree control, you have to register the events in this way:


  DATA: EVENTS TYPE CNTL_SIMPLE_EVENTS,
        event type cntl_simple_event.

* define the events which will be passed to the backend
  " node double click
  event-eventid = CL_GUI_SIMPLE_TREE=>EVENTID_NODE_DOUBLE_CLICK.
  event-appl_event = 'X'. " process PAI if event occurs
  APPEND event to events.

  CALL METHOD G_TREE->SET_REGISTERED_EVENTS
    EXPORTING
      EVENTS = EVENTS
    EXCEPTIONS
      CNTL_ERROR                = 1
      CNTL_SYSTEM_ERROR         = 2
      ILLEGAL_EVENT_COMBINATION = 3.
  IF SY-SUBRC <> 0.
    MESSAGE A000.
  ENDIF.

* assign event handlers in the application class to each desired event
  SET HANDLER G_APPLICATION->HANDLE_NODE_DOUBLE_CLICK FOR G_TREE.
  SET HANDLER G_APPLICATION->HANDLE_EXPAND_NO_CHILDREN FOR G_TREE.

Then you have to capture the events:


CLASS LCL_APPLICATION DEFINITION.

  PUBLIC SECTION.
    METHODS:
      HANDLE_NODE_DOUBLE_CLICK
        FOR EVENT NODE_DOUBLE_CLICK
        OF CL_GUI_SIMPLE_TREE
        IMPORTING NODE_KEY,
ENDCLASS.

CLASS LCL_APPLICATION IMPLEMENTATION.

  METHOD  HANDLE_NODE_DOUBLE_CLICK.
    " this method handles the node double click event of the tree
                                       " control instance

  ENDMETHOD.
  ...
ENDCLASS.

For more information, please have a look at the Reuse Library (transaction SE83) > SAP Technology > Controls > Tree Controls, or go directly to program SAPSIMPLE_TREE_CONTROL_DEMO.

I hope it helps. Kind regards,

Alvaro

Read only

0 Likes
867

Hi Alvaro,

This code i have written already. My requirement is when the user double clicks on the left node i am able to identify where the user has clicked now i want to bring that selection screen on the right hand side of pane. Is it possible or not.

If yes how?

Regards,

Lisa

Read only

0 Likes
867

Hi Lisa,

please run and experiment report SAPSIMPLE_TREE_CONTROL_DEMO. If you double click on a node, the name of this node will appear on the right pane.

This is achieved in the implementation of class LCL_APPLICATION:


  METHOD  HANDLE_NODE_DOUBLE_CLICK.
    " this method handles the node double click event of the tree
                                       " control instance

    " show the key of the double clicked node in a dynpro field
    G_EVENT = 'NODE_DOUBLE_CLICK'.   "this populates a field in the dynpro
    G_NODE_KEY = NODE_KEY.           "this populates a field in the dynpro
  ENDMETHOD.

So G_EVENT and G_NODE_KEY are populated every time you double-click a node in the tree. NODE_KEY gives you information on the node which has been clicked.

I hope this helps. Kind regards,

Alvaro

Read only

0 Likes
867

Hi Alvaro,

This won't work in my case. My selection screens will vary based on the program user has selected.

Regards,

Lisa

Read only

0 Likes
867

the problem is: when you call a program, it is not on the right or something - it is always fullscreen

if you want to keep the left pane, you have to foresee it in each program you call

of course this is possible only in specific programs and you won't be able to do it generically

Read only

Former Member
0 Likes
867

Hi Lisa

do I understand your right, you want to execute any program in the right pane, e.g. a SAP standard transaction? Like in an iView... this is unfortunately not possible in SAPGUI environment.

Best Regards

Bodo