Automate

 View Only
  • 1.  Delete document/drawing in material master

    Posted 03-05-2019 04:04
    ​​Hi, Could anyone advice on how to delete a document record from the material master in mm02 with Winshutle script?
    I trying to find out how to "fetch" the right document to delete? When pressing the "Find document"-button I am just adding one more document of the same, f.ex. PZ5152 z02 47 instead of selecting the existing document from the table.
    mm02 delete document
    Find document mm02

    ------------------------------
    Sofia Engman | SAP & PLM Specialist
    Atlas Copco Industrial Technique AB
    ------------------------------


  • 2.  RE: Delete document/drawing in material master

    Posted 03-06-2019 09:24
    Hello Sofia,
    One method is to use GUI scripting and the IF on Index functionality. This will allow you to input variables that are normally not selectable on screen. You can select the Type, Document Number, Dpt and version or any combination of those fields to be able to remove the correct document. Another option might be BAPI direct script.

    Derek

    ------------------------------
    Derek Sayres | SAP PLM Business Analyst
    ------------------------------



  • 3.  RE: Delete document/drawing in material master

    Posted 03-07-2019 09:48
    ​There is no way to select the correct document with the SAP functionality.  If the other recommendation does not work, I usually delete all the documents on the material master and then add back the ones I want to keep. 
    To do this use SE16 or other table view t-codes to view DRAD table for document links.  Use multi select to paste in your list of material masters. DOKOB = MARA for MM to document links.  Export your list to a spreadsheet and remove the rows you want to delete.  What you have left are the ones you want to reconnect after deleting all the links.
    Deleting can be done with Winshuttle.  Simply pick one row at a time or an entire page worth to delete until all are gone.
    When adding them back I insert a blank row and enter the new document so as to not overwrite an existing one.  I haven't tried to other method recommended, but it sounds much easier than this method.

    ------------------------------
    Nathan Zahn |
    Spirit Aerosystems |
    ------------------------------



  • 4.  RE: Delete document/drawing in material master

    Posted 03-13-2019 10:26
    ​Thank Derek and Nathan for your answers!
    I haven't used SAP GUI scripting, but I will look in to it.
     Nathan, the method you describe sounds very intresting. I extract an excelfile from our PDM system containing relevant document connected to each material. Only problem here is that I get the latest verson of all documents. Sometimes the latest document is "in work" and not released yet. I guess that I would have to find a way of looping the script to a released lower version in cases when the extracted version of the document isn't released yet? Or make a lookup somehow to fetch the latest version from SAP. But we only have a Transaction license.
    Thanks you again, now I have gotten closer to a solution!
    Kind regards,
    Sofia

    ------------------------------
    Sofia Engman | SAP & PLM Specialist
    Atlas Copco Industrial Technique AB
    ------------------------------



  • 5.  RE: Delete document/drawing in material master

    Posted 03-13-2019 10:58
    Agreed, This can be done using GUI Scripting. 
    If you do not want to use GUI, this can also be done using 2 transaction scripts. Record the first one by using the find "Binoculars", and download that field in one column, then record the second one and add an IF condition to only run if the download matches the document that you are trying to delete. I've used this process before and it works better than GUI as I prefer scripts running in the background.

    ------------------------------
    Isra Azam |
    Exxon Mobil Corporation | [City] |
    ------------------------------