Skip to Content
0
Former Member
Feb 05, 2009 at 09:48 AM

Instantiating and Deleting a Component Usage

13 Views

Hi,

I want to delete a component and create the same component again.

But when I create the same coponent again the method "WDDOMODIFYVIEW" is not called.

I need to do this because the code in IF first_time = abap_true. in "WDDOMODIFYVIEW" must be executed every time.

I have the following code:

lo_cmp_usage = wd_this->wd_cpuse_invoice_lines( ).

IF lo_cmp_usage->has_active_component( ) IS INITIAL.

lo_cmp_usage->create_component( ).

ELSE.

lo_cmp_usage->delete_component( ).

lo_cmp_usage->create_component( ).

ENDIF.

Thanks,

Morten