‎2008 Jan 15 7:28 AM
Dear Friends
I am writing a bapi having foolowing code it is for authorisation
I hv display following fields
uname agr_name report profile objct field von
problem is that it is rpeating the uname agr_name i don't want duplicate enries of hese fields
Pl suggest me
types: begin of ty_temp,
uname type aguname,
agr_name type agr_name,
report type extdreport,
profile type agprofile,
end of ty_temp.
data: it_temp type standard table of ty_temp.
field-symbols <fs_itab> like line of it_temp.
data: begin of wa.
include structure zautho.
data: end of wa.
select puname pagr_name sreport tprofile
into corresponding fields of table it_temp
from agr_users as p inner join agr_hier as s on sagr_name = pagr_name
inner join agr_1016 as t on tagr_name = pagr_name
where p~uname eq uname.
loop at it_temp assigning <fs_itab>.
concatenate <fs_itab>-profile '00' into <fs_itab>-profile.
condense <fs_itab>-profile no-gaps.
select objct field von into (wa-objct, wa-field, wa-von)
from ust12 where auth = <fs_itab>-profile.
wa-uname = <fs_itab>-uname.
wa-agr_name = <fs_itab>-agr_name.
wa-report = <fs_itab>-report.
wa-profile = <fs_itab>-profile.
append wa to output.
endselect.
endloop.
endfunction.
‎2008 Jan 15 8:51 AM
Just do this @ the end:
SORT output BY uname agr_name.
DELETE ADJACENT DUPLICATES FROM output COMPARING uname agr_name.
Regards,
Aditya
Edited by: Aditya Laud on Jan 15, 2008 3:52 AM
‎2008 Jan 15 8:51 AM
Just do this @ the end:
SORT output BY uname agr_name.
DELETE ADJACENT DUPLICATES FROM output COMPARING uname agr_name.
Regards,
Aditya
Edited by: Aditya Laud on Jan 15, 2008 3:52 AM
‎2008 Jan 15 9:20 AM
adjacent duplicate will delete entire row of the output
and output is the expoting parameter not a internal table
‎2008 Jan 15 11:29 AM
hi sashi,
please put your posts here. i am watching the forum and get a mail intimating me of a post here and can keep track.
could you please paste the short dump information here - i.e. the "error analysis" of the dump as viewed from ST22.
Thanks,
Aditya
‎2008 Jan 15 11:15 AM
Hi Shashi,
the statement APPEND wa TO output. tells me that output is in fact an internal table which contains the details to be output. it is probably a function parameter, however it is an internal table.
now, if you remove the duplicate entries in output table within the function module, the calling program would then receive returned table w/o duplicate entries as I believe you need.
have you tried putting this block of code i mentioned and tested?
/aditya