Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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

Former Member
Not what you were looking for? View more on this topic or Ask a question