Skip to Content

Set dynamic variant for time

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jan 13, 2009 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 13, 2009 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 13, 2009 at 07:06 PM

    Create a wrapper program which calculates the specific time, then do a SUBMIT on the standard report and pass the parameters to that program.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • 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.

  • Posted on Jan 13, 2009 at 07:14 PM

    Deleted

    Edited by: Sandeep Kadamb on Jan 13, 2009 8:16 PM

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.