Skip to Content
Former Member
Jul 15, 2008 at 04:19 PM

How to display varying from and to dates in a variant in SAP non custom prg


I have a SAP non custom program which the user goes to every day and enters current date for from and to dates if the program runs between Tuesday and Friday in a variant. However, on a Monday, it is supposed to make the from date as the last business date + 1 which could be Saturday and the to date to be Monday. We want to automate to make it display the from and to dates in the variant without having the user to go every day and change the date manually. Again, this is a SAP program and not a Z program. It runs in the evening every day. Suppose it runs tonight (Friday 07/11/08, it will display 07/11/08 in from and to dates). If it ran yesterday and yesterday was not a holiday according to factory calendar then the from and to dates would be 07/10/08. However when it runs on a Monday or on a holiday then the from date have to be the last business date + 1 (Saturday) and to date would be date run (Monday). I tried doing with the help of the selection variable and D (Dynamic date selection), but could not succeed in this case. I tried using Date -xxx, Date + yyyy (Business days) from dynamic date selection, but the from date is not fixed in case of holiday and Monday. For example. Ideally I would want Date - xxx (Business day) + 1 (to make it Saturday) and to date should be current date.