Adding A row to a non editable ALV in ABAP Webdybpro
I have an ALV thats currently non editable. My requirement is that, when a User clicks on an Insert Row button, then a new row has to be inserted in the ALV and this row alone should become completley editable. Is there any means of doing this. I am aware of some standard editable buttons (such as Insert Row, Delete row etc) but somehow this does not meet my requirement as 1.I dont need some standard buttons such as Check and 2. The whole ALV has to be editable for these buttons to work.
There are options such as set_insert_row_allowed set_delete_row_allowed etc that lets you do this. And to the editable part of the questions, those rows can be bound to another attribute in a context and as per the needs that rows can be made editable or not.
Similar Messages
-
Adding an editable row in an non editable table.
Hi,
My requirement is to add an Editable row in a table which is in display mode only, i mean i cannot edit the data that is present in the table.
But if the user presses the Add Row button on the Table Toolbar, a new editable row should be added in the end, so that he can save the new data entered.
methods tried:
1: I have used Inputfield as Cell Editors, with their Read only Property check marked, thougt that with the new element created, it would not be Read Only.
2: Binded the read only property with a context attribute, but still was not able to achieve this functionality.
3: Tried the above two steps with the "Enabled" property of the Table Coloumn Cell Editors as well, but no result.
Please give me some pointers on this.
Regards,
AshishHi Ashish,
The approach you were following was correct, but I am not sure where you have placed the Enabled property attribute in the context.
Please follow these steps:
1. The table you are creating should have the enabled property set.
2. The context with you are binding the table should have an additional attribute say ISENABLED of type boolean.
3. Bind this attribute with the ENABLED property of all the input enabled fields in your table.
4. When binding the non-editable data into the table, set this property to ABAP_FALSE for each record. This will make the existing data non editable.
5. Use the below code for adding a new row and set the ISENABLE property of the added row to ABAP_TRUE.
elem_table = node_table->create_element( ).
node_table->bind_element( new_item = elem_table set_initial_elements = abap_false ).
stru_table-isenable = abap_true .
elem_new_row->set_static_attributes( static_attributes = stru_table ).
Let me know how you go about it.
Cheers,
Pratibha -
Row wise total in editable ALV
hello all,
I am workin on editable alv, the user need to enter the values in the editable fields and in the last column(non-editable) i need to populate the total row wise,as soon as user enters a value and goes to next editable cell or on entering a vale and press enter.how to accomplish this task...
with regards,
sandeep akella.
Edited by: sandeep akella on Aug 20, 2009 1:58 PMYou need to Implement the OnCellAction event.follow these steps;
1. Goto WDDOMODIFYVIEW and place the following code
IF first_time IS INITIAL.
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_usg_alv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_usg_alv( ).
DATA lo_value TYPE REF TO cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model(
CALL METHOD lo_value->if_salv_wd_table_settings~set_cell_action_event_enabled
EXPORTING
value = abap_true.
ENDIF.
2. Implement the onCellAction event as follows;
Goto Methods tab, create a new method. Method Type- Event Handler , Event - ON_CELL_ACTION
3. Now in this method retrive the contents of the row and calculate the value as follows.
DATA: l_element TYPE REF TO if_wd_context_element.
DATA:ls_stru TYPE wd_this->element_cn_alv.
DATA: l_node TYPE REF TO if_wd_context_node.
l_node = wd_context->get_child_node( 'CN_ALV' ).
l_element = l_node->get_element( r_param->index ).
l_element->get_static_attributes( IMPORTING static_attributes = ls_stru ).
ls_stru-last_col = ls_stru-col1+ls_stru-col2....+ ls_stru-col5. " add all the cells data
l_element->set_static_attributes( exporting static_attributes = ls_stru ). -
Adding new rows at run time in alv oops
HI ALL,
I have a created an editable alv report in oops. Now i have to add a new row having similar values as the previous row at run time when a custom button is clicked in the output and after entering some values in the new row and pressing the database must be updated and also the internal table at run time itself.
for example let us suppose i have the following row in the alv output.
MATNR DESCRIPTION NAME DATE
001 TEST MATRIKS 10092001
NOW if we click the custom button added on the alv toolbar, it should a new row at the run time similar to previous row as shown below
MATNR DESCRIPTION NAME DATE
001 TEST MATRIKS 10092001
001 TEST MATRIKS 10092001 -> NEW ROW.
can we do it in alv oops? pls let me know the soln or any helpful links
thanks
johnHi John,
I dont think, you can find any method for that,
one way what I can suggest is
Get the selected row index.
Insert the blank row in your internal table at this index
Refresh the container.
Hope this will help.
Thanks,
Anmol. -
hi ,
i need help on the below scenario ,
we have a web dynpro table with different columns, now based on new business requirement one of the column need to
dynamically editable or non editable for different row.
for ex :
Field 1
Field 2 ( Dynamic field )
Field 3
Field 4
Data 11
Data 12 ( Editable with Drop down )
data 13
data 14
Data 21
Data 22 ( Non editable )
Data 23
data 24
Data 31
data 32 ( Editable with drop down )
data 33
data 34
how to achieve this ? please help on this.
Thanks in advance
Thanks
ManishManish,
there is no proper way to insert two Cell Editors in a column(except variants), have a look on below scenario, it may help.
add one more attribute to your table context node for read-only.
create dropDown as celleditor for table and bind with newly created attribute to read-only property of dropdown.
before binding data to table, check the condition then mention readonly value abap_true / false.
@ we can achieve by the use of Variants.
for ex :
Data 11
Data 12 ( Editable with Drop down)
data 13
read-only - abap_false
Data 21
Data 22 ( Non editable, dropdown )
Data 23
read-only - abap_true
Data 31
data 32 ( Editable with drop down )
data 33
read-only - abap_false -
I_grid_settings-edt_cll_cb = 'X' in editable ALV
Hi,
I displayed output in editable ALV in ABAP. In output I have edited the cell but in debugging the value is not getting reflected. Using
i_grid_settings-edt_cll_cb = 'X' we can catch the value but I am not able to catch.
Kindly provide the suggestion to catch the the edited value using above settings.
Thanks in advance,
Regards,
Arindam Samanta.Hi,
I assume Your requirement like this .
Hope you activate >
I_GRID_SETTINGS = I_GRID_SETTINGS.
and then check this full code will help you as example.
transferring alv grid data to other program
Otherwise if you only want few editable field,then you can follow this code,which I am using,it is also easy.
a snippet,
CONSTANTS :
gc_refresh TYPE syucomm VALUE '&REFRESH'.
CONSTANTS :
c_x VALUE 'X'.
data: lt_event_exit TYPE slis_t_event_exit,
ls_event_exit TYPE slis_event_exit.
wa_fieldcat-fieldname = 'REMARKS'.
wa_fieldcat-seltext_l = 'Remarks'.
wa_fieldcat-edit = 'X'.
wa_fieldcat-col_pos = 1.
wa_fieldcat-outputlen = 50.
wa_fieldcat-emphasize = 'X'.
wa_fieldcat-key = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR ls_event_exit.
ls_event_exit-ucomm = gc_refresh. " Refresh
ls_event_exit-after = c_x.
APPEND ls_event_exit TO lt_event_exit.
Depend upon your user command like save,refresh it ill work also,like example,
FORM user_command USING r_ucomm TYPE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE sy-ucomm.
WHEN gc_refresh.
refresh it_new_s.
LOOP AT it_new into wa_new where flag eq 'X'.
append wa_new to it_new_s.
ENDLOOP.
it_fieldcat_s[] = it_fieldcat[].
delete it_fieldcat_s where fieldname = 'FLAG'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_user_command = 'USER_COMMAND_S'
i_callback_pf_status_set = 'PF_STATUS_SET'
it_fieldcat = it_fieldcat_s
is_layout = wa_layout
it_sort = it_sort
it_event_exit = lt_event_exit
TABLES
t_outtab = it_new_s[].
and
FORM pf_status_set USING ut_extab TYPE slis_t_extab. "#EC CALLED
DELETE ut_extab WHERE fcode = gc_refresh.
SET PF-STATUS 'STANDARD_FULLSCREEN' OF PROGRAM 'SAPLKKBL'
EXCLUDING ut_extab.
ENDFORM.
There are lots of thread on editable alv,check also.
Thanks
Gourav. -
Make rows as non editable in ALV
Hi Experts,
I have a standard ALV table where records are fetched from backend table. Here I have a field Approved as check box.
My requirement is I need to make all the rows as non editable, if the Approved checkbox is checked. How can I achieve this.
I went through the below discussion, but still am not clear of how to achieve it.
How to set some rows in ALV to be editable or some non editable.
I know to set a field as non editable in WD, but don't know how to set some specific rows as non editable in alv.
Please help me.
With Regards,
Ramakrishnan MHi,
Create an Attribute in the Context say READ_ONLY of type wdy_boolean and bind the read only of cell editor to that attribute using set_read_only_fieldname( ) method. Then set the value of attribute READ_ONLY to abap_true/abap_false based on check box value.
check this wiki for reference: How to edit conditionally row of a ALV table in Web Dynpro for ABAP - Web Dynpro ABAP - SCN Wiki
Hope this helps u,
Regards,
Kiran -
How can we make edit and non edit of rows on particular conditions in alv
hi experts,
i am very new to web dynpro for abap.i have one query regarding alv.
in one view i have alv table with two line items,and line each line item having foue editable fields and remaining are non editable.
now i am navigating to another view and make some action.here i have generated one value and updated this value to one field ofselected line items of alv table in the previous view.now i am coming back to previous view .now i want to display the row of alv table which contain value which is generated in second view as completely non editable and remaining rows are as it is .
hi guys please look into this and suggests me.Hi babu,
You can do this in one view it self.
create a one attribute of type wdy_boolean.. in view context.
Bind these attribute to read only property of table.. and initially set the value to abap_true in wddoinit method.
Then create one button say "EDIT" in view and create action for edit button.. in that action set the above attribute value to
abap_false.
so now, initially table will be in display mode, when you click on edit mode...it will become editable mode...
Hope you got some idea.
Regards
Srinvias -
Making some rows non-editable in ALV grid
hi
I am using reuse_alv _grid _display to display the output. I want to make some of the rows non-editable based on some conditions. please help.Hi Vijay / Manisha / Murugan
Is this question answered? The link is presently not working.
I have a same requirement. I am using reuse_alv _grid _display to display the output. After click on 'Add row'
button, the alv should add a row in edit mode and remaining all other rows in display mode. Is that possible using reuse_alv _grid _display?
Any kind of inputs regarding this will be damn damn helpful. Thanks. -
How to restrict f4 help in non editable field in alv.
Hi Experts,
I Have one Column in ALV GRID which is non editable,but i have implemented f4 help in that column for new rows to be added.
so, for already existing rows i want to restrict input through f4 help in that column.
please help.
thanks in advance
surbhiHi,
Use FM REUSE_ALV_GRID_DISPLAY and implement the I_CALLBACK_USER_COMMAND for this as:-
I_CALLBACK_USER_COMMAND = 'USER_COMMAND' "<--in caps
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis-selfield.
CASE ucomm.
WHEN '<function_code>'.
"validate the entry done by user here.
ENDCASE.
ENDFORM.
Hope this helps you.
Regards,
Tarun -
Make editable and non-editable some cells in ALV OO
Hello Experts, i have a table like this:
KUNNR DATE VALUE1
And a search button that obtains data, and then display the information in the ALV, like this
KUNNR DATE VALUE1
1000 1.1.2009 A
1001 2.2.2009 B
Also i have a button that append an empty line to the ALV
I want that the kunnr retrieved in the search be non-editable
But i want that the kunnr cell in the appended line be editable
How can i do this?
THANKS!
Edited by: Mariano Gallicchio on Jun 26, 2009 3:45 PMwhen (sy-ucomm for New row)
LOOP AT <fcat> into <workarea>
CASE <workarea>-fieldname.
WHEN 'KUNNR'.
* Making a column as Editable
<workarea>-edit = 'X'.
ENDCASE.
ENDLOOP.
Kanagaraja L
Edited by: Kanagaraja Lokanathan on Jun 26, 2009 4:01 PM
Edited by: Kanagaraja Lokanathan on Jun 26, 2009 4:02 PM -
Editable ALV Grid: Append new rows
Hi All,
I have developed a report which will displays output in editable ALV grid list. Users can modify the values in output and save. These values will be stored in one custom table.
My requirement is whenever user clicks on '+' mark (Create entries or Append or Copy: Standard toolbar) report should allow to enter new entries and save. How do I capture the selected function code? why becuase i need to display one value from the custom table in that added new row...
Regards,
Ramesh.Hi Ramesh,
please check changed data event.....
please go through the reference link......
https://wiki.sdn.sap.com/wiki/display/Snippets/UpdatingtheInternalTable-AfterEditinALVusingFunctionModules
Regards,
Venkat -
Editable ALV (CL_GUI_ALV_GRID) Pasting add new rows
Hi all,
I have a problem with OO ALV.
I'm using class CL_GUI_ALV_GRID as I need to have a couple of editable columns.
Let's say that we have columns Material and Quantity. And Quantity is editable.
Toolbar buttons for adding new rows, paste, copy, are all disabled.
Suppose I have 2 rows in the ALV.
If I copy to clipboard from, for example, Excel, more than 2 rows, and paste them in Quantity column of the ALV, the result is that new rows are inserted till all the information in the clipboard is pasted. The new rows have all blank values except for the column I'm pasting.
I do not want this rows inserted. I supposed that this wounldn't happened, as there are no buttons for inserting rows.
Anybody knows how to change this behaviour?
Thanks a lot.
Alejandro Galliano.Hi Alejandro,
You can implement your own functionality to create new row.You can add your own button in ALV for New row creation. In another simple way is you place the button in the screen which display the ALV and implement the logic in PAI of the screen.
the logic is simple add new row in the internal table which you are using to display ALV and refresh the ALV.Then your new row will appear in the Grid.
Regards,
Mike -
Get Current row in Editable ALV
Hi,
I have editable alv, when i press "insert row" or "Append row" i need to get current inserted/appended row element reference or index.
How can i get this??
Please suggest.Hi kranthi ,
While inserting row you must be selecting a row, you can get the index of the selected row by this following code
get Index of selected table item
CALL METHOD NODE_NAME->GET_LEAD_SELECTION_INDEX
RECEIVING INDEX = Lv_Indx.
( DATA: Lv_Indx Type i )
or while you are appending a row you can use Describe int_table LINES lv_line and use the value of 'lv_line' as the index.
Regards -
One row as editable and other row as non-editable in table control
Hi Experts,
Is this possible to make one row as editable and another row is non editable in table control?
My Requirement is
1st row non editable field
Customer code, description,amount will come from the previous screen this will be non editable for user.
2nd row editable
User has to enter the amount in 2nd row here the customer code description will be empty.
If 4 customer are there
1,3,5,7 should be non editable and 2,4,6,8 should be editable..
Pls help me in this issue..
Thanks in Advance!hI
This is a simple Module POOL program with only Table control and nothing else
" This is Tested to Enable one row and disabling the next row
in TOP Include
controls : tc type tableview using screen 100.
DATA : OK TYPE SY-UCOMM.
DATA : ITAB TYPE TABLE OF SPFLI WITH HEADER LINE.
in PBO
PROCESS BEFORE OUTPUT.
MODULE status_0100.
LOOP AT itab WITH CONTROL tc.
MODULE TC_MOD.
ENDLOOP.
in PAI
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
LOOP AT itab.
ENDLOOP.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'TEST'.
SET TITLEBAR 'TEST'.
DESCRIBE TABLE itab LINES tc-lines.
IF tc-lines = 0.
tc-lines = 20.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
MODULE tc_mod OUTPUT.
DATA : mod TYPE i.
LOOP AT SCREEN.
mod = tc-CURRENT_LINE MOD 2 .
IF mod = 1.
IF screen-name = 'SPFLI-CARRID'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.
ENDMODULE. " TC_MOD OUTPUT
Edited by: Ramchander Krishnamraju on Jan 25, 2011 7:17 AM
Maybe you are looking for
-
I think I have a virus or bot on my MacBook. Random e-mails have been sent from my e-mail overnight. I use comcast.net. Any suggestions for removing the bot.
-
hi, I am using the standard report of S_ALR_87012168 to identify the due date analysis of customers. in that report i can't get the amount in foregin currency. only local currency amount is displaying. when creating a invoice we enter both local curr
-
A small symbol has come up to the left of the battery symbol. i have found out that this is the screen rotation lock. not sure hoe this has been turned on and i cant seem to turn it off. I read that there is a button above the volume control on the i
-
Charged for free service?
From 15th Feb to 17th Feb my line had a fault - I could mak but not receive calls. I registered the fault with BT who set up call diversion to my mobile numeber, which I assume is a free service ( it was in 2002 or 3 when I last had a fault). Now I s
-
Three questions about a single-folio publication
We are finishing our first publication with DPS. We have a Adobe DPS Professional Edition, Annual version. 1- I have been planning to launch the App in iPad and Android for free and in three days to put the price at $9,00. Is that possible? 2 - How m