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: 

ALV Tree : Multiple time User Interactions

Former Member
0 Kudos
112

Hi all ,

I'm using an ALV Tree(Oops based) to display data . There are some user interactions on this output .

I'm able to acheive the necessary user interactions(like checkbox, update line item, etc) .

My queries are :-

But these interactions are not working when I use it for the second time .

For example, If I check a line item and update the a field , it is working perfect ,

But soon after this, if I check another line and try to update the field, there is no change in the output . It stays where it was .

I have used these: Flush or frontend method , but to no avail .

Pls let me know, what am I missing here .

(ii) Also , I'm calling this ALV tree from another screen . But if I go back and come back again to the ALV Tree screen ,

there is a blank screen only .

I could not find a solution for this .

Many Thanks in Advance .

Regards

Anil

3 REPLIES 3

Clemenss
Active Contributor
0 Kudos
50

Hi anil,

can you describe in brief how you so it?

Let's check some relevant code lines about display, refresh, event handling.

Some tons of blogs&wiki may be worth checking.

Regards,

Clemens

Former Member
0 Kudos
50

Hi Clemens ,

The ALV Tree I'm displaying has got checkboxes assigned for each line .

When I click some checkboxes and Press the button DESELECT ALL(a custom button created on the application toolbar)

all the checkboxes are UNCHECKED . So far it is good .

Again, when I try to repeat these actions( by checking some more checkboxes and pressing the DESELECT ALL button)

this time it would not work .

The code I used here is

case sy-ucomm .

when 'DESELECT' .

CALL METHOD tree1->get_checked_items

IMPORTING

et_checked_items = it_checked_items.

APPEND LINES OF it_checked_items TO i_selected_lines .

ls_laci-fieldname = tree1->c_hierarchy_column_name.

ls_laci-chosen = ''.

ls_laci-u_chosen = 'X'.

ls_laci-class = cl_gui_column_tree=>item_class_checkbox.

IF i_selected_lines[] IS NOT INITIAL .

LOOP AT i_selected_lines .

CALL METHOD tree1->get_outtab_line

EXPORTING

i_node_key = i_selected_lines-nodekey

IMPORTING

e_outtab_line = i_checked_lines.

CALL METHOD tree1->change_item

EXPORTING

i_node_key = i_selected_lines-nodekey

i_fieldname = tree1->c_hierarchy_column_name

i_data = i_checked_lines

i_u_data = ''

is_item_layout = ls_laci

EXCEPTIONS

node_not_found = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDLOOP .

ENDIF .

CALL METHOD tree1->frontend_update.

CALL METHOD cl_gui_cfw=>flush.

endcase .

What is that I'm missing here .

(Also , the second time , the checked lines internal table is initial . I dont know why ?? )

Many Thanks

Regards

Anil

Clemenss
Active Contributor
0 Kudos
50

Hi anil,

as your code is not formatted at all

it is not very good to read.

I do not see any (local, global?) variable declaration, do not know what may be cleared or not. Also, you use internal tables with header lines, forbidden in oo context anyway, and not good for analysis anyway.

You may try to replace FORM routines by methods and separate global from local data.

A frequent error is creating more than one instance of the tree - in debugger you can see the instance number, check that this does not change.

Always try the Preview tab before posting, thank you.

Regards,

Clemens