Check if the order of the segments matches with the example below and also as Aeda wrote, check if you are not appending instead of inserting:
.
.
.
<E1EDP01 SEGMENT="1">
<POSEX></POSEX>
<MENGE></MENGE>
<MENEE></MENEE>
<BMNG2></BMNG2>
<PMENE></PMENE>
<VPREI></VPREI>
<PEINH></PEINH>
<NETWR></NETWR>
<CURCY></CURCY>
<E1EDP02 SEGMENT="1">
<E1EDP03 SEGMENT="1">
<E1EDP03 SEGMENT="1">
<E1EDP05 SEGMENT="1">
<E1EDP20 SEGMENT="1">
<E1EDP19 SEGMENT="1">
</E1EDP01>
.
.
.
Regards,
Felipe