Toidi Diputs,
If you sum data with level 2 in your file, the total value match with BAPI_COSTESTIMATE_GETDETAIL’s total amount.
BAPI_COSTESTIMATE_GETDETAIL’s data is generated using roll up function.
BAPI_COSTESTIMATE_GETEXPLOSION extracts all item data from the highest material to the lowest material.
To reconcile two data, I think you should select data from the result of BAPI_COSTESTIMATE_GETEXPLOSIO using roll up concept.