11-19-2007 6:28 PM
11-19-2007 6:42 PM
A simplest way to do this to read BSID, and the group them into buckets (0-30, 30-60, 60-90, etc.) based on BSID-ZFBDT (if your baseline date is the true date for aging) or add bsid-zbd1t to the posting date and age based of that.
But again, there are standard aging reports in SAP and I dont know why you want to develop one.
Albert
11-19-2007 6:42 PM
A simplest way to do this to read BSID, and the group them into buckets (0-30, 30-60, 60-90, etc.) based on BSID-ZFBDT (if your baseline date is the true date for aging) or add bsid-zbd1t to the posting date and age based of that.
But again, there are standard aging reports in SAP and I dont know why you want to develop one.
Albert
11-19-2007 6:46 PM
Hi Albert
Thanks for your answer.
Can you pls provide programs for the same.
Regards,
Viswanath
11-19-2007 8:49 PM
You can look at the transaction S_ALR_87012178. But a sample code would be
select bukrs kunnr gjahr belnr budat wrbtr WAERS XBlnR SHKZG
zbd1t vbeln zfbdt
into corresponding fields of table it_bsid from bsid
where kunnr in s_kunnr
and bukrs in s_bukrs
and blart in s_blart
and zfbdt le wa_budat.
"Aging to be considered based on baseline date not postingdate if not change appropriately.
loop at it_bsid.
add it_bsid-zbd1t to it_bsid-budat.
if it_bsid-shkzg = 'H'.
it_bsid-wrbtr = -1 * it_bsid-wrbtr.
endif.
move corresponding it_bsid to output.
l_days = syst-datum - it_bsid-zfbdt.
if l_days le 30.
move it_bsid-wrbtr to output-thirty.
elseif l_days le 60.
move it_bsid-wrbtr to output-sixty.
elseif l_days le 90.
move it_bsid-wrbtr to output-ninety.
elseif l_days le 120.
move it_bsid-wrbtr to output-onetwenty.
else.
move it_bsid-wrbtr to output-over120.
endif.
append output.
endloop.
Albert
11-19-2007 9:09 PM