Many thanks Smruti. With your suggestions I'm finally able to delete and insert new line items. But in li_return table of BAPI returns warning and Net Value and values in Configuration are empty (refer to the screen shot).
Any idea how to populate them? Also I'm thinking is not possible to copy all the data before deleting a line item and how pass pass it to new line item. This way I will get all the value I need and MATNR will be changed too. All this effort I'm doing is just because I need to update MATNR at line item.
Many thanks in advance.