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

Read table with minus operator

Former Member
0 Likes
914

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
Read only

former_member217544
Active Contributor
0 Likes
864

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

Read only

Former Member
0 Likes
864

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.

Read only

Former Member
0 Likes
864

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

Read only

0 Likes
864

Thx solved ..

Read only

0 Likes
864

Please close the thread as 'RESOLVED'.