2006 Dec 13 3:51 PM
Hi,
I have range (R_SEQUENCE) like the following
SIGN OPTION LOW HIGH
I BT 01 99
I BT 1A 9Z
I BT A1 Z9
I BT AA ZZ
I am using the following code to check the number is within the range.
wa_hts-htser = '0A'
if wa_hts-htser in r_sequence.
append wa_hts to i_hts.
endif.
Here i am getting sub-subrc eq 0.
Actually it should give sy-subrc ne 0 , can please give some info what i am doing wrong?
Thanks
aRs
2006 Dec 13 3:55 PM
is it like this.....
wa_hts-htser = '0A'
if wa_hts-htser in r_sequence.
IF SY-SUBRC NE 0.
append wa_hts to i_hts.
ENDIF.
endif.
2006 Dec 13 4:00 PM
Hi,
My question is OA number is not in the range . In that case how it is giving me sy-subrc eq 0?
Thanks
aRs
2006 Dec 13 4:03 PM
I think it is considering OA in ur last option i.e AA to ZZ,
OA will be in that range , AA AB AC ..... OA OB OC.......ZA ZB....
2006 Dec 13 4:03 PM
The 'IF' statement doesn't set sy-subrc. It remains as it was before the statement.
Rob
2006 Dec 13 4:01 PM
'0A' is probabily between '01' AND '99'
You have to redefine your range :
SIGN OPTION LOW HIGH
I BT 01 09
I BT 10 9Z
I BT A1 ZZ
I'm not sure of what you want to do, but this may help.
Regards,
Mathieu
2006 Dec 13 4:06 PM
Rob,
Can you please how to check a number is within the range?
Thanks
aRs
2006 Dec 13 4:14 PM
Your original 'IF' statement does that correctly. If it doesn't behave the way you expect, it's probably because you are mixing nunbers and characters. Try to avoid that.
Rob
2006 Dec 13 4:08 PM
Chandra,
The number mentioned here is 0A (it zero A and not OA)
Thanks
aRs
2006 Dec 13 4:12 PM
Correct me, but you are trying to detect 0 ...
FIND '0' IN wa_hts-htser.
If sy-subrc = 0.
....
endif.
Mathieu
2006 Dec 13 4:15 PM
Hi,
'0A' is between '01' and '99'. Therefore SY-SUBRC = 0.
How do you define the range? Is it CHAR02 or NUM02?
Please check this.
REPORT ZZFL_TEST07.
TABLES: FIMSG.
RANGES: R_CHAR FOR FIMSG-MSGPR.
DATA: WA_CHAR LIKE FIMSG-MSGPR.
R_CHAR-SIGN = 'I'.
R_CHAR-OPTION = 'BT'.
R_CHAR-LOW = '01'.
R_CHAR-HIGH = '99'.
APPEND R_CHAR.
WA_CHAR = '0A'.
IF WA_CHAR IN R_CHAR.
WRITE: / 'True'.
ELSE.
WRITE: / 'False'.
ENDIF.Regards,
Ferry Lianto
2006 Dec 13 5:03 PM
Hi,
I have mentioned the field as CHAR 02
I think it is considering 0A within the range of 01 to 99. But in SE11 for that table field i have enterd 01 to 99 it is not given me the values of 0A to 0Z
This looking strange to me.
Thanks
aRs