2011 Jun 27 6:07 AM
Hi ABAPers,
Neep Help.
REFRESH: i_zxxx.
n = 1.
DO n TIMES.
SELECT *
FROM zxxx
INTO TABLE i_zxxx
WHERE werks in s_site
AND datum eq s_date-low
AND status eq 'C'.
IF i_zxxx is INITIAL.
n = 1.
s_date-low = s_date-low - 1.
ENDIF.
ENDDO.In the above code I am expexting the do endo loop to run again when i_zxxx is intial by setting n = 1.
kindly help me change the logic to obtain the same.
Regards,
--Dep
2011 Jun 27 6:12 AM
Hi,
this is a single loop because n = 1 at start of the do ... enddo loop.
For your needs you should use a DO without n times and leave it, when sy-subrc eq 0 or date has a special value with EXIT.
Regards,
Klaus
Hi,
this is a single loop because n = 1 at start of the do ... enddo loop.
For your needs you should use a DO without n times and leave it, when sy-subrc eq 0 or date has a special value with EXIT.
Regards,
Klaus
2011 Jun 27 6:12 AM
Hi,
this is a single loop because n = 1 at start of the do ... enddo loop.
For your needs you should use a DO without n times and leave it, when sy-subrc eq 0 or date has a special value with EXIT.
Regards,
Klaus
2011 Jun 27 6:17 AM
Thank You Klaus for your quick answer. Resolved the issue.
Regards,
Dep
2011 Jun 27 6:21 AM
Hi ,
use this:
REFRESH: i_zxxx.
n = '1'.
while n = '1'.
SELECT *
FROM zxxx
INTO TABLE i_zxxx
WHERE werks in s_site
AND datum eq s_date-low
AND status eq 'C'.
IF i_zxxx is INITIAL.
n = 1.
s_date-low = s_date-low - 1.
else .
clear n.
ENDIF.
ENDWHILE.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |