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

Alv Tree display dynamically using screen controls

Former Member
0 Likes
1,791

In the classes you capture the double-clicks.   So design a tree and use a splitter.  When they double click on a tree node on the left side, you can build one or more ALV’s on the right side within the splitter container.

Example: we have list of Tcodes on the left hand side. once we double click on the tcode from the left hand side, the data should be displayed on the right hand side with in the same screen.

Data should be displayed dynamically in the splitter container.

Please help me with the Logic and Points will be awarded for the same.

Quick replies are appreciated. Thanks All in Advance

Regards,

Sunny.

Moderator Message: Offering points & showing "urgency" are against forum RoE.

Message was edited by: Suhas Saha

9 REPLIES 9
Read only

Former Member
0 Likes
1,609

You have great idea and good knowledge of ALV classes.

Search for content and build your own program - you will learn better.

Post your difficulties. Don't "SCN-source" your work.

Read only

0 Likes
1,609

Hi Chinmay,

I am not asking for the entire logic here... Already build the program and I got stucked up in between with the data refresh.

While clicking on the left hand side tree for the first node, data is displaying. the problem here is clicking on the next level node, the data is not refreshing properly and hence no alv display for the second node in the right hand side. Any pointers to go ahead 

Regards,

Sunny

Read only

0 Likes
1,609

Are you showing the same internal table with restricted entries or showing entire new tables?

If you could post any screenshots, that would help.

In case you are showing new tables, the first point that comes to my mind is - you need to clear earlier container and alv.

Now, First you need to call method FREE and once it runs successfully, you need to use CLEAR command on the same. Many ABAPers forget to CLEAR the container and ALV objects and the data is not displayed.

the command and sequence is:

CLEAR alv_name.

CLEAR container_name.

If this doesn't work, please post screenshots.

Read only

0 Likes
1,608

Hi chinmay

before putting those statements, its working for one node i.e. when i click one node it should display respective values in right side ALV container

now when i put those statement im unable the records in the alv.

my requirement is when i click first node i.e new1 it should display one alv(dynamically)

again if i click another node i.e. server status it should display another alv(this time the structure will be different )

for my convenient i did not implimented dynamic alv.

    METHOD  z_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'.
    g_node_key = node_key.
*    free the container
*    CALL METHOD g_alv_container->free .
    CALL METHOD cl_gui_cfw=>flush.
    clear: g_alv_container,
           g_alv_tree.
*  call method g_alv_tree->refresh_table_display( ).
    IF node_key = 'New1'.
      refresh t_mara.
*      trigger an ALV .
      SELECT * FROM mara
       INTO TABLE t_mara
       UP TO 30 ROWS.
       call method CL_GUI_CFW=>FLUSH .
        IF g_alv_tree is not initial.
        CALL METHOD g_alv_tree->CHECK_CHANGED_DATA( ) .

        ENDIF.
*      CALL METHOD g_alv_tree->refresh_table_display( ).

    ENDIF.

    IF node_key = 'New3'.
      refresh t_mara.
*      trigger an ALV .
      SELECT * FROM mara
       INTO TABLE t_mara
       UP TO 5 ROWS.
       call method CL_GUI_CFW=>FLUSH .
        IF g_alv_tree is not initial.
        CALL METHOD g_alv_tree->CHECK_CHANGED_DATA( ) .

        ENDIF.
*      CALL METHOD g_alv_tree->refresh_table_display( ).

    ENDIF.

   ENDMETHOD.

for you to understand im posting code as well. This method will trigger in PBO event where i have this method.

regards

sunny

Read only

0 Likes
1,608

clear: g_alv_container,
           g_alv_tree.


You are destroying these objects in this line. So, none of your calls to g_alv_tree later are getting executed.

Hence, you will always get blank data when you double click.

You need to create these objects again after you clear them using the syntax "Create Object xxx"

Read only

0 Likes
1,608

Thanks for this information. but what should i do now?

Read only

0 Likes
1,608

Told you. Create the container and ALV again.

SpoonFeeding:

Instead of below code:

IF g_alv_tree is not initial.
        CALL METHOD g_alv_tree->CHECK_CHANGED_DATA( ) .
        ENDIF.

Write:

Create Object g_alv_container.

Create Object g_alv_tree.

Then again call first_table_display method from ALV

For both 'NEW1' and 'NEW3'. (Also, make this capital)


Read only

0 Likes
1,608

hi chinmay,

i think you are not getting my issue.

after this method, the code is not finished, i have created object  g_alv_container, g_alv_tree. my problem is not only displaying the alv records but it should be interactive . I have seen in the debugger that the values are going in the table in right way, but its not displaying in the container.

regards

sunny

Read only

0 Likes
1,608

solved by myown.

im creating g_alv_container, g_alv_tree if its intial. its working fine.

Thanks

sunny