Skip to Content
avatar image
Former Member

I tried deleting a record from standard table but not working

I need to delete a record from standard table scarr using this syntax but the record is not deleted please check it ,is it possible to delete the record from standard table or not help me in doing it .

data: wa_scarr type scarr.

wa_scarr-CARRID = 'SQ'.

wa_scarr-CARRNAME = 'Singapore Airlines'.

delete from scarr where carrid = wa_scarr-carrid and

carrname = wa_scarr-carrname.

if sy-subrc <> 0.

write: 'record not deleted'.

endif.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Oct 16, 2008 at 07:47 AM

    Hi,

    yes we can directly delete the record from that std table.

    Thank You,

    santhosh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 07:51 AM

    hi

    change this code as below

    data: wa_scarr type scarr.

    wa_scarr-CARRID = 'SQ'.

    wa_scarr-CARRNAME = 'SINAGAPORE AIRLINES'.

    delete scarr from wa_scarr where carrid = wa_scarr-carrid and

    carrname = wa_scarr-carrname.

    if sy-subrc NE 0.

    write: 'record not deleted'.

    endif.

    Edited by: venu gopal on Oct 16, 2008 9:51 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 07:53 AM

    Hi anjali,

    you can delete from the standard table , check after deleting sy-subrc .

    sy-subrc = 0 = deleted

    sy-subrc <> 0 = not deleted

    regards

    naveen

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 08:25 AM

    Hi,

    You might be having issue with 'SINGAPORE AIRLINES' and 'Singapore Airlines'. Acutally u dont have to use that field. you just have to specify the key for the table.

    u can use

    delete from scarr where carrid = 'SQ'.

    regards,

    Anoop Panackal

    Add comment
    10|10000 characters needed characters exceeded