08-20-2007 9:59 AM
hi friends..
i have one basic doubt.
we can edit the data in grid.
my question is is it reflected in database.
ie the modified data will updated in database or not ?
can you send me sample program for this scenario ?
08-20-2007 10:01 AM
HI,
no it will not be reflected in DB.
it will be reflected only in the internal table which u r using to hold the data in alv.
<b>reward if helpful</b>
rgds,
bharat.
08-20-2007 10:03 AM
Hi,
you can modify the data base tables from alv
but it is not suggestable as the std tables should be modified through
std transactions or bdc programs or bapi ..
through alv
in the fiedl catalog you have the option for edit
for a particular field
catalog-edit = 'X'.
and then display it
after seeing the display you can edit that field
when you clik the save button
capture the sy-ucomm code and do the coding accordingly
and in the user command you have to take those values and modify your
internal table and
then you can use the statements
modify ztable from table itab.
or update ztable from table itab.
thanks & regards,
Venkatesh
08-20-2007 10:03 AM
Hi,
The Update won't reflect in Database Tables.Because while displaying the Grid,u will use only the Internal Table & not the Database Table.
If u modify the grid,it will affect only the Internal Table & not the Database Table.
U just display the Internal Table Values & Database Table Values after Updating the Grid.U come to know this.
Regards,
Padmam.
08-20-2007 10:03 AM
Hi
Refer to this report
<b>BCALV_FULLSCREEN_GRID_EDIT</b>
Regards
Ravish
<b>
Reward if helpful</b>
08-20-2007 10:03 AM
H selva,
No it will not be reflected in Database,
and AS as friend i want to tell one thing,
this question was answerd number of times in this forum itself,
before posting any question plz plz verfiy carefully, if ur not satisfied then u post it.
sorry selva if u feel bad .
Reward points if u think there is some useful meaning in this thread.
Thanks
Naveen khan
Message was edited by:
Pattan Naveen
08-20-2007 10:22 AM
08-20-2007 10:24 AM
suppose i want to edit the data in alv..this should be reflected in database ?
how i do this ?
08-20-2007 10:42 AM
Hi Selva,
If the changes should reflect in the Database means,first u have to update the Internal Table Values.After that using Internal Table Values u can update the Database Values.
If u edit some Field in Grid,it wont reflect in the Internal Table.For that u have to call one method <b>CHECK_CHANGED_DATA</b>
For Eg.,
CASE OKCODE.
WHEN 'UPDATE'.
CALL METHOD <ur grid name>->CHECK_CHANGED_DATA.
ENDCASE.
It will Update only the Internal Table Values.U have to write codings for Updating the Database Tables.
In my Scenario,I used BAPI for Updating the Database Tables from Internal Table.
Regards,
Padmam.
08-20-2007 12:30 PM
hi padman..
which Bapi you used for your program can you please...
As u mentioned
CASE OKCODE.
WHEN 'UPDATE'.
CALL METHOD <ur grid name>->CHECK_CHANGED_DATA.
ENDCASE.
to use this should i need to use class. if s pls let me know the class name and how to use?
in my scenario i am using the reuse_alv_grid_display. Function module.
after changing the data in the output of result. how could i change my internal table
08-20-2007 10:04 AM
08-20-2007 10:04 AM
Hello,
follow this link for sample program on editable ALV.
Regards,
Deepu.K
08-20-2007 10:05 AM
hi
good
yes if you r editing any data in the grid than it ll update the data accordingly.
http://www.erpgenie.com/abap/controls/alvgrid.htm
thanks
mrutyun^