‎2008 Aug 07 3:40 AM
Hi,
in my loop statment , i am using a where condition.
a variable has numbers and characters , i want to filter the variable using where statement identifying if it is acharacter not to enter into the loop.
any suggestions . Thanks in advance.
regards,
Ry
‎2008 Aug 07 3:56 AM
> a variable has numbers and characters , i want to filter the variable using where statement identifying if it is acharacter not to enter into the loop.
loop at itab where name co '0123456789'.
"catch numbers here..
endloop.
if sy-subrc ne 0.
"all are characters not a single one withnumber
endif.
loop at itab where name co sy-abcde.
"catch characters here..
endloop.
‎2008 Aug 07 3:52 AM
Hi Ry,
Check this sample
LOOP AT gi_vbak WHERE VBELN NA sy-abcde.
WRITE gi_vbak-vbeln. --> your numeric variable logic
ENDLOOP.
‎2008 Aug 07 3:56 AM
> a variable has numbers and characters , i want to filter the variable using where statement identifying if it is acharacter not to enter into the loop.
loop at itab where name co '0123456789'.
"catch numbers here..
endloop.
if sy-subrc ne 0.
"all are characters not a single one withnumber
endif.
loop at itab where name co sy-abcde.
"catch characters here..
endloop.
‎2008 Aug 07 4:01 AM
Hi ,
try like this
data:l_file_data(20) type c,
oref TYPE REF TO cx_root.
data: l_amount type p decimals 2.
l_file_data = '12A3'.
try.
l_amount = l_file_data.
catch cx_root into oref.
endtry.
if oref is not initial.
write: 'Miss Match'.
endif.
regards
Prabhu