Skip to Content
author's profile photo Former Member
Former Member

Date range for a variable from number of days enterd

Hi frnds,

I have a requirement like ,

Number of Days should be enterd in the Selection screen ,

If user enters 10 Days in selection screen, then it should bring the records like date from = sy date and date to = ( the date after ten days from today ) for a characteristic( validity ) which holds the dates ,

i believe that i can create one formula variable to enter the number of days and how do i relate this with the other variable in the char ( validity ) ,

Could you please guide and sample code would be a great help ,

thanks ,

sathy

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 10:42 AM

    Hello

    Create a user input variable for getting no. of days in it

    Create a customer exit and do following coding in cmod

    WHEN 'CUST EXIT VAR NAME'.

    v_beg = sy-datum.

    CLEAR l_var_range.

    READ TABLE i_t_var_range INTO l_var_range

    WITH KEY vnam = 'user input variable'.

    v_end = v_beg + l_var_range-low.

    l_range-sign = I.

    l_range-opt = 'BT'.

    l_range-low = l_sales_beg.

    l_range-high = l_sales_end.

    APPEND l_range TO e_t_range.

    Thanks

    Tripple k

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 10:30 AM

    Sathya,

    Here you can go for another formula variable with processing type customet exit where you will be reading the days entered by the user(other variable with user input) and then populate the from date as sys date and to date as 10 plus. This should be a better solution.

    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.