Skip to Content
avatar image
Former Member

Delete records from database

Hi all,

i need to delete records from database based on case no.

Following code is not working :

METHOD ONACTIONDELETEREC .

DATA LO_ND_PROD_HEADER TYPE REF TO IF_WD_CONTEXT_NODE.

DATA LO_EL_PROD_HEADER TYPE REF TO IF_WD_CONTEXT_ELEMENT.

DATA LS_PROD_HEADER TYPE WD_THIS->ELEMENT_PROD_HEADER.

  • navigate from <CONTEXT> to <PROD_HEADER> via lead selection

LO_ND_PROD_HEADER = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_PROD_HEADER ).

  • get element via lead selection

LO_EL_PROD_HEADER = LO_ND_PROD_HEADER->GET_ELEMENT( ).

  • get all declared attributes

LO_EL_PROD_HEADER->GET_STATIC_ATTRIBUTES(

IMPORTING

STATIC_ATTRIBUTES = LS_PROD_HEADER ).

DATA LO_ND_PRODUCT_BRIEF TYPE REF TO IF_WD_CONTEXT_NODE.

DATA LO_EL_PRODUCT_BRIEF TYPE REF TO IF_WD_CONTEXT_ELEMENT.

DATA LS_PRODUCT_BRIEF TYPE WD_THIS->ELEMENT_PRODUCT_BRIEF.

  • navigate from <CONTEXT> to <PRODUCT_BRIEF> via lead selection

LO_ND_PRODUCT_BRIEF = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_PRODUCT_BRIEF ).

  • get element via lead selection

LO_EL_PRODUCT_BRIEF = LO_ND_PRODUCT_BRIEF->GET_ELEMENT( ).

  • get all declared attributes

LO_EL_PRODUCT_BRIEF->GET_STATIC_ATTRIBUTES(

IMPORTING

STATIC_ATTRIBUTES = LS_PRODUCT_BRIEF ).

DATA LO_ND_PRODUCT_MASTER TYPE REF TO IF_WD_CONTEXT_NODE.

DATA LO_EL_PRODUCT_MASTER TYPE REF TO IF_WD_CONTEXT_ELEMENT.

DATA LS_PRODUCT_MASTER TYPE WD_THIS->ELEMENT_PRODUCT_MASTER.

  • navigate from <CONTEXT> to <PRODUCT_MASTER> via lead selection

LO_ND_PRODUCT_MASTER = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_PRODUCT_MASTER ).

  • get element via lead selection

LO_EL_PRODUCT_MASTER = LO_ND_PRODUCT_MASTER->GET_ELEMENT( ).

  • get all declared attributes

LO_EL_PRODUCT_MASTER->GET_STATIC_ATTRIBUTES(

IMPORTING

STATIC_ATTRIBUTES = LS_PRODUCT_MASTER ).

  • DATA LV_case type TABLE OF ZDSIN_PRD_BRF.

DATA Lt_tab type TABLE OF ZDSIN_PRD_BRF.

DATA ls_tab TYPE ZDSIN_PRD_BRF.

DELETE FROM Lt_tab WHERE CASE_NO = Lt_tab-CASE_NO.

Thanks

Kiran

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 06, 2011 at 06:55 AM

    hi Kiran,

    DELETE FROM Lt_tab WHERE CASE_NO = Lt_tab-CASE_NO. Here lt_Tab-case_no. what is this no? Have you tried by debugging,

    this value is getting or not? I think case no you are getting from somewhere in above three tables right?

    DELETE FROM Lt_tab WHERE CASE_NO = LS_PRODUCT_BRIEF-case_no // may be case_no in this ls_product_brief table.

    And in your code, you are reading all tables but you are not doing anything, doing deletion from standard table value itself?

    check in debugg and try.

    Cheers,

    Kris.

    Add comment
    10|10000 characters needed characters exceeded