Skip to Content
0
Former Member
Aug 17, 2005 at 11:06 AM

Is this MODIFY statement ABAP coding okay?

706 Views

Hi,

I had this code:

if del_entries ne false. 
      delete from zsrcmtrx where lockkey eq lock_key. 
    else. 
      select * from zsrcmtrx into table lit_zsrcmtrx 
            where lockkey eq lock_key. 
      loop at lit_zsrcmtrx. 
        lit_zsrcmtrx-locked = false. 
        update zsrcmtrx from table lit_zsrcmtrx. 
      endloop. 
    endif.

I've changed it to:

IF del_entries NE false. 
      DELETE FROM zsrcmtrx WHERE lockkey EQ lock_key. 
    ELSE. 
      SELECT * FROM zsrcmtrx INTO TABLE lit_zsrcmtrx 
            WHERE lockkey EQ lock_key. 

      IF sy-subrc = 0. 
        LOOP AT lit_zsrcmtrx. 
          lit_zsrcmtrx-locked = false. 
          MODIFY lit_zsrcmtrx. 
        ENDLOOP. 
        UPDATE zsrcmtrx FROM TABLE lit_zsrcmtrx. 
      ENDIF. 
    ENDIF.

Is this okay? in your opinion? I'm just wondering if the Modify statement needs to have any additions to it...

Many Thanks for any help.