Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Deleting ABAP Web Dynpro Component by function module or something similar

Former Member
0 Likes
1,924

Hi at all,

I want to write a programm that can delete a complete Web Dynpro Component for ABAP only by typing the component name.

In my research I've found the class CL_WDY_WB_COMPONENT and the Method DELETE but I think it don't delete all of the parts of the component.

For other objects I've found some really easy understanding function modules like

-  RS_FUNCTION_POOL_DELETE

-  OO_CLASS_DELETE

-  RS_DELETE_PROGRAM

But I couldn't find something for a Web Dynpro Component and all parts of it.

So please help me.

1 ACCEPTED SOLUTION
Read only

larshp
Active Contributor
0 Likes
1,474

try this,

    DATA: lo_component   TYPE REF TO cl_wdy_wb_component,

          lo_request     TYPE REF TO cl_wb_request,

          li_state       TYPE REF TO if_wb_program_state,

          lv_object_name TYPE seu_objkey.

    CREATE OBJECT lo_component.

    lv_object_name = 'ZASDF'.

    CREATE OBJECT lo_request

      EXPORTING

        p_object_type = 'YC'

        p_object_name = lv_object_name

        p_operation   = swbm_c_op_delete_no_dialog.

    lo_component->if_wb_program~process_wb_request(

      p_wb_request       = lo_request

      p_wb_program_state = li_state ).

try this,

    DATA: lo_component   TYPE REF TO cl_wdy_wb_component,

          lo_request     TYPE REF TO cl_wb_request,

          li_state       TYPE REF TO if_wb_program_state,

          lv_object_name TYPE seu_objkey.

    CREATE OBJECT lo_component.

    lv_object_name = 'ZASDF'.

    CREATE OBJECT lo_request

      EXPORTING

        p_object_type = 'YC'

        p_object_name = lv_object_name

        p_operation   = swbm_c_op_delete_no_dialog.

    lo_component->if_wb_program~process_wb_request(

      p_wb_request       = lo_request

      p_wb_program_state = li_state ).

4 REPLIES 4
Read only

former_member620069
Participant
0 Likes
1,474

Hi,

Why are you going to delete WD component??

I think you can not do this by a face less component.By default WD component having view and window.

Regards,

Srini.

Read only

0 Likes
1,474

I'm working in a company that is training new employees. To do this we have a lot of created exercises for example one in Web Dynpro. In every year we get new trainees and we don't want to reset the SAP system everytime, so we have decided to create a report to delete the results of the exercises from the past year..

Read only

larshp
Active Contributor
0 Likes
1,475

try this,

    DATA: lo_component   TYPE REF TO cl_wdy_wb_component,

          lo_request     TYPE REF TO cl_wb_request,

          li_state       TYPE REF TO if_wb_program_state,

          lv_object_name TYPE seu_objkey.

    CREATE OBJECT lo_component.

    lv_object_name = 'ZASDF'.

    CREATE OBJECT lo_request

      EXPORTING

        p_object_type = 'YC'

        p_object_name = lv_object_name

        p_operation   = swbm_c_op_delete_no_dialog.

    lo_component->if_wb_program~process_wb_request(

      p_wb_request       = lo_request

      p_wb_program_state = li_state ).

Read only

Former Member
0 Likes
1,474

At the first look, it is the perfect answer .... Thank you very much ...