Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

range of period

Former Member
0 Kudos

hallow

i get from user period like beg_date 012007 and end_date 122007 and i wont to build range table for between this period how i can do that ?

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

declare a range like

ranges: r_date for s021-spmon. (declare as per your data type for the date)

in initialization event write.

r_date-low = '012007'. (enter the required lower range of value)

r_date-sign = 'I'.

r_date-option = 'BT'.

r_date-high = '122007'.

append r_date.

now use the r_date field in the program code.

Regards

Anji

3 REPLIES 3

former_member156446
Active Contributor
0 Kudos

*Range for plants <<<<< change it to date format

MOVE 'I' TO ra_werks-sign.

MOVE 'EQ' TO ra_werks-option.

MOVE beg_date TO ra_werks-low. <<<<<

APPEND ra_werks.

  • CLEAR ra_werks.

MOVE end_date TO ra_werks-low. <<<<<<

APPEND ra_werks.

CLEAR ra_werks.

Former Member
0 Kudos

Hi

declare a range like

ranges: r_date for s021-spmon. (declare as per your data type for the date)

in initialization event write.

r_date-low = '012007'. (enter the required lower range of value)

r_date-sign = 'I'.

r_date-option = 'BT'.

r_date-high = '122007'.

append r_date.

now use the r_date field in the program code.

Regards

Anji

Former Member
0 Kudos

Hi,

DATA beg LIKE SY-DATUM.

DATA end LIKE SY-DATUM.

beg+0(3) = '01/'.

beg3(2) = beg_date0(2).

beg+5(1) = '/'.

beg6(4) = 'beg_date2(4).

end+0(3) = '01/'.

beg+5(1) = '/'.

beg6(4) = 'beg_date2(4).

then use FM MONTH_PLUS_DETERMINE to increase the month by 1.

assign this month to end+3(2).

subtract 1 form end, that will be the last date of the previous month.

then use between operator. u don't need to use range.

Reward if useful

Regards

ANUPAM