2009 Sep 12 4:48 AM
hi all,
LOOP AT it_objk INTO wa_objk .
CHECK wa_objk-sernr+2(1) NE 'S'.
IF wa_objk-sernr+2(1) = 1 .
m1 = m1 + wa_objk-zzpmax.
m11 = m11 + 1.
MODIFY it_objk FROM wa_objk.
.
.
.
..
ENDLOOP.
I am checking this stmt. if 3rd charcter is "S". Come out of loop.
I want to check at a time if 3rd charcter is any alphabets or sysmbols. should come out of loop.
it should accept only numbers.
2009 Sep 12 5:03 AM
Hi,
Try this,
LOOP AT it_objk INTO wa_objk .
CHECK wa_objk-sernr+2(1) CO '0123456789'.
IF wa_objk-sernr+2(1) = 1 .
m1 = m1 + wa_objk-zzpmax.
m11 = m11 + 1.
MODIFY it_objk FROM wa_objk.
.
.
.
..
ENDLOOP.
Make sure sernr is defined as type string
Regards,
Vikranth
hi all,
LOOP AT it_objk INTO wa_objk .
CHECK wa_objk-sernr+2(1) NE 'S'.
IF wa_objk-sernr+2(1) = 1 .
m1 = m1 + wa_objk-zzpmax.
m11 = m11 + 1.
MODIFY it_objk FROM wa_objk.
.
.
.
..
ENDLOOP.
I am checking this stmt. if 3rd charcter is "S". Come out of loop.
I want to check at a time if 3rd charcter is any alphabets or sysmbols. should come out of loop.
it should accept only numbers.
2009 Sep 12 5:00 AM
hai sudhir then waht is th eproblem
write the condition in check statement if it is satisfied it goes else comes out of the loop for that iteration
if u want to come complete out of loop then use if statement and if the condtion is not satisfied exit then it will come out of loop completely
m.a
2009 Sep 12 5:03 AM
Hi,
Try this,
LOOP AT it_objk INTO wa_objk .
CHECK wa_objk-sernr+2(1) CO '0123456789'.
IF wa_objk-sernr+2(1) = 1 .
m1 = m1 + wa_objk-zzpmax.
m11 = m11 + 1.
MODIFY it_objk FROM wa_objk.
.
.
.
..
ENDLOOP.
Make sure sernr is defined as type string
Regards,
Vikranth
2009 Sep 12 5:04 AM
Hi, Gsudhir
Please check the following Sample Code hope will help you to solve out your problem,
TYPES: BEGIN OF ty,
char(10),
END OF ty.
DATA: it TYPE STANDARD TABLE OF ty WITH HEADER LINE.
it-char = 'AS2F123456'. APPEND it.
it-char = 'AS$F123456'. APPEND it.
it-char = 'ASDF123456'. APPEND it.
LOOP AT it.
IF it-char+2(1) CA 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+'. " You can add here any more Special Char
EXIT.
ENDIF.
WRITE: it-char.
ENDLOOP.Please reply if any issue,
Faisal
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |