‎2007 Sep 20 8:41 PM
I have an internal table of such structure
VB , VC , VALUE - Fields
a , a1 , 1
a , a2 , 3
a , a3 , 2
b , b1 , 1
b , b2 , 2
b , b3 ,0
b , b4 ,1
I need to loop and somehow check that if that field value against any one of the VC corresponding to one VB is 0, then i need to check if all the other values for that same VB are 0 or not.if even for a single VB not all values are 0 i need to throw an error message.I need to check this for all VBs in the table.
The requirement is that if for one VB any value is zero all values for that VB should be zero or else all should be non zero.
for example, here above since the 3rd value entry against VB = B is 0 and other are non zero i need to throw an error. no error for VB = A since all are non zero. How do I go about processing this internal table. Immediate help would be appreciated.
‎2007 Sep 20 8:56 PM
Hint for you
loop at itab.
read table itab with key VC = '0'
VB= itab-VC.
if sy-subrc eq 0.
endif
endloop.
‎2007 Sep 20 9:03 PM
Hi Aditi
Assume the below mentioned values are in itab1.
take a copy to itab2 and itab3.
in itab2.
delete itab2 where value = '0'.
in itab3 delete itab2 where valuen ne = '0'.
loop at itab2.
read table itab3 with key vb = itab2-vb.
if sy-subrc = 0.
*Means there is value other zero
error message
endif.
endif.
endloop.
Let me know, whether it works
Regards
MD
‎2007 Sep 26 4:59 AM