Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAP BW End Routine Help

Hello friends

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

TagService No.    ERDAT

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:-

TagService No.     ERDAT           RDR
A34520150402   Yes
A56720150420       No

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.

Not what you were looking for? View more on this topic or Ask a question