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

help in Where statment

Former Member
0 Likes
734

hi

i doing that where in loop but i have eroor

like

<b>Statement "5" is not defined. Check your spelling. spelling.</b>

but if i do stdaz = '0.5'.

its working o.k.

but <b>i wont LE the 0.5</b>

LOOP AT target_hours_exp ASSIGNING <target_hours_exp> WHERE stdaz <b>le 0.5 .</b> ADD 1 TO cnt_days.

ENDLOOP.

.

Regards

1 ACCEPTED SOLUTION
Read only

varma_narayana
Active Contributor
0 Likes
706

Hi

Check the Correction..

Here the Value 0.5 must be in Single quotes...

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>

<b> WHERE stdaz le '0.5' . </b>

ADD 1 TO cnt_days.

ENDLOOP.

reward if Helpful.

hi

i doing that where in loop but i have eroor

like

<b>Statement "5" is not defined. Check your spelling. spelling.</b>

but if i do stdaz = '0.5'.

its working o.k.

but <b>i wont LE the 0.5</b>

LOOP AT target_hours_exp ASSIGNING <target_hours_exp> WHERE stdaz <b>le 0.5 .</b> ADD 1 TO cnt_days.

ENDLOOP.

.

Regards

4 REPLIES 4
Read only

varma_narayana
Active Contributor
0 Likes
707

Hi

Check the Correction..

Here the Value 0.5 must be in Single quotes...

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>

<b> WHERE stdaz le '0.5' . </b>

ADD 1 TO cnt_days.

ENDLOOP.

reward if Helpful.

Read only

former_member188827
Active Contributor
0 Likes
706

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>.

if <target_hours_exp>-stdaz le 0.5.

ADD 1 TO cnt_days.

endif.

endloop.

use da above logic.it will work

Message was edited by:

abapuser

Read only

Former Member
0 Likes
706

Hi,

try to declare a variable.

data I_stdaz like t550p-stdaz.

i_stdaz = 1 / 2.

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>

<b>WHERE stdaz le i_stdaz</b> .

ADD 1 TO cnt_days.

ENDLOOP.

Regards, Dieter

Read only

Former Member
0 Likes
706

Hi,

When you are validating a condition using ' where' condition be it ay where .

You must enclose a constant value in colons in the where statement.

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>

WHERE stdaz le ' 0.5' .

ADD 1 TO cnt_days.

ENDLOOP.

or

data i1 type p value ' 0.5'.

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>

WHERE stdaz le i1 .

ADD 1 TO cnt_days.

ENDLOOP.

Reward if found use full.

Regards,

Rama Murthy.P