Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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.

Thanks

Ram

4 REPLIES 4

Former Member
0 Kudos

Hello Ram,

This is just a hint...you can create a Z-BDC program, and program the dates as you need, and finally call the standard program you need with the parameters you have explained.

Hope this helps

Gabriel P.-

Former Member
0 Kudos

Hi Gabriel,

Thanks for the answer. Actually I meant without having to create a Z program, by just playing with the Dynamic Date calculation in the variant. I was able to do most of the date calculation by doing the Dynamic Date Calculation, except this one. Any ideas?

Thanks

Ram

Former Member
0 Kudos

Hi,

Did you try using the the selection variable "Date - xxx, Date + yyy (work days)"?

Thanks

Naren

Former Member
0 Kudos

Hi Naren,

I used the Date -xxx, Date + yyy (work days), but Date - xxx is a fixed number I have to enter which will not work in my case. Suppose I am on a Monday, ( - 2 which is a Saturday would work, but if I am on a Tuesday, the from date should be the current date. Secondly if Friday was a holiday, then the from date for the Monday run should be Friday which would be Date -xxx (3) and the to date would be current date. Ideally I would like a from date to be

Date -xxx (work days) + 1 and the to date to be

Current date.

Thanks

Ram