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: 

Read table with minus operator

Former Member
0 Kudos

Hi folks,

read table it_tab into st_tab with key field1 = st_tab1-field2 - 1.

field1 ,field2 are date fields.

i want one day less than the day.

how to achieve this..

in abap minus(-) is not accepting..

please help me..

Thx

5 REPLIES 5

former_member217544
Active Contributor
0 Kudos

Hi Swetha,

- is very well accepetd by ABAP. Here the issue is with the way you used the operator. try in different way:

st_tab1-field2 = st_tab1-field2 - 1.

read table it_tab into st_tab with key field1 = st_tab1-field2 .

If you dotn want to change st_tab1-field2 then use some other intermediate varible to store st_tab1-field2 - 1 value.

Regards,

Swarna Munukoti

Former Member
0 Kudos

Hi,

if you want to do this in selection screen output. you can do it in initialization event.

After reading table also you can minus dates.

regards,

Venkat.

Former Member
0 Kudos

Dear Shwtha,

defile variable say l_date of type st_tab1-field2

use

l_date = st_tab1-field2 - 1

read table it_tab into st_tab with key field1 = l_date.

Edited by: Sachin Bidkar on Mar 23, 2010 8:10 AM

0 Kudos

Thx solved ..

0 Kudos

Please close the thread as 'RESOLVED'.