2008 Mar 26 4:26 AM
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.
2008 Mar 26 4:46 AM
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
2008 Mar 26 4:54 AM
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |