Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Replace and create customer partner function with LSMW

0 Likes
5,118

Hello Guys,

can you please help me with the following problem?

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?

Thanks,

Claudiu 🙂

1 ACCEPTED SOLUTION
Read only

JL23
Active Contributor
2,663

Not easy but possible using LSMW with DEBMAS Idoc as import method.

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

5 REPLIES 5
Read only

Lakshmipathi
SAP Champion
SAP Champion
0 Likes
2,663

Have you tried via MASS ?

Read only

0 Likes
2,663

it's a long process with mass because i have 27 Divisions and 60 EM partner number.

Thanks

Claudiu

Read only

JL23
Active Contributor
2,664

Not easy but possible using LSMW with DEBMAS Idoc as import method.

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

Read only

0 Likes
2,663

I’m not that good with the coding part, if you can help me with some indication on how to do that?

Thanks,

Claudiu

Read only

JL23
Active Contributor
0 Likes
2,662

Have a look into my blog https://blogs.sap.com/2012/12/27/lsmw-material-master-by-bapi-method-part-2/

which explains the structure of LSMW and has a some coding examples for a simple requirement.

I can also give you this screenshot from customer master partner role where I create several roles (with the same partner) just based on a single information from the source file: