cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete several contact persons using LSMW recording for XD02?

Former Member
0 Kudos

Dear colleagues,

I need to know how to set up my LSMW in order to delete several contact persons for a customer when using XD02.

I've done the recording part(the radio button which deletes the contact persons is missing) using the option from the general menu but the thing is that the recording is deleting only the contact persons which I've selected with the mouse cursor.

For example, if the customer has four contact persons: 1, 2, 3, 4. How can I delete only persons 2 and 4 with the help of LSMW?

Another customer can have let's say three contact persons: 1, 2, 3 and I need to delete persons 1 and 3. How can I do that?


Thank you in advance for your answer!

Alex

Accepted Solutions (1)

Accepted Solutions (1)

JL23
Active Contributor
0 Kudos

Recordings are not flexible, so you cannot do 1 recording which is supposed to delete 2 contacts in on customer master and 4 contacts in another customer master.

To use a recording you have to ensure that it is the same process for any customer, this means you delete only 1 contact per customer and transaction.

If you have to delete 2 contacts then you do XD02 for this customer 2 times.

For a recording it means you only record the deletion of one contact.

As you already noticed, there is no chance to select certain lines, hence you have to use a little trick: you always only delete the first line.

And to get the right record to the first line you have to use the name field at the bottom of the screen. Here you enter the exact name like it is visible in the name of the desired contact and hit enter. You place the cursor into the first line and select from menu Edit > Delete line

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Jurgen,

Thank you very much for the information.

Can you recommend another solution for my request, which really works?

JL23
Active Contributor
0 Kudos

Actually I think the given way works, except your contacts share all the same name and function.

We developed actually our own ABAP using a class to do this, for creating, changing and deletion. Here is a blog about this https://blogs.sap.com/2017/02/17/how-to-createupdate-a-contact-personboth-mobile-telephone-of-a-cust...

Our program has about 3150 lines with all kind of checks and an Excel based user interface

Former Member
0 Kudos

I'm sure it works, but we are talking about 4000 contact persons and I think the LSMW will not be suitable for my purpose.

The ABAP solution looks promising but I'm looking for a functional solution.

I've tried the FM ISAI_CONTACT_DELETE but I could only delete one contact person at a time for a single customer. The advantage of this function is that I can specify the PARNR of the contact person which I want to delete. But how I can specify several PARNR for several customers to be deleted?

Former Member
0 Kudos

I chose to solve this task in two steps: first I'll create the LSMW according to your instructions Jurgen and for the contacts which share the same name I will either execute the LSWM again or use the FM ISAI_CONTACT_DELETE.

Thank you very much for your support and I wish you a nice weekend!