Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

RE:ALV grid (oops concept)

Former Member
0 Likes
479

Hi,

I have an object oriented alv which is having 5 rows of data.I have a pushbutton to make any row in editable mode.My requirement is i will select any row in oops alv grid and press

the button to make the row editable.How can i do this in oops alv.

Can anyone send a sample code for this.

Thanks in advance,

Alex.

Hi,

I have an object oriented alv which is having 5 rows of data.I have a pushbutton to make any row in editable mode.My requirement is i will select any row in oops alv grid and press

the button to make the row editable.How can i do this in oops alv.

Can anyone send a sample code for this.

Thanks in advance,

Alex.

2 REPLIES 2
Read only

dhruv_shah3
Active Contributor
0 Likes
442

Hi,

[http://www.sapdev.co.uk/reporting/alv/alvgrid_editable.htm]

Check demo pgm BCALV_EDIT_05.

[Check lots of Links|/thread/492162 [original link is broken];

HTH

Regards,

Dhruv Shah

Read only

Former Member
0 Likes
442

See I have an internal table I_output.

and u create a button by name vald or ente. and then try to implement the below code.

if u still not cleared just give me your mail id, i will send u a program i which we have the same functionality.

WHEN 'VALD' OR 'ENTE'.

CALL METHOD grid1->check_changed_data.

CALL METHOD grid1->get_selected_rows

IMPORTING

et_index_rows = i_index_rows.

IF i_index_rows IS INITIAL.

MESSAGE i000 WITH 'Select Rows to be Saved'.

EXIT.

ENDIF.

LOOP AT i_index_rows INTO wa_index_rows.

CLEAR: wa_output.

READ TABLE i_output INDEX wa_index_rows-index INTO wa_output.

MOVE-CORRESPONDING wa_output TO wa_insert. "#EC ENHOK

wa_insert-changed_by = sy-uname.

wa_insert-change_date = sy-datum.

wa_insert-change_time = sy-uzeit.

APPEND wa_insert TO i_insert.

ENDLOOP.

CLEAR: flg_upd.”flag

LOOP AT i_insert INTO wa_insert.

PERFORM f0005_validate_data.

CLEAR: wa_insert, flg_err.

ENDLOOP.

IF e_ucomm = 'VALD'.

IF NOT i_insert[] IS INITIAL.

LOOP AT i_insert INTO wa_insert.

UPDATE zfocp_details SET date_ack_rec = wa_insert-date_ack_rec

time_ack_rec = wa_insert-time_ack_rec

changed_by = wa_insert-changed_by

change_date = wa_insert-change_date

change_time = wa_insert-change_time

WHERE text = wa_insert-text

AND laufd = wa_insert-laufd

AND laufi = wa_insert-laufi

AND absbu = wa_insert-absbu

AND rzawe = wa_insert-rzawe

AND hbkid = wa_insert-hbkid

AND hktid = wa_insert-hktid

AND date_sent = wa_insert-date_sent

AND time_sent = wa_insert-time_sent.

IF sy-subrc = 0.

MESSAGE s000(zf_ebb1) WITH 'Records saved successfully'.

Endif.