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: How to insert my input into the field?

Former Member
0 Kudos

ALV Tree

Want to insert/edit text particular field.

Using method popup_get_values.

Dont know how to insert my input into the field.

Refresh the ALV Tree?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Guys, thanks for the suggestions.

I found the solution.

METHODS handle_item_double_click
       FOR EVENT item_double_click OF cl_gui_alv_tree
       IMPORTING node_key
                          fieldname.

You need to use node_key and fieldname to do ur changes.

Next, create a popup_get_values.

Then, use CALL METHOD g_alv_tree->change_item to change specific item by passing node_key and fieldname.

Lastly, CALL METHOD g_alv_tree->frontend_update .

Thanks,

Wong

10 REPLIES 10

former_member182040
Active Contributor
0 Kudos

check the standard   Report BCALV_EDIT_01

 

0 Kudos

I am using ALV Tree. Not Grid.

Thanks,

Wong

Former Member
0 Kudos

Dhivya
Active Participant
0 Kudos

Hi Wong,

U can use this code.

ls_fcat-fieldname = 'FIELDNAME'.

ls_fcat-ref_table = 'TABLE NAME'.

ls_fcat-col_pos = 8 (which position you would like to add the column to)

append ls_fcat to lt_fcat.

Thanks,

Dhivya

Former Member
0 Kudos

1. create a container.


  IF g_custom_container IS INITIAL.
    CREATE OBJECT g_custom_container
      EXPORTING
        container_name = g_container.

    CREATE OBJECT grid1
      EXPORTING
        i_parent = g_custom_container.
  ENDIF.

2. fill the field catalog table.

3. do this for the field to be edited and modify the field catalog table.

    wa_celltab-fieldname = wa_temp-fname.

    wa_CELLTAB-style = cl_gui_alv_grid=>mc_style_enabled.

    INSERT wa_celltab INTO TABLE it_celltab.

  INSERT LINES OF it_celltab INTO WA_FCAT-celltab index v_tabix.

  MODIFY it_fcat from wa_fcat.


4. Display
  gs_layout-stylefname = 'CELL'.


CALL METHOD grid1->set_table_for_first_display
           EXPORTING  is_layout  = gs_layout
           CHANGING  it_outtab   = it_fcat
                     it_fieldcatalog  = it_fieldcat.

5. set edit enabled cells ready for input

IF grid1->is_ready_for_input( ) eq 0.
    CALL METHOD grid1->set_ready_for_input
                     EXPORTING i_ready_for_input = 1.

  ELSE.
*6. lock edit enabled cells against input
    CALL METHOD grid1->set_ready_for_input
                    EXPORTING i_ready_for_input = 0.

0 Kudos

I am using ALV Tree. Not ALV Grid.

Thanks,

Wong

0 Kudos

use this method

CALL METHOD G_ALV_TREE->ADD_NODE

0 Kudos

Sorry my bad.

Check this link

http://scn.sap.com/thread/2016863

CALL METHOD g_tree->add_node

CALL METHOD g_tree->change_item

Dhivya
Active Participant
0 Kudos

This message was moderated.

Former Member
0 Kudos

Guys, thanks for the suggestions.

I found the solution.

METHODS handle_item_double_click
       FOR EVENT item_double_click OF cl_gui_alv_tree
       IMPORTING node_key
                          fieldname.

You need to use node_key and fieldname to do ur changes.

Next, create a popup_get_values.

Then, use CALL METHOD g_alv_tree->change_item to change specific item by passing node_key and fieldname.

Lastly, CALL METHOD g_alv_tree->frontend_update .

Thanks,

Wong