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 condtion

Former Member
0 Likes
402

hi

i wont to do this 2 statement i one statement maybe to use And becuse the loop is the same just if statement is deferent how i do that?

regards

*---1 --

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>.

READ TABLE wrk_hr_colct ASSIGNING <wrk_hr_colct>

WITH KEY isdd = <target_hours_exp>-date.

IF sy-subrc = 0.

<b> IF <target_hours_exp>-stdaz = '0.5'

AND <wrk_hr_colct>-ismnw > '0'.

ADD 1 TO cnt_holid_work.

ENDIF.</b>

ENDIF.

ENDLOOP.

*-2-

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>.

READ TABLE wrk_hr_colct ASSIGNING <wrk_hr_colct>

WITH KEY isdd = <target_hours_exp>-date.

IF sy-subrc = 0.

<b> IF <target_hours_exp>-stdaz = '0'

AND <wrk_hr_colct>-ismnw > '0'.

ADD 1 TO cnt_holid_work.

ENDIF.</b>

ENDIF.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
367

Hi

Write like this and see

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>.

READ TABLE wrk_hr_colct ASSIGNING <wrk_hr_colct>

WITH KEY isdd = <target_hours_exp>-date.

IF sy-subrc = 0.

IF<b> ( <target_hours_exp>-stdaz = '0' or <target_hours_exp>-stdaz = '0.5' )</b>AND <wrk_hr_colct>-ismnw > '0'.

ADD 1 TO cnt_holid_work.

ENDIF.

Regards

Anji

ENDIF.

ENDLOOP.

hi

i wont to do this 2 statement i one statement maybe to use And becuse the loop is the same just if statement is deferent how i do that?

regards

*---1 --

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>.

READ TABLE wrk_hr_colct ASSIGNING <wrk_hr_colct>

WITH KEY isdd = <target_hours_exp>-date.

IF sy-subrc = 0.

<b> IF <target_hours_exp>-stdaz = '0.5'

AND <wrk_hr_colct>-ismnw > '0'.

ADD 1 TO cnt_holid_work.

ENDIF.</b>

ENDIF.

ENDLOOP.

*-2-

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>.

READ TABLE wrk_hr_colct ASSIGNING <wrk_hr_colct>

WITH KEY isdd = <target_hours_exp>-date.

IF sy-subrc = 0.

<b> IF <target_hours_exp>-stdaz = '0'

AND <wrk_hr_colct>-ismnw > '0'.

ADD 1 TO cnt_holid_work.

ENDIF.</b>

ENDIF.

ENDLOOP.

1 REPLY 1
Read only

Former Member
0 Likes
368

Hi

Write like this and see

LOOP AT target_hours_exp ASSIGNING <target_hours_exp>.

READ TABLE wrk_hr_colct ASSIGNING <wrk_hr_colct>

WITH KEY isdd = <target_hours_exp>-date.

IF sy-subrc = 0.

IF<b> ( <target_hours_exp>-stdaz = '0' or <target_hours_exp>-stdaz = '0.5' )</b>AND <wrk_hr_colct>-ismnw > '0'.

ADD 1 TO cnt_holid_work.

ENDIF.

Regards

Anji

ENDIF.

ENDLOOP.