Hello everyone,
I have this weird problem where after creating a return sales order (RE2) and returning it to the supplier, a Return Purchase Order(NB2) is automatically created as a follow-up document. All good untill here, but I noticed that in table MSR_D_EXECUTED after an invoice is created in t-code MIRO, the entries are saved differently between the development and test system:

In the dev system the sales order has document type 0(Sales Order) as it should but in the test system, both the Sales Order and Purchase Order have the same document type, 2(Returns Purchase Order):


Any idea where should I look to solve this problem? Is it customizing, enhancements or something else?
Thank you!