Skip to Content
0
Sep 10, 2007 at 06:53 PM

Data Manipulation in internal table

25 Views

Hi experts,

i am looping at an item internal table i_vbrp. inside the loop i am getting 2 individual values, which i am appending to a final table i_finaltable. but in between i have to distribute the 2nd value to all line items based on 1st value in percentages and should be assigned to a 3rd value. and these split values should be appended to each line item. the code and example values look like this.

loop at i_vbrp.
 
 read table i_konv...
    
 i_finaltable-netwr = konv-kwert.  value 1  1000 (A)
                                           2000 (B)   for each line item
                                           3000 (C)  when looping
 read table i_bseg....
 
i_finaltable-wskto = i_bseg-wskto. value 2 ,300 fixed for a unique VBELN
 
endloop.

The value 300 should be distributed to each line item based on percentages.

value 1         value 2           value 3
1000             300             (1000/(1000+2000+3000)) * 300 
2000             300             (2000/(1000+2000+3000)) * 300
3000             300             (3000/(1000+2000+3000)) * 300

i should get the values like above in the final table, any suggestions will be awarded. Thanks in advance.

Thanks & Regards,

Poorna.