on 10-05-2011 11:37 AM
Buenas!
Me gustaría saber cómo puedo recorrer los valores dentro de un rango.
Por ejemplo:
RANGES: rng_f_datos for vbrk-fkdat.
REFRESH rng_f_datos.
rng_f_datos-sign = 'I'.
rng_f_datos-option = 'EQ'.
rng_f_datos-low = fecha_desde.
append rng_f_datos.
rng_f_datos-SIGN = 'I'.
rng_f_datos-option = 'EQ'.
rng_f_datos-high = fecha_hasta.
APPEND rng_f_datos.
Muchas gracias y un saludo
Ola
Usted puede empezar con el codigo desta forma:
RANGES: rng_f_datos for vbrk-fkdat.
REFRESH rng_f_datos.
rng_f_datos-sign = 'I'.
rng_f_datos-option = 'BT'.
rng_f_datos-low = fecha_desde.
rng_f_datos-high = fecha_hasta.
Y despues hacer la ejecucion de Open SQL
SELECT * FROM <tabla> WHERE FKDAT IN rng_f_datos.
Saludos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Carlos,
Gracias por responder.
El problema es que necesito recorrer el rango para ver si cada valor está dentro de otro rango (una tabla interna con 2 campos fecha, uno desde y otro hasta).
Al final lo he hecho con un while:
LOOP AT itab INTO wa_itab.
WHILE fecha_desde <= fecha_hasta.
IF fecha_desde BETWEEN wa_itab-DATAB
AND wa_itab-DATBI.
<hacer algo>
EXIT.
ENDIF.
ADD 1 TO fecha_desde.
ENDWHILE.
ENDLOOP.
Un saludo,
John
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.