EDIT ALV TREE
Hi all,
I followed SAP example program to create 'COLUMN structure ALV tree' to diaplay and i have to make some of the fields as editable and get back the changed values in the internal table.Here i did not use field catalog at all.
I used gui_custom_container,cl_gui_custom_container,cl_gui_column_tree ...and added every column to the the tree object .Built the node with two internal table(like order header & order item ) to form a tree.How should i get the changed values in the internal table when user changes values in Colums of order item node.
Any help is appreciated.
thanks,
dan.
Hello all,
Thanks for you reponses.I was actually referring COLUMN_TREE_CONTROL_DEMOF01,now kind of changing the code like BCALV_TREE_DEMO, BCALV_TREE_SIMPLE_DEMO .Looks like i can make the field as editable by changing the edit field in layout object.But unlike 'GRID' object this tree object is not having any method like 'check_change_data' .
How to get back the changed/values in iternal table or by any other means.
Any idea of getting changed values from ALV tree object would be really helpful.
thanks,
dan
Similar Messages
-
Hello All,
I am trying to make an Editable ALV tree ..but cannot find the
I have used fieldcat -edit = X but it only works for GRID ALV and not TREE ALV ...
Please help me on this .....
Edited by: Karan Chopra on Aug 2, 2010 1:11 PMHi Karan
CL_GUI_ALV_TREE is only a display tool.
It has not a feature for editable data unfortunately.
I was used a popup input screen on cell "double click" event to change the data in a cell
in one of my projects.
Maybe it can be a solution for u . -
Edit a field in ALV tree in a subscreen of a module pool
Hi
I want to make a field editable in the ALV tree based on some condtions in a subscreen of a module pool. I used the edit = 'X' field in the fieldcatalog still it is showing the field as display and not edit.
Please help me to get the field as editable and save it to the database table.
Please not this is ALV TREE
Regards,
MozilaHi Mayank,
Thanks for the reply
I am using oops method.
I tried making the field which is to be made editable as wa_fieldcatalog-edit = 'X'. But its not working. I didnt get you when you said edit in layout object.
I also went through the demo programs but these programs are not having editable fields.
My code is as follows:
IF tree4 IS INITIAL.
* create container for alv-tree
l_tree_container_name = 'TREE4'.
CREATE OBJECT l_custom_container
EXPORTING
container_name = l_tree_container_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
* create tree control
CREATE OBJECT tree4
EXPORTING
i_parent = l_custom_container
i_node_selection_mode = cl_gui_column_tree=>node_sel_mode_multiple
i_item_selection = 'X'
i_no_html_header = 'X'
i_no_toolbar = 'X'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
illegal_node_selection_mode = 5
failed = 6
illegal_column_name = 7.
* create hierarchy
CALL METHOD tree4->set_table_for_first_display
EXPORTING
is_layout = s_layo
CHANGING
it_sort = it_sort
it_outtab = it_final
it_fieldcatalog = it_fieldcat.
ELSE.
CALL METHOD tree4->refresh_table_display
EXPORTING
it_sort = it_sort
EXCEPTIONS
program_error = 1
failed = 2
cntl_system_error = 3
others = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endif. -
Editable Field in ALV Tree Control
Hello All,
Can anyone tell me how can i make a field editable in an Alv Tree grid. I have tried with fiedcatalog-edit = 'X'. but that doesn't work.
also please provide a piece of code to be clear ...
Thanks,
Ravi AswanihI ,
Data : LI_fieldcat type lvc_t_fcat,
ls_fcat type lvc_s_fcat.
IF OKCODE = 'MAIN'.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
I_BUFFER_ACTIVE =
i_structure_name = 'ZCUS'
I_CLIENT_NEVER_DISPLAY = 'X'
I_BYPASSING_BUFFER =
I_INTERNAL_TABNAME =
CHANGING
ct_fieldcat = LI_fieldcat[] .
LOOP AT LI_FIELDCAT INTO LS_FCAT.
CASE ls_fcat-fieldname.
WHEN 'KUNNR'.
ls_fcat-col_pos = 1.
WHEN 'NAME1'.
ls_fcat-edit = 'X'.
ls_fcat-col_pos = 2.
WHEN 'ORT01'.
ls_fcat-edit = 'X'.
ls_fcat-col_pos = 3.
ls_fcat-drdn_hndl = '1'.
ls_fcat-outputlen = 20.
WHEN 'LAND1'.
ls_fcat-edit = 'X'.
ls_fcat-col_pos = 4.
ENDCASE.
MODIFY LI_fieldcat FROM ls_fcat.
ENDLOOP.
ENDIF.
With this The internal Table contains 4 fields Kunnr Name1 Ort01 Land1 Here Kunnr is the Key field so , it is not editable , reaming fields are Editable.
There u must write the Modify statement.
check it once
Regards
Krishna -
Editable field in alv tree output using cl_gui_alv_tree
Hi,
i need Editable field with F4 help in alv tree output using cl_gui_alv_tree.
regards,
Nareshsadly, this is not possible. An ALV Tree cannot by editable.
Regards -
Editable Field in ALV TREE Display Using OOPs
Hi,
I am trying to make a field editable on the ALV Tree display. I could create an editable check box. But could not make a field Editable. I have made EDIT = 'X' in the fieldcatalog for the particular field. but it is not working.
Please help me in solving this. Its very urgent.You do this with the following code example
DATA: ls_layout TYPE lvc_s_layi.
CLEAR ls_layout.
ls_layout-class = cl_item_tree_control=>item_class_text.
ls_layout-editable = 'X'.
ls_layout-fieldname = your fieldname.
APPEND ls_layout TO lt_layout.
add PO header to tree
CALL METHOD tree->add_node
EXPORTING
i_relat_node_key = space
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = ls_po_item
is_node_layout = wa_layout_node
it_item_layout = lt_layout
Roy -
How to make field editable in ALV tree in OOPs?
Hi Gems,
Again I need help from you all.
I am writing a program using OOPs and the uotput will be in ALV tree. I need to make a field editable in a perticular row.
I am doing it using layout but the program is giving error during
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2.
This method is returning sy-subrc = 2 and I am unable to get the output.
I am using below code to make the field editable:
DATA: LT_LAYOUT_ITEM TYPE LVC_T_LAYI,
LS_LAYOUT_ITEM TYPE LVC_S_LAYI.
LS_LAYOUT_ITEM-FIELDNAME = 'ACPCKTWRT'. "ACPCKTWRT is the field name in the Internal table
LS_LAYOUT_ITEM-EDITABLE = 'X'.
APPEND LS_LAYOUT_ITEM TO LT_LAYOUT_ITEM.
CALL METHOD G_ALV_TREE->ADD_NODE
EXPORTING
I_RELAT_NODE_KEY = FP_RELAT_KEY
I_RELATIONSHIP = CL_GUI_COLUMN_TREE=>RELAT_LAST_CHILD
IS_OUTTAB_LINE = LS_TMP_FINFCNO "structure of the internal table
IS_NODE_LAYOUT =
IT_ITEM_LAYOUT = LT_LAYOUT_ITEM "Added layout to make the field editable
I_NODE_TEXT = LV_NODE_TEXT "Node text
IMPORTING
E_NEW_NODE_KEY = FP_NODE_KEY
EXCEPTIONS
RELAT_NODE_NOT_FOUND = 1
NODE_NOT_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Please help me and let me know how to get the solution.Hello
The ALV tree control is not intended for making values editable (e.g. see
[How to make ALV tree columns editable|http://sap.ittoolbox.com/groups/technical-functional/sap-abap/how-to-make-alv-tree-columns-editable-2052414])
However, if you need an editable tree control then you have to use a different class (e.g. CL_ITEM_TREE_MODEL or CL_COLUMN_TREE_MODEL) but you will not have the ALV functionality of the ALV tree control.
Regards
Uwe -
Editable field with F4 help in alv tree output using cl_gui_alv_tree
HI
i need Editable field with F4 help in alv tree output using cl_gui_alv_tree
Regards
NareshHi Naresh,
Pass the field catalog with the additional parameter (ls_fcat-edit = 'X'.).
for F4 help if the data element have the search help it automatically will come. other wise include the additional parameter in the field catalog (ls_fcat-F4AVAILABL = 'X')
Reward if found helpful.
Regards,
Boobalan Suburaj -
Editing a single cell at node level in Alv tree
Hi ,
I am a beginner in ALV tree.Can u please let me know if its possible to edit a single cell at the node level ?
Thanks in advance.
ArchnaCheck the Standard Program may it helpful BCALV_TREE_ITEMLAYOUT.
Kanagaraja L -
Hi,
I have created a ALV tree using CL_GUI_ALV_TREE. Here how can i make a single column as editable field
Pls help
ThanskTher are many fields in teh ALV tree. Just part of the code in the fieldcatalog , I'm putting here:
clear ls_fcat.
ls_fcat-fieldname = 'ZCDAT'.
ls_fcat-coltext = 'Min Due Date'.
ls_fcat-seltext = 'Min Due Date'.
optional: set column width
ls_fcat-outputlen = 10.
append ls_fcat to gt_fieldcatalog.
clear ls_fcat.
ls_fcat-fieldname = 'ZFCDAT'.
ls_fcat-coltext = 'Forc.Min Due Date'.
ls_fcat-seltext = 'Forc.Min Due Date'.
optional: set column width
ls_fcat-outputlen = 10.
ls_fcat-edit = 'X'.
append ls_fcat to gt_fieldcatalog. -
Hi all,
I have a requirement to display the Data in ALV tree format with some fields as editable.I have to display data in 3 levels,which are of differents structures.
To achieve editable in ALV tree display,I have used ALV GRID along with Tree display but here in GRID the 3 levels data is of same structure,but my requirement is of different structures.
Inputs regarding this will be highly appreciated.
Thanks,
Sravanthi .VHi Simone,
Thanks for your quick reply,I have used this Class also but iam not able to get the Fields editable even though it has the method for EDITABLE feature.
Thanks,
Sravanthi.V -
ALV Tree with editable checkbox
Hi all,
I have a ALV Tree with editable checkbox (for all the parent & leaf nodes) , as one of the column.On clicking of a button in toolbar , i should get the nodes which are checked in checkbox.
But the problem is i am not able to get the nodes which are checked through checkbox in the PAI of the screen,when the button is clicked.
I tried using
CALL METHOD wf_tree->get_checked_items
IMPORTING
et_checked_items = lint_selected_node.
but the return table is not containing any entries , even if check boxes are checked in ALV tree.I tried the GET_CHECKED_ITEMS method in event handler method of AFTER_USER_COMMAND and also CHECKBOX_CHANGE , but no success.
lfs_item_layout-fieldname = 'CHECK'.
lfs_item_layout-class = cl_gui_column_tree=>item_class_checkbox.
lfs_item_layout-editable = 'X'.
lfs_item_layout-CHOSEN = 'X'.
APPEND lfs_item_layout TO lint_item_layout.
CALL METHOD wf_tree->add_node
EXPORTING
i_relat_node_key = p_lfs_final_key
i_relationship = cl_gui_column_tree=>relat_last_child
i_node_text = l_node_text
is_outtab_line = p_gfs_final
is_node_layout = lfs_node
it_item_layout = lint_item_layout
IMPORTING
e_new_node_key = p_loc_qmnum_key.
Friends ,if you can suggest something.
Thanks
Abhijeethi ,
i have written below code for registering the CHECKBOX_CHANGE event of CL_GUI_ALV_TREE.
APPEND lfs_event TO lint_events.
lfs_event-eventid = cl_gui_column_tree=>eventid_CHECKBOX_CHANGE.
APPEND lfs_event TO lint_events.
CALL METHOD wf_tree->set_registered_events
EXPORTING
events = lint_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3.
IF sy-subrc EQ 0.
* MESSAGE X208(00) WITH 'ERROR'. "#EC NOTEXT
ENDIF.
SET HANDLER lo_event_receiver->handle_checkbox_change FOR wf_tree.
* SET HANDLER lo_event_receiver->handle_button_click FOR wf_tree.
ENDIF.
Also according to below code , i have put a break point in the event handler method of CHECKBOX_CHANGE event , so that control shall come here when check box is checked on ALV tree ...
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
* handle_checkbox_change FOR EVENT checkbox_change OF cl_gui_alv_tree,
* importing fcode.
* handle_button_click FOR EVENT AFTER_USER_COMMAND OF cl_gui_alv_tree
* IMPORTING ucomm,
handle_CHECKBOX_CHANGE for event checkbox_change of cl_gui_alv_tree
importing CHECKED
FIELDNAME
NODE_KEY.
ENDCLASS. "lcl_event_receiver DEFINITION
* CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_checkbox_change.
data : lint_selected_node TYPE LVC_T_CHIT.
BREAK abhijeetg.
* CHECKED
* FIELDNAME
* NODE_KEY
* case fcode.
* when 'SELALL'.
* perform select_all.
* CALL METHOD WF_TREE->GET_OUTTAB_LINE
* EXPORTING
* I_NODE_KEY =
** IMPORTING
** e_outtab_line =
** e_node_text =
** et_item_layout =
** es_node_layout =
** 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.
* call method cl_gui_cfw=>dispatch.
CALL METHOD wf_tree->get_checked_items
IMPORTING
et_checked_items = lint_selected_node.
break abhijeetg.
ENDMETHOD.
ENDCLASS.
So according to you , I should get the control in the break point , but its not happening with this .. any thing missing ???
Edited by: abhijeet_7013 on Jun 21, 2011 10:31 PM -
How to make some fields in ALV tree editable
Hello All,
Can any one tell me how to make some fields in ALV tree editable.
If possible please post some code.
Regards,
Lisa.Hi Lisa,
I want to make 3 fields in the ALV tree editable and update the saved values in ztable.
I tried making the wa_fieldcat-edit = 'X' But in vain.
Also i made the layout fields wa_layout-edit = 'X' and wa_layout-edit_mode = 'X'.
But still the alv tree field appears as display.
As you have mentioned in the post as answered, So please guide me to make the field editable.
I am using oops method.
Please provide me code if any.
Thanks & Regards,
Mozila -
How to make editable cell in ALV TREE?
Hi all,
I have a problem to make the cell in item row (I mean not the cell in hierarchy columns and not in the node row) in ALV tree editable.
I know to make it in "normal" ALV, but my ALV is type class: cl_gui_alv_tree and the nodes are calculated in a sum.Can anyone help me to set the cell editable in ALV tree?
Thank you a lot!
Best regards,
Danijela Zivanovic
Message was edited by: Danijela ZivanovicHI,
To make a column editable, it will be sufficient to set the field <b>EDIT</b> in the field catalog. The ALV Grid perceives if there are some editable fields and adds buttons for editing purposes. If you do not need these new buttons
<u><i>if you want it in the Classes</i></u>
For this procedure; add the name of the field to the field FIELDNAME, and pass cl_gui_alv_grid=>mc_style_enabled to make a field editable and cl_gui_alv_grid=>mc_style_disabled to make a field non-editable,
<b>Example:</b>
FORM adjust_editables USING pt_list LIKE gt_list[] .
DATA ls_listrow LIKE LINE OF pt_list .
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
LOOP AT pt_list INTO ls_listrow .
IF ls_listrow-carrid = 'XY' .
ls_stylerow-fieldname = 'SEATSMAX' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled . APPEND ls_stylerow TO lt_styletab .
ENDIF .
IF ls_listrow-connid = '02' .
ls_stylerow-fieldname = 'PLANETYPE' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled . APPEND ls_stylerow TO lt_styletab .
ENDIF .
INSERT LINES OF lt_styletab INTO ls_listrow-cellstyles . MODIFY pt_list FROM ls_listrow .
ENDLOOP .
ENDFORM
Thanks
Sudheer -
Alv tree editable fields?
Hi gusrus does any one knows if there is a way to set an entire
column editable or maybe only a cell in an alvtree
thanksok first you have to register the alv tree event handler for double click, once you have done this you need to use the method
g_alv_tree->get_selected_item, once you have got the selected node by using the g_alv_tree->get_selected_item , you have to use the method g_alv_tree->get_outtab_line, then use the function 'POPUP_GET_VALUES', and finaly use the method g_alv_tree->change_item where you can insert the obtained values from 'POPUP_GET_VALUES'.
thanks i hope you can solve your problem, let me know if you want to receive my source code because i think is complex explaning by here.
regards
Maybe you are looking for
-
I am using BI publisher in APEX to generate PDF report. Data is displayed only on paper size 8.5 X 11 regardless any paper size I select i.e. Letter 8.5x11, Legal 8.5x14, Tabloid 11x17, Custom 8.5x20.
-
How can i get the list of volumes(Drives )
I want to get the list of all Volumes(Drives) ,exist in the system Kindly some one help me
-
Lost Adobe plug-in for Safari 4
I downloaded the free version of Adobe because I thought I needed it for certain files. However, I soon realised that Preview is much more versatile as a reader and I uninstalled Adobe. However, in the process I appear to have removed the link that e
-
AppleTv - Something wrong with the video, amber light, etc.
Hello, I have this almost new AppleTV, and since last friday, after using it and leave it plugged all night it started with some issues. Now, after plug it, starts as usual, showing a steady amber light and then blinking amber on the front. On the TV
-
Posting to SCL4 -- Link an service call and an invoice --
Is there any way to post to SCL4 sooner to create the link between a service order and an expense document. Currently the link is created after one leaves the service module. That is too late to be functional. Therefore you cannot grab the service