05-09-2012 5:38 AM
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?
05-11-2012 9:55 AM
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
05-09-2012 5:45 AM
05-09-2012 9:27 AM
05-09-2012 5:48 AM
05-09-2012 6:07 AM
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
05-09-2012 7:36 AM
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.
05-09-2012 9:27 AM
05-09-2012 9:53 AM
05-09-2012 9:58 AM
Sorry my bad.
Check this link
http://scn.sap.com/thread/2016863
CALL METHOD g_tree->add_node
CALL METHOD g_tree->change_item
05-09-2012 9:59 AM
05-11-2012 9:55 AM
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