SAP BW End Routine Help
I have a new requirement, but I am unable to resolve it with minimum time spent in a loop and/or the requirement per say.
We have a PSA source with the following fields
Now we move this in a DSO (key field: Service no.). The user wants another field namely RDR which should populate it according to the following logic:
If for the same tag the ERDAT is within 7 days of previous ERDAT, then RDR = 'yes', else RDR='no'. Also, the first occurrence must be RDR='blank'.
Hence, after end routine, the DSO should look like this:-
Now, the problem is that the source brings in 7 days of data. Hence, all the 7 day old records/line items come up every time DTP fetches the records.
Can you please let me know the logic atleast to handle this scenario. Ive tried several ways but it doesnt give the correct results or in the shortest period of time.