01-13-2009 7:02 PM
Hi,
I have selection options for field as defined as TIME . I need to set dynamic variant for this field as
TIME should be "from"='current time-30 minutes' and "to"='24:59:59'.
This report going to run in 00 hours and 30 hours (48 times ie 24 X 2)
PS : Pl. remember this is for a SAP standard report
Any Info?
a®
01-13-2009 8:29 PM
I guess it would not be possible with standard avaliable options to dynamically populate both time fields.
There is a underlying FM behind all the dynamic calculations in Variants.
Like:
For calculation (of Time - Type Z) "From Start of Day to Now", underlying FM is RS_VARI_V_TIME_00_UP_TO_NOW.
I digged more deeper and found one FM RS_VARI_V_INIT_TIME which fill the options like Current Time, Current Time +/- ???, From Start of Day to Now etc. and Surprisinly all 3 options are hardcoded in it..!!
So, if you modify this FM to include your FM with Custom Calculation than this option would come into the calculation options and would work when you select that variant. I have tried this in debugging and it is working..!! For this test, I copied FM RS_VARI_V_TIME_00_UP_TO_NOW to my Z and changed the logic. I put a break-point in RS_VARI_V_INIT_TIME to fill a new line with my Z FM.
Regards,
Naimesh Patel
01-13-2009 7:06 PM
01-13-2009 7:13 PM
Rich,
Thanks for your reply. Your suggestion will work if program is scheduled as standalone My problem is this program is called inside another program , before submitting the program , they are reading variant values.
Say for example
A is my program. it has been called in B , before calling A in B , they used RS_VARIANT_READ, so here it is getting failed.
I am working PI 7.1 system.
a®
01-13-2009 7:11 PM
Use Dynamic Time Calculation in the Variant.
In the Variant maintenance screen, under the
Selection Variable: select Z - Dynamic Time Calculation
Name of Variable:
Select "Current Time +/- ??? " from F4
Enter
'-' in +/-
00 in HH
30 in MM
Regards,
Naimesh Patel
01-13-2009 7:14 PM
Naimesh,
As per your suggestion, system is setting the value only LOW and HIGH is blank.
a®
01-13-2009 7:47 PM
There is something I don't understand.
You can't change program B ?
Could you show abap code of program B, how does it call A ?
01-13-2009 7:14 PM
01-13-2009 8:29 PM
I guess it would not be possible with standard avaliable options to dynamically populate both time fields.
There is a underlying FM behind all the dynamic calculations in Variants.
Like:
For calculation (of Time - Type Z) "From Start of Day to Now", underlying FM is RS_VARI_V_TIME_00_UP_TO_NOW.
I digged more deeper and found one FM RS_VARI_V_INIT_TIME which fill the options like Current Time, Current Time +/- ???, From Start of Day to Now etc. and Surprisinly all 3 options are hardcoded in it..!!
So, if you modify this FM to include your FM with Custom Calculation than this option would come into the calculation options and would work when you select that variant. I have tried this in debugging and it is working..!! For this test, I copied FM RS_VARI_V_TIME_00_UP_TO_NOW to my Z and changed the logic. I put a break-point in RS_VARI_V_INIT_TIME to fill a new line with my Z FM.
Regards,
Naimesh Patel
01-13-2009 8:40 PM
> I digged more deeper and found one FM RS_VARI_V_INIT_TIME which fill the options like Current Time, Current Time +/- ???, From Start of Day to Now etc. and Surprisinly all 3 options are hardcoded in it..!!
As you suggested due to hardcoded values here , we could not able to do much on this.
So i came in round away solution. Whenever program A called ( program with TIME selection input) i have called another custom program C . (This custom program will using the following function module RS_VARIANT_CONTENTS, and RS_VARIANT_CHANGE , So get the DEFAULT variant content of program A and change the variant content with LOW as current time - 30 and HIGH with 24:59:59) as preceding job.
In PI 7.01 system program A always called in JOB mode
Thanks for info.
a®
01-13-2009 8:49 PM