Good day Nicolas,
Which message type is it linked to to the idoc type?
Check on WE57 the message type, object type & idoc type.
You will see the function module used to process the idoc inside the function module you find a BADI that you can use to change the segment..
For e.g. on WE57 there is an entry below:
FM - IDOC_INPUT_SUS_ORDRSP
IDOC type : ORDERS05
Message type: ORDRSP (Order Response)
Object type: BUS2012
Inside FM there is a Enhancement sport : ES_BADI_ME_EDI, badi - ME_MMPUR_EINM_CUST.
Inside the BAPi there is an example class you use CL_EXM_IM_ME_MMPUR_EINM_CUST to see how you can change the value on the segment.
Regards,
Tumelo Modise