Application Development and Automation 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: 
Read only

sub from sy-datum

Karan_Chopra_
Active Participant
0 Likes
1,231

how do i subtract 5 dates from sy-date

i wanna select data from int table with date not less than 5 previous dates

how do i subtract 5 dates from sy-date

i wanna select data from int table with date not less than 5 previous dates

2 REPLIES 2
Read only

Former Member
0 Likes
599

Just do


data : predate type sy-datum.
predate = sy-datum - 5.

select * from table into itab where date > predate.

Pls reward if helpful.

Message was edited by:

Shori

Read only

Former Member
0 Likes
599

hi Karan,

Try the following...

DATA: lv_date TYPE datum.

lv_date = sy-datum.

SUBTRACT 5 FROM lv_date.

WRITE:/ sy-datum, lv_date.

LOOP AT itab WHERE date GE lv_date.

ENDLOOP.

Hope this helps.

Cheers

A.