2011 Dec 05 6:47 AM
Hello friends,
My requirement is..as i have created one alv report ....
my user will run this report and as per their requirement they delete the rows as for some reasons....
I provide this functionality with dbase table also....
but at the same time if the user select one or more than one rows from alv it should me lock check wheter this particular row is locked or not.......
after that he/she will aloow to delete that rows from alv and dbase table...
can you suggest me the appropriate way...as i mention my code as under below.....
CLEAR lv_ucomm.
lv_ucomm = sy-ucomm.
CASE lv_ucomm.
WHEN 'DELETE'.
CALL METHOD g_ref_grid->get_selected_rows
IMPORTING
et_index_rows = lt_row.
REFRESH lt_status.
LOOP AT lt_row INTO ls_row.
READ TABLE gt_status INTO gs_status INDEX ls_row-index.
IF sy-subrc = 0.
ls_status = gs_status.
APPEND ls_status TO lt_status.
CLEAR ls_status.
ENDIF.
ENDLOOP.
IF lt_status IS INITIAL.
MESSAGE e026(zalt_m_f0016).
ENDIF.
LOOP AT lt_status INTO ls_status.
lv_reqid = ls_status-request_id.
CALL FUNCTION 'ENQUEUE_EZALT_L_CRIF_REQ'
EXPORTING
mode_zalt_t_crif_stat = 'E'
mandt = sy-mandt
request_id = lv_reqid
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e027(zalt_m_f0016).
ENDIF.
CLEAR lv_reqid.
ENDLOOP.
DELETE zalt_t_crif_stat FROM TABLE lt_status.
COMMIT WORK AND WAIT.
regards
rahul
2011 Dec 05 7:07 AM
Hi
I provide this functionality with dbase table also....
So you have created table maintenance and alv for data maintenance of the custom table . In TMG the table is completely locked and not a particular entry. In TMG for locking an individual row you can check the suggestion provided by Max where in the trick is not done by a custom lock object. In ALV you can create a custom lock object for the records based on key values and use it.
So I think its not possible to overwrite the standard locking functionality in SM30 replacing it by your own lock object.
Either use ALV or SM30.
Kesav
2011 Dec 05 7:07 AM
Hi
I provide this functionality with dbase table also....
So you have created table maintenance and alv for data maintenance of the custom table . In TMG the table is completely locked and not a particular entry. In TMG for locking an individual row you can check the suggestion provided by Max where in the trick is not done by a custom lock object. In ALV you can create a custom lock object for the records based on key values and use it.
So I think its not possible to overwrite the standard locking functionality in SM30 replacing it by your own lock object.
Either use ALV or SM30.
Kesav
2011 Dec 06 11:12 AM