Replace and create customer partner function with LSMW

i have to update 10k customers partner function on different divisions. i must change from SR partner function to EM that i received. From what I've checked every customer have already 4 or 5 partner function present:

- some of the clients have already the EM partner (on the second or third line )and it must be changed with the new one.

-Some of them have SR(on the third or fourth line ). The SR partner must be deleted and insert the EM partner.

- And other clients that don't have neither SR or EM, and i must add the EM partner.

Is there any ABAP statement or something else that i can use to make this done?

In general needs your source file just the the customer number with sales org, distr.channel and division

You need to know that you always have to submit all roles that you want to have in your customer master at the end.

In the field mapping at E1KNVPM segment you add your ABAP coding at the transfer record statement to read the data from KNVP table based on the keys given in your source file and move it corresponding to the target fields. With a if-statement you just check directly what partner role you are currently processing and based on the result you exchange the role in the target field. After this your do the TRANSFER_RECORD and continue with the next record from your read of KNVP and do the same until you are done for this customer and sales area