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

regading Usig rang values in Parameters

Hi all,

I am working on ranges.

And i want to use values of these ranges in Parameters. i.e Range-low should come by default in P_FROM and Range-high shold come by defalut on P_TO

so frnds can anyone help me how to get it.

Below i m providing my code.

<code>

REPORT ZDEMO_FOR_RANGES_1.

ranges : date1 for sy-datum,

date2 for sy-datum,

date3 for sy-datum.

date1-sign = 'I'.

date1-option = 'BT'.

date1-low = sy-datum + 1. "tommorrows date

date1-high = sy-datum + 60. "60 days later.

APPEND date1.

date2-sign = 'I'.

date2-option = 'BT'.

date2-low = date1-low + 61. "61days after of tomorrow

CALL FUNCTION 'MONTH_PLUS_DETERMINE'

EXPORTING

months = '6'

olddate = date2-low

IMPORTING

NEWDATE = date2-high.

APPEND date2.

read table date1 index 1.

*append lines of date1 to p_from index 1.

parameters : p_from like sy-datum ,

p_to like sy-datum,

p_from_1 like sy-datum,

p_to_1 like sy-datum.

</code>

I have tried in many ways but i m not getting any help frnds.

regards,

satish

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 20, 2008 at 08:30 AM

    Hi Sathish..

    You can try like this..

    parameters : p_from like sy-datum default date2-low ,

    p_to like sy-datum default date1-high,

    p_from_1 like sy-datum,

    p_to_1 like sy-datum.

    I think this is what u want..

    Regards

    Sandeep.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 20, 2008 at 09:41 AM

    Hi Satish,

    If you want to read a range, you need to READ TABLE <range> INDEX x for the range, hence if you need values from date1 and date2, perform READ TABLE on both ranges to get the low and high values in the range header.

    Also, to default the values you can code within the AT SELECTION-SCREEN OUTPUT event like this:

    INITIALIZATION.

    date1-sign = 'I'.

    date1-option = 'BT'.

    date1-low = sy-datum + 1. "tommorrows date

    date1-high = sy-datum + 60. "60 days later.

    APPEND date1.

    date2-sign = 'I'.

    date2-option = 'BT'.

    date2-low = date1-low + 61. "61days after of tomorrow

    CALL FUNCTION 'MONTH_PLUS_DETERMINE'

    EXPORTING

    months = '6'

    olddate = date2-low

    IMPORTING

    NEWDATE = date2-high.

    APPEND date2.

    read table date1 index 1.

    AT SELECTION-SCREEN OUTPUT.

    IF p_from IS INITIAL.

    MOVE date1-low TO p_from.

    ENDIF.

    IF p_to IS INITIAL.

    MOVE date1-high TO p_to.

    ENDIF.

    --- the IF condition is to ensure that the user's entered value in p_from/p_to is not again overwritten by the default.

    Regards,

    Aditya

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 20, 2008 at 10:00 AM

    >

    > Hi all,

    > I am working on ranges.

    >

    > And i want to use values of these ranges in Parameters. i.e Range-low should come by default in P_FROM and Range-high shold come by defalut on P_TO

    > so frnds can anyone help me how to get it.

    >

    > Below i m providing my code.

    >

    >

    > <code>

    >

    > REPORT ZDEMO_FOR_RANGES_1.

    PARAMETERS : p_from TYPE sy-datum,
                             p_to TYPE sy-datum.
    

    >

    > ranges : date1 for sy-datum,

    > date2 for sy-datum,

    > date3 for sy-datum.

    >

    > date1-sign = 'I'.

    > date1-option = 'BT'.

    > date1-low = sy-datum + 1. "tommorrows date

    > date1-high = sy-datum + 60. "60 days later.

    >

    > APPEND date1.

    >

    >

    > date2-sign = 'I'.

    > date2-option = 'BT'.

    > date2-low = date1-low + 61. "61days after of tomorrow

    >

    > CALL FUNCTION 'MONTH_PLUS_DETERMINE'

    > EXPORTING

    > months = '6'

    > olddate = date2-low

    > IMPORTING

    > NEWDATE = date2-high.

    >

    > APPEND date2.

    p_from = range-low. " I'm not sure which range low you are going to assign
    p_to = range-high.
    

    > </code>

    >

    > I have tried in many ways but i m not getting any help frnds.

    >

    > regards,

    > satish

    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.