cancel
Showing results for 
Search instead for 
Did you mean: 

edit and Save the alv data into table?

Former Member
0 Kudos

Hi,

I want to save the edited data in alv table. How to do this?

I have data populated in alv table. I make one column as editable. After editing the value in the column, i want to save it. It should be reflected in the table. Pls help.

Thanks,

Gopi.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Your ALV is bound to the context. When the user clicks SAVE or a custom button you create. You have access to the data in the table via the context. You can use simple SQL to update the table, but it would be cleaner to pass the whole table to an assitant class or some other business rules class.

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Once you edit the data in ALV table you store all the table details in the DB rght?

so to reflect back the edited data.

get the data from the DB and bind it back to the table.

***SELECT * FROM ZRM_C_CV_PRJDT INTO  CORRESPONDING FIELDS OF TABLE
 lT_sap_prj_experience where userid = lv_userid AND LANG = LV_LANG.
***
***CALL METHOD lo_nd_sap_prj_experience->BIND_table
***  EXPORTING
***    NEW_ITEMs          = lT_sap_prj_experience.

Priya

Former Member
0 Kudos

Hi,

Can u pls tell how to bind the data to the table? here i am used my own table with name - 'zemploye'

thanks,

Gopi.

Former Member
0 Kudos

Hi,

Once you get the contents of the ALV node and later you can pass the saem to some method for your [processing it again retunrs some table content right..

then as you have already giot the node instance you can ind the table with new content right..

please paste your code...

Former Member
0 Kudos

hi,

i used the following code in method ondatacheck().

DATA: node_output TYPE REF TO if_wd_context_node,

elem_node TYPE REF TO if_wd_context_element,

lt_emp TYPE if_alv_app=>elements_output,

itab TYPE TABLE OF zemploye.

CHECK r_param->t_error_cells IS INITIAL.

node_output

= wd_context->get_child_node( name = `OUTPUT` ).

node_output->get_static_attributes_table(

IMPORTING table = lt_sflight ).

node_output->bind_elements( EXPORTING new_items = ltab ).

ON_DATA_CHECK is the event used in ondatacheck().

But data is not getting store in my table zemploye.

Wat is the problem here?

Thanks,

Gopi.

Former Member
0 Kudos

Hi,

node_output->get_static_attributes_table(
IMPORTING table = lt_sflight ).
node_output->bind_elements( EXPORTING new_items = ltab ).

Here you getting data into lt_sflight table and biding some other table contenet itab to the same sode..

Now which table data you want to have it in zemployee

if both the zemployee and node strcutre are same ther you can directl get the content into zemployee..

can you be more clear on this.

Former Member
0 Kudos

Hi,

I am trying the application which is existing in this pdf link..

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a...

See page 8

save data to database

  • update... => only simlate, to not change the flight data model

  • content!

Data is not getting stored.. Wat would be the problem here?

thanks,

gopi.

Former Member
0 Kudos

Do you want this lt_slfight data move to daatabase table...is that so...

Former Member
0 Kudos

HI,

I guess you have some SAVE button right...

inthis button handler, try to read the node to which the ALV is bound(code wizard, read node) then it will

return the table of contents..now you an save them to DB table..

As the data that is already there is context node there is no need to bind the table again unless you do some changes internally through coding..