function zalv_variant_delete.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" VALUE(I_REPORT) TYPE LTDX-REPORT
*" VALUE(I_VARIANT) TYPE LTDX-VARIANT
*" EXCEPTIONS
*" NO_DELETION
*" NO_ENTRY
*"----------------------------------------------------------------------
data: ld_mandt type sy-mandt,
ld_count type i.
ld_mandt = sy-mandt.
select count( * ) from v_ltdx client specified
into ld_count
where mandt = ld_mandt and
report = i_report and
variant = i_variant .
if sy-subrc <> 0.
raise no_entry.
else.
if ld_count > 0.
delete from ltdx where report = i_report and variant = i_variant.
if sy-subrc <> 0.
raise no_deletion.
endif.
endif.
endif.
endfunction.
评论