Application Development 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: 

Deletion OF schedule LInes from APO SPP(Spare Parts Planning) through ABAP.

Former Member
0 Kudos

Dear All,

I need to delete the schedule Lines from APO SPP(spare parts planning ) system.I am looking for any available BAPI provided by SAP for this purpose.Please provide me help if any of you folks previously in your project went through this requirement.

If any other way is there other than BAPI please suggest.

Regards

Mukesh Pandey

1 REPLY 1

Former Member
0 Kudos

Hi Mukesh,

                DAO class has to be used accordingly as per your need

DAta: ob_dao_ds             TYPE REF TO /sapapo/cl_tdl_lc_ds_dao.

DATA: zlwa_init_tab LIKE LINE OF zit_init_tab.

     CREATE OBJECT zob_dao_ds .

* Create selection parameter

     zlwa_init_tab-param = 'ATP_CAT'.

     zlwa_init_tab-value = 'BE'.

     APPEND zlwa_init_tab TO zit_init_tab.

     CLEAR zlwa_init_tab.

     zlwa_init_tab-param = 'LC_ORDER_TYPE'.

     zlwa_init_tab-value = '16'.

     APPEND zlwa_init_tab TO zit_init_tab.

     CLEAR zlwa_init_tab.

     zlwa_init_tab-param = 'USE_SIMSESSION'.

     zlwa_init_tab-value = '-'.

     APPEND zlwa_init_tab TO zit_init_tab.

     CLEAR zlwa_init_tab.

     zlwa_init_tab-param = 'VERSION_ID'.

     zlwa_init_tab-value = '000'.

     APPEND zlwa_init_tab TO zit_init_tab.

     CLEAR zlwa_init_tab.

     TRY.

         CALL METHOD zob_dao_ds->/scmb/if_tdl_dao_general~init

           EXPORTING

             it_init_paramtab = zit_init_tab.

       CATCH /scmb/cx_tdl_dao INTO z_dao.

     ENDTRY.


*& set the original DS to Buffer before deleting.

           CALL METHOD ob_dao_ds->/scmb/if_tdl_deliveryschedule~set

             EXPORTING

               iv_vrsioid = sim_vrsioid

               it_order   = it_sl_ds_orig

             CHANGING

               ct_return  = lit_rettab.

           CALL METHOD ob_dao_ds->/scmb/if_tdl_deliveryschedule~delete

             EXPORTING

               iv_vrsioid = sim_vrsioid

               it_ordid   = it_del_ordid

             CHANGING

               ct_return  = lit_rettab.



TRY.

         CALL METHOD ob_dao_ds->/scmb/if_tdl_dao_general~save_to_db

           CHANGING

             ct_return = zit_rettab.

       CATCH /scmb/cx_tdl_dao .

       ROLLBACK WORK

     ENDTRY.

TRY.

         CALL METHOD zob_dao_ds->/scmb/if_tdl_dao_general~free.

       CATCH /scmb/cx_tdl_dao

ROLLBACK WORK

     ENDTRY.

Thanks,

Salim