Google Search - Blog...........

ABAP - Remove Entries From A Search Help Hit List.

Thought i should offer some code i often find useful.

The below code removes entries from a searh help hit list.
This is taken from DMS, but the structure is the same regardless.
Espen Leknes

The field we are looking for, BEGRU is not part of the result returned from the search help.

This means we have to get the values for the primary key from the search help.
,which is available. Then we do a lookup from DRAW and get the field BEGRU. Voilá,
we have the field we are looking for and can remove that entry.

data: l_descbname type dfies,
l_descgltgb type dfies.

data: l_bname type xubname,
l_gltgb type xugltgb.

read table shlp_tab index 1.
read table shlp_tab-fielddescr with key fieldname = 'BNAME'
into l_descbname.
read table shlp_tab-fielddescr with key fieldname = 'GLTGB'
into l_descgltgb.
if sy-subrc eq 0.

loop at record_tab.
move record_tab+l_descbname-offset(l_descbname-intlen)
to l_bname.
move record_tab+l_descgltgb-offset(l_descgltgb-intlen)
to l_gltgb.
if l_gltgb < sy-datum and l_gltgb ne '00000000'.

delete record_tab.


No comments:

Post a Comment