‎2008 Feb 04 8:06 AM
hi all,
i have a internal table which i have to read. or even loop at the table would be fine.
I have a field name whose value 'abc'
but in my internal table the same field name with value as 'abc def '
but both these values correspond to the same object.
read table tab1 where fieldname = value doesn't work here. because the value isnt exactly the same.
how do i perform this operation?
Please help me.
‎2008 Feb 04 8:09 AM
Hi,
Do like this
Loop at itab into wa.
if wa-field1+0(3) = 'abc'.
......
endif.
.....
endloop.
Regards,
Satish
‎2008 Feb 04 8:13 AM
Hi
Offset doesn't help here.
My internal table has a value of 'abc def'
but what i need to compare that has a value 'abc'
my code goes like this :
" loop at itab into wa
where fieldname = l_fieldname . "
in this context fieldname = abcdef
and l_fieldname = abc.
can you now tell me how to proceed ?
‎2008 Feb 04 8:17 AM
Hi,
As i told you do like this, it will work
Loop at itab into wa.
if wa-field1+0(3) = l_fieldname.
... proceed.
else.
continue.
endif.
endloop.
or in if statement do like this
if wa-field1 CS l_fieldname.
proceed...
endif.
Regards,
Satish
Edited by: Satish Panakala on Feb 4, 2008 8:18 AM
‎2008 Feb 04 8:44 AM
Hi Sathish
loop at table wher wa-fieldname CS fieldname worked !
thanks a lot for your help.
‎2008 Feb 04 8:21 AM
Hi,
Please check the below code...
loop at itab into wa.
v_var = wa-field1(3).
loop at itab into wa1.
v_var1 = wa1-field1(3).
if v_var = v_var1.
do your logic what you want.
endif.
endloop.
endloop.
Rgds,
Bujji