‎2006 Oct 30 3:41 PM
Hi,
I am new to SDN..
I have a requirement to save a varient to run a Program in background. The selection screen has a date field set as sy-datum. However due to some business changes the program should pick up data for the previous date, a day before the sy-datum field. When i save the varient is it possible to do this..
Thanks,
Shreekant.
‎2006 Oct 30 3:47 PM
Yes, it is. First, run the program, click the save button, now you are at the variant screen. For the certain field, mark the check box for "Selection Variable". Then click the selection variables button on the app toolbar . Click the icon in the column defined as "D", for dynamic data calc. the icon should now be green, now click the down arrow under the "T" column. From the dialog, select the line for "Current Date +/- ??? Days". Click choose. Enter -1 and click green check. CLick save, then save again. Now choose your variant from the variant dialog, notice that the date field is now set to yesterday.
Regards,
Rich Heilman
‎2006 Oct 30 3:43 PM
Hi,
Yes . Just write the logic in the AT SELECTION SCREEN event and you will be able to manipulate the date accordingly.
or you could just write it in the program itself.
Suppose p_date is your date parameter
p_date = p_date - 1.
‎2006 Oct 30 3:45 PM
Thanks,
I dont want to change the program.
Its already in PRD, I am trying to fix it without changing the program.
Shreekant
‎2006 Oct 30 3:44 PM
it's not possible, change the program to take previous date in selection screen and save it as variant.
‎2006 Oct 30 3:45 PM
Hi Shreekanth,
Check if you can specify a variable using Selection Variables in the variant attributes.
Check this link:
http://help.sap.com/saphelp_47x200/helpdata/en/c0/980398e58611d194cc00a0c94260a5/frameset.htm
Regards,
ravi
Message was edited by: Ravi Kanth Talagana
‎2006 Oct 30 3:45 PM
hi Shreekanth,
You can do that ..
There is a function for substract time from a date, days, months, year
use FM <b>SUBTRACT_TIME_FROM_DATE</b>
REgards,
Santosh
‎2006 Oct 30 3:47 PM
Hi shree,
It is possible to set the predefined value to Date Field using the Dynamic Variant by maintaining the values to the Date fields in the Variant Attributes.
Thanks,
Satya
‎2006 Oct 30 3:47 PM
Yes, it is. First, run the program, click the save button, now you are at the variant screen. For the certain field, mark the check box for "Selection Variable". Then click the selection variables button on the app toolbar . Click the icon in the column defined as "D", for dynamic data calc. the icon should now be green, now click the down arrow under the "T" column. From the dialog, select the line for "Current Date +/- ??? Days". Click choose. Enter -1 and click green check. CLick save, then save again. Now choose your variant from the variant dialog, notice that the date field is now set to yesterday.
Regards,
Rich Heilman
‎2006 Oct 30 3:55 PM
Thanks Rich,
But I am a bit confused, in ur answer..
"For the certain field, mark the check box for "Selection Variable". where do i find this..
Shreekant
‎2006 Oct 30 3:58 PM
In the variant screen, where you are defining your variant, there should be a list of your selection-screen fields at the bottom, notice all of the checkboxes? Well here you need to check the box in the "L" column for your field. This tells the variant to allow a selection variable here.
Regards,
Rich Heilman
‎2006 Oct 30 4:12 PM
Thanks Rich..
Got everything done. But how would I test it without actually excuting the program in back ground.
I executed the program in SE38 and the selection screen shows the sy-datum.
Thanks again for your help.
Shreekant.
‎2006 Oct 30 4:14 PM
‎2006 Oct 30 4:22 PM
‎2006 Oct 30 3:47 PM
Hi,
Sorry about that..
regds
dominic
Message was edited by: Dominic Pappaly