function /btr/mdr_pp_dsf_hcm_delnotes.
“———————————————————————————————————
“Local Interface:
“ IMPORTING
“ REFERENCE TYPE TABNAME
“ REFERENCE TYPE FIELDNAME
“ REFERENCE TYPE C
“ REFERENCE TYPE C
“ EXPORTING
“ REFERENCE TYPE C
“ REFERENCE TYPE C
“ TABLES
“ XT_CONTAINER STRUCTURE SWCONT OPTIONAL
“———————————————————————————————————
data:
lv_pernr type persno,
lt_pcl1 type standard table of pcl1,
lv_pcl1 like line of lt_pcl1.
field-symbols:
like line of lt_pcl1.
“ Make sure the tablename is PCL1
check x_tabname eq ‘PCL1’.
“ Ensure we are not running in test mode…
check x_test_mode eq space.
“ Get the peronnel number out…
swc_get_element xt_container ‘PERNR’ lv_pernr.
“ Check we have a value…
if lv_pernr is initial.
exit.
endif.
“ Build the key…
concatenate lv_pernr ‘%’ into lv_pcl1-srtfd.
“ Get all entries…
select *
from pcl1
into table lt_pcl1
where relid eq ‘TX’ “Textual notes
and srtfd like lv_pcl1-srtfd.
“ Loop through each entry and delete it
loop at lt_pcl1 assigning .
“ Delete the entry…
delete
from pcl1
where relid = -relid
and srtfd = -srtfd
and srtf2 = -srtf2.
endloop.
“ Never have the framework perform any updates as this has
“ already been done…
y_no_update = ‘X’.
endfunction.
Post your comment on this topic.