‎2019 Aug 08 3:46 AM
Hi Experts,
I created z program through alv tree grid split screen for sales document viewing. this program have an event of double click where upon clicking the sales order on the left side, the line items will be seen on the right side then I added a hyperlink to VA23 by adding icon in status and using call transaction that I added in (using sy-ucomm)PAI process.
I have successfully added this function(hyperlink to va23) but after clicking the back button and going back to alv tree grid split screen display, I tried to click another sales order and at this point the double click event is not working, and also I tried to add function for changing the parameter filters by creating a selection screen & adding select-options and called it through PAI process, same as the hyperlink after clicking the back or execute the double click event is not working.
In line with this, I would like to ask your guidance if I missed something or what. this is my first OOP and ALV TREE GRID SPLIT SCREEN program. I tried to search but I don't know the keywords to search related to my concern.
Your help is deeply appreciated, Thank you!
‎2019 Aug 08 6:42 AM
it will be hard to help you without the relevant part of the code (the event).
Maybe you forget to clear the command after managing it, sometimes it is because instead of leaving screen, you call a new one ...
A debug, will certainly help you to understand
‎2019 Aug 09 2:28 AM
Hi Sir Frederic,
Apologies for not including the program code yet because I want to know if there are something to do first or rule of thumb in changing of screen while using class events. I debugged and still can't figure but I think I got some clues and not sure about it, I found that after calling the initial screen(9000) the screen still remains(9001 which is my split screen).
‎2019 Aug 09 2:31 AM
Class -
class lcl_event_handler definition.
public section.
methods: node_dc for event node_double_click of cl_simple_tree_model
importing node_key sender.
endclass.
class lcl_event_handler implementation.
method: node_dc.
Data: lt_children type tm_nodekey,
lt_vbap type standard table of ty_vbap.
Data: ls_layout type lvc_s_layo.
CALL METHOD SENDER->NODE_GET_LAST_CHILD
EXPORTING
NODE_KEY = node_key
IMPORTING
CHILD_NODE_KEY = lt_children.
if lt_children is not initial.
CALL METHOD SENDER->EXPAND_NODE
EXPORTING
NODE_KEY = node_key
LEVEL_COUNT = 3.
endif.
split node_key at space into v_so v_item.
if gt_vbap is not initial.
clear: lt_vbap.
lt_vbap = gt_vbap.
delete lt_vbap where vbeln ne v_so.
clear: gt_fcat.
perform build_alv_fieldcat using gt_fcat. "orig
ls_layout-grid_title = text-002.
ls_layout-zebra = 'X'.
ls_layout-smalltitle = ''.
ls_layout-cwidth_opt = 'X'.
CALL METHOD REF_ALV2->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IS_LAYOUT = ls_layout
CHANGING
IT_FIELDCATALOG = gt_fcat
IT_OUTTAB = lt_vbap.
CALL METHOD REF_ALV2->REFRESH_TABLE_DISPLAY.
endif.
endmethod.
endclass.
‎2019 Aug 09 2:32 AM
Selection Screen -
selection-screen: begin of screen 9000.
selection-screen: begin of block blk1 with frame title text-001.
select-options: so_erdat for gv_erdat no-extension.
selection-screen: end of block blk1.
selection-screen: end of screen 9000.
‎2019 Aug 09 2:35 AM
PBO - Data output
MODULE PROCESSING_OUTPUT OUTPUT.
Data: ls_node type treemsnodt,
ls_root type string.
ls_root = gs_rengi-name1.
CALL METHOD REF_TREE->ADD_NODE
EXPORTING
NODE_KEY = 'ROOT'
ISFOLDER = 'X'
TEXT = ls_root
EXPANDER = 'X'.
loop at gt_root assigning <fs_root>.
ls_node-node_key = <fs_root>-lifsk.
ls_node-text = <fs_root>-root.
CALL METHOD REF_TREE->ADD_NODE
EXPORTING
NODE_KEY = ls_node-node_key
RELATIVE_NODE_KEY = 'ROOT'
RELATIONSHIP = cl_simple_tree_model=>relat_last_child
ISFOLDER = 'X'
TEXT = ls_node-text
EXPANDER = 'X'.
****
loop at gt_vbak assigning <fs_vbak> where lifsk eq <fs_root>-lifsk.
* ls_node-node_key = <fs_vbak>-vbeln.
concatenate <fs_vbak>-vbeln
<fs_vbak>-auart
into ls_node-node_key.
ls_node-relatkey = <fs_vbak>-lifsk.
ls_node-text = <fs_vbak>-vbeln.
CALL METHOD REF_TREE->ADD_NODE
EXPORTING
NODE_KEY = ls_node-node_key
RELATIVE_NODE_KEY = ls_node-relatkey
RELATIONSHIP = cl_simple_tree_model=>relat_last_child
ISFOLDER = ''
TEXT = ls_node-text
EXPANDER = ''.
endloop.
endloop.
ENDMODULE.
‎2019 Aug 09 2:38 AM
PAI 9001 usercommand -
MODULE USER_COMMAND_9001 INPUT.
case sy-ucomm.
when 'BACK' or 'EXIT' or 'CANC'.
leave to screen 0.
when 'DISP'.
if v_so is not initial.
read table gt_vbak assigning <fs_vbak> with key vbeln = v_so.
if sy-subrc eq 0.
if <fs_vbak>-auart eq 'ZR6' or <fs_vbak>-auart eq 'ZRM'.
set parameter id 'AUN' field <fs_vbak>-vbeln.
call transaction 'VA13' and skip first screen.
elseif <fs_vbak>-auart eq 'ZTI'.
set parameter id 'AGN' field <fs_vbak>-vbeln.
call transaction 'VA23' and skip first screen.
endif.
endif.
else.
message 'Please select document number' type 'S' display like 'E'.
endif.
when 'SETFIL'.
" Filter that calls screen 9000
set screen '9000'.
" I tried call screen '9000', call selection-screen '9000'.
" but still the same
when others.
endcase.
ENDMODULE.
‎2019 Aug 09 11:37 AM
Little correction about terms used:
"ALV GRID TREE" could mean the ALV tree "control" (= class CL_GUI_ALV_TREE, which in fact is a wrapper of the "column tree control", to make it look like an ALV with a tree at the left).
But in fact you're using the "simple tree control" (or "simple tree model" to be exact = CL_SIMPLE_TREE_MODEL, it's internally a wrapper of the "simple tree control").
‎2019 Aug 09 11:44 AM
Difficult to say what is the problem, some code is also missing.
As far as I can see, the initial program is your custom program and you use CALL TRANSACTION to display standard screen. When you return from it, your own screen should simply display again without doing anything, so I guess you are doing something in the PBO.
Can you also explain how you build your splitter (inside dynpro or selection screen or docking or what?) and how you instantiate REF_ALV2 (you should do it once).
‎2019 Aug 19 3:09 AM
Hi Sandra,
Goodmorning! Thank you for comments. I will closed this question and post a detailed one. I made a new program using CL_GUI_ALV_TREE instead of cl_simple_tree_model, I encountered the same problem too and i think I really missed something.