Deleting several documents in idoc script

Hello,
I need some help about one of my customization.
I would like to create a page on which a user would choose a website
section and then after choosing it, all the documents of this website
section would be deleted.
So, in idoc script, I created a service called "DELETE_DOC_SCRIPTABLE"
which is the same as "DELETE_DOC" but it is scriptable.
I also created a service which retrieves all the documents and then I
loop on the resultset generated and I call the service
"DELETE_DOC_SCRIPTABLE".
My first results is then deleted but then, after the first loop, UCM
doesn't recognize my resultset anymore and so the other results are
not deleted.
Here is my code :
<$loopwhile getValue("RST_DOCS_SECTION_A_SUPPRIMER","#isRowPresent")$>
<$dID=RST_DOCS_SECTION_A_SUPPRIMER.dID$>
<$executeService("DELETE_DOC_SCRIPTABLE")$>
<$exec rsNext("RST_DOCS_SECTION_A_SUPPRIMER")$>
<$endloop$>
Here is my error in etc/log file
"suppression_contenus
/produits/ucmIntra/dev/custom/GestionSectionsSite/resources/gestionsectionssite_\
ressources_supprimerContenus.htm
[ligne 23, car 7]
An error occured in the file
'/produits/ucmIntra/dev/custom/GestionSectionsSite/resources/gestionsectionssite\
_ressources_supprimerContenus.htm'
q la ligne 98 et au caractre 10. Unable to evaluate the function
'rsNext'. Unable to find result set 'RST_DOCS_SECTION_A_SUPPRIMER'.
-> <$exec rsNext("RST_DOCS_SECTION_A_SUPPRIMER")$>
-> <$endloop$>
-> </table>
Thank you in advance if you have any clue about this,
Regards,
Julian

I`ve gotten a little bit closer by hacking at the code..
          <$rsMakeFromString( "rsDeleteDocsBydID", xdID, "dIDstored")$>
          <$numFields = rsNumRows("rsDeleteDocsBydID")$>
          <!-- numFields == <$numFields$> -->
          <!-- To Delete = <$dIDstored$> -->     
          [[%This Works when uncommented %]]
          <!--$dID = dIDstored$-->
          <!--$executeService("ETHER_DELETE_DOC")$-->
          [[%This does not execute the service again? - But returns dIDs correctly??%]]
          <$xnumFields = 0$>
          <$loopwhile xnumFields < numFields $>
               [[%Recreate RS as Delete_doc service clears all RS?%]]
               <$rsMakeFromString( "rsDeleteDocsBydID", xdID, "dIDstored")$>
               <$exec rsSetRow("rsDeleteDocsBydID",xnumFields)$>
               <$dID = dIDstored$>
               <!-- Delete this dID = <$dID$> -->
               <$executeService("ETHER_DELETE_DOC")$>
               <$xnumFields =(xnumFields +1)$>
          <$endloop$>
I may look at using the subservice DELETE_BYNAME anyone tried using this instead?
Thanks

Similar Messages

  • Delete several documents from TR OAAD

    Hi,
    I would like delete several billing documents archived through Archivelink.
    From TR OAAD, technical search I display all documents that I want delete. If I select all and delete it, for every items I get many pop-up.
    Is possible to delete several document in a fast method?
    Thanks.

    Exactly the same problem here.   Help!

  • Delete parked document with IDOC related

    *Hi Friends*
    *I have a case with FI parked document and there's a related IDOC, user try to delete parked document but get authorization not acceptable outside workflow.*
    *i have checked the IDOC and found that the work log is empty with 0000000 values*
    *No work item.*
    *so i couldn't change idoc status to WFER to allow user delete related document*
    *any advice on how to delete that parked document.*
    *many thanks*
    *Hana*

    HI,
    I am not aware of any program or tcode to delete idocs in sap.  However, idocs can be archived depending on the idoc status.
    The configuration is in transaction code WE47.
    - Check the idoc status in WE47  to see if the idoc can be archived.
    - We need to run archive program to archive the existing idoc. 
    Thanks,
    Ram

  • Really having problems with organising documents in pages. For example, deleting pages deletes the whole section and I cannot insert a section break as its greyed out & sending an object to background deletes several pages - what the **** is going on???

    Really having problems with organising documents in pages. For example, deleting pages deletes the whole section and I cannot insert a section break as its greyed out & sending an object to background deletes several pages and trying to insert a text box autmatically creates new pages- what the **** is going on??? Is this programme really this badly thought out? I thought everything apple was supposed to be intuitive!?!?!? Help.

    You can not insert a section break into a textbox.
    You appear to have a lot of objects with wrap set, that once you take them out of the flow of text (by sending them to the background) causes the text to reflow and contract into fewer pages. Pages is almost unique in the way it forms up pages in Word Processing mode only so long as there is text on them.
    I suspect you probably have hammered away at returns, spaces and tabs as well to position things, which only works to add to the mess.
    Download the Pages09_UserGuide.pdf available under the Help menu and swot up a bit on how it works.
    You may find this a usueful resource as well:
    http://www.freeforum101.com/iworktipsntrick/
    Peter
    PS There is quite a lot of programming in OSX that is far from "intuitive". Pages is easy at one level, when using the templates, otherwise it can be quite frustrating.

  • How do I delete multiple documents at the same time

    How do I delete several or multiple documents at the same time.  Do I have to delete each one individully?

    You can select multiple adjacent files or folders by clicking on the first one then shift-click on the last one.  Multiple non-adjacent files or folders can be selected one at a time by command clicking on each one.  Click on any selected file or folder then drag/drop to trash.

  • Can you create a new folder and put several documents in it in Adobe?

    Can you create a new folder and put several documents in it in Adobe?

    Thank you for your help. Now I just want to expand on this a bit. To use the Applescript you have supplied me, how do I tell it to name the folder other than by date, and where to put it?
    Let me say, preferably, is it possible to make an action like this right-clickable? Instead of having to pick a script. Anything that slows this process down means I might as well do it all by hand. What I'd really love to do is this:
    Select a number of items. Right click to an action saying "create a new folder and put this items in it. Name the folder with the first item's name". Very simple and quick.
    Could this be accomplished? Through Automator? or something that can appear in the contextual menu? Folder actions?
    I'm just getting started with using these tools.

  • Calling GET_WORKFLOW_INFO_BYNAME service from idoc script

    Hi, i need to call service GET_WORKFLOW_INFO_BYNAME in custom idoc script on documents to determine if the document is in workflow. If it is there is no problem. But if it is not, calling if GET_WORKFLOW_INFO_BYNAME cause exception which is writen to server log.
    I don't want to write this exception to log because of log size.
    Is there any way how to suppress the exception or other method to find if the document is in workflow?
    Best regards

    Hi
    I guess you can check the status of the content to verify if a content is any WF or not . If the status is Review / Edit etc then it indicates the content to be part of a WF .
    Hope this helps .
    Thanks
    Srinath

  • Delete InfoType records using Idoc HRMD_A05?

    Hello,
    We have some unwanted 167 and 168 infotype records in our database that we would like to clean up.  Can we use HRMD_A05 to delete them?  I can't seem to find a delete function in the Idoc fields...I would truthfully like to use the LSMW, anyone know a way other than a simple recording?
    Thanks.
    --Jack

    Hi Eswar
    Thanks for the reply. I could not get what PFAL is. Actually, I am using IDocs to migrate data through LSMW. And I want the new HR objects to be numbered internally. However, if I leave the object ID field null and use 'Insert' for operation (OPERA) it gives error and does not post the application document (IDoc). It also gives error for operation 'Update'.
    I was expecting it would generate new numbers but it did not. And what I had in the IDoc documentation does not work.
    So do you or anybody has experienced such an issue before?
    Thanks

  • Mass Deleting Supporting Documents

    Hi,
    We have over 6000 WMF loaded as supporting documents. We had problem in displaying those WMFs and had to convert them to JPGs and loaded all those JPGs to PLM. Since we don't need all of those WMFs now, how can we delete them in mass.

    Hi
    The function of mass deleting supporting documents is not available. But you can generate scripts to get mass deleting done.
    Due to that I don’t know the exact objects you want to delete, only valuable scripts can be supplied.
    Suppose you want to delete supporting documents, whose pkid starts with 1014, you need to generate following scripts:
    delete DrlAttachmentReference where fkOwner in (select a0.pkid from attachments a0 where a0.fkSpec = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d');
    delete attachments where fkSpec = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d';
    delete gsmProductFactSheet where fkSupportingDocument = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d';
    delete from gsmSupportingDocAttributes where fkAttrParentID = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d';
    delete SupportingDocuments where pkid = '1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d';
    Note: 1014351bc57a-1c92-4bd3-ad8f-e9d0ee4e594d is a sample pkid in my local server. In your case, it should be replaced by the supporting document’s pkid you want to delete.
    With current spec, you can get all supporting documents’ info easily from table SupportingDocuments:
    select * from SupportingDocuments
    where fkSpec='CurrentSpecPKID '
    Please backup your DB before you run any script.
    Thanks,
    Sherry

  • Implement Oracle UCM 11.11.5 Workflow (idoc scripting)

    Hi guys,
    We are using Oracle UCM 11.1.1.5.
    We have a 3 stages workflow. The stages are called as "Preparation", "Verification" and "Approval". We use Aliases. Users can be a members of many Aliases. But our requirement is a same user can't approve two subsequent steps. Lets say a user is member of all aliases. Hence he will be able to approve all stages of the workflow. But our requirement is the document who prepared should not be allowed to approve it in the verification stage. The system should throw a warning message. in the same way the person who approves in the verification stage should not be allowed to approve it in the "Approval" stage. Can we use idoc scripting to do that? Please give some idea and sample scripts to do this.
    The question we have are how we can identify the previous stage approver and how we can display warning message on the screen when a same approver trying to approve again in the subsequent stages?
    Thanks in advance
    With Regards
    Jacob
    Edited by: user8778076 on Aug 29, 2011 8:39 AM
    Edited by: user8778076 on Aug 29, 2011 9:04 AM

    Hello VJ,
    Please see details on using Rapid Clone -
    FAQ: Cloning Oracle Applications Release 11i [Doc ID:216664.1]
    Cloning Oracle Applications Release 11i with Rapid Clone [ID 230672.1]
    Regards,
    Debbie

  • Can we execute an idoc script from a custom service?

    Is it possible to execute an idoc script while executing a custom service?
    -Pratap

    There are several ways to execute iDocScript from Java, but in this quick example we will use a PageMerger object. There are several ways to get ahold of a PageMerger object. If you are executing in a context where a service object is readily available you may be able to get a PageMerger object reference with code like this:
    PageMerger pm = m_service.m_pageMerger;
    If that doesn't work for you I would try something like:
    PageMerger pm = new PageMerger(databinder, executioncontext);
    Now that you have your merger object you can execute all kinds of iDocScript code, an example of which might be:
    pm.evaluateScript("<$lc(\"wwMyString\")$>");

  • Help: apply different para styles to several consecutive paragraphs via script

    Hi all,
    I need to apply different para styles to several consecutive paragraphs via script, something like this (found somewhere on the net):
    var myDoc = app.documents[0];
    var mySel = app.selection[0];
    var myPStyle1 = "A";
    var myPStyle2 = "B";
    //need to add 6 more styles here:
    //var myPStyle3 = "C";
    //var myPStyle4 = "D";
    //var myPStyle5 = "E";
    //var myPStyle6 = "F";
    //var myPStyle7 = "G";
    //var myPStyle8 = "H";
    //the last style not needed in script?
    // apply 1st style to 1st paragraph
    mySel.appliedParagraphStyle = myDoc.paragraphStyles.item (myPStyle1);
    // apply styles to paragraphs after selected
    //2nd style
    mySel.paragraphs[-1].insertionPoints[-1].appliedParagraphStyle = myDoc.paragraphStyles.item (myPStyle2);
    //next style
    mySel.paragraphs[-1].insertionPoints[-1].paragraphs[0].insertionPoints[-1].appliedParagrap hStyle = myDoc.paragraphStyles.item (myPStyle2).nextStyle;
    I've tried badly, but can't find the way to extend the sequence
    Sorry, no skills in scripting yet...
    all styles have 'Next Style' option activated, but I can't use 'Apply style, then Next style' or Object styles, because I need four different sequences of those para styles:
    A-B-C-D-E-F-G-H
    A-B-D-E-G-H
    A-C-D-F-G-H
    A-D-G-H
    and I really don't want to create special clones of the same style for each sequence (Keep It Simple, they say ).
    I believe it can be done via four slightly adjusted scripts...
    any suggestions would be greatly appreciated...

    Sorry about being late to the party, I usually pick up stuff like this right away.
    How about this one?
    1. No separate scripts needed, it uses a tiny dialog where you can choose what style set to use. If I'm correct, you can press a number key on Windows to immediately select one of the items.
    2. It works down from the paragraph your cursor is in. It has nothing to do with text frames, though -- consecutive paragraphs inside a story always ignore any text frames.
    3. Extensible: you can easily change the names of the styles in the top array, and the number of style groups in the list.
    var styleLists = [
              [ "A", "B", "C", "D", "E", "F", "G", "H" ],
              [ "A", "B", "D", "E", "G", "H" ],
              [ "A", "C", "D", "F", "G", "H" ],
              [ "A", "D", "G", "H" ]
    var radiobutts = [];
    styleDialog = app.dialogs.add ({name:"Set Multiple Styles",canCancel:true});
    with (styleDialog)
              with (dialogColumns.add())
                        with (radiobuttonGroups.add())
                                  for (i=0; i<styleLists.length; i++)
                                            // Build radio button string
                                            str = "&"+String (i+1)+". ";
                                            for (j=0; j<styleLists[i].length; j++)
                                                      if (j) str += "-";
                                                      str += styleLists[i][j];
                                            radiobutts.push (radiobuttonControls.add({staticLabel:str, checkedState:false}) );
    radiobutts[0].checkedState = true;
    if (styleDialog.show())
              for (i=0; i<radiobutts.length; i++)
                        if (radiobutts[i].checkedState == true)
                                  break;
              if (i < radiobutts.length)
                        par = app.selection[0].paragraphs[0];
                        for (j=0; j<styleLists[i].length; j++)
                                  par.appliedParagraphStyle = styleLists[i][j];
                                  par = par.parentStory.paragraphs.nextItem(par);

  • On 10.4.11 Mac Mail I get this: Mail cannot update your mailboxes because your home directory is full. You must free up space in your home folder before using Mail. Delete unnedded documents or move documents to another volume. I can't open mail.

    On 10.4.11 iMac Mac Mail I get this message: "Mail cannot update your mailboxes because your home directory is full. You must free up space in your home folder before using Mail. Delete unneeded documents or move documents to another volume." I can't open mail to do this. I have reinstalled software but no effect. How do I get into Mail to delete?

    Found this on the "more like this" Worked like a charm!
    With the Mail.app quit and using the Finder, go to Home > Library > Mail. Copy the Mail folder and place the copy on the Desktop for backup purposes.
    Go to Home > Library > Mail > Envelope Index. Move the Envelope Index file to the Desktop.
    Launch Mail and you will be prompted to import mailboxes. Select OK and allow the import process to complete.
    After confirming all mailboxes were successfully imported and available, you can delete the copy of the Mail folder and old Envelope Index file from the Desktop and this should resolve the problem.

  • How can I delete the documents in my icloud. Thanks !

    How can I delete the documents in my icloud. Thanks !

    Welcome to the Apple Community.
    iCloud.com > iWork, click to select and delete.

  • How to Delete Unreaded Document  available in Inbox .  SBWP  (T-Code).

    Dear All,
    in SBWP (T-Code) i want to delete Unreaded Documents Please guide me the process. because in unread document 9000 mails are available due to this i am not able to open this screen. and it finally result to Shot dump : Time_out Error.
    Please Guide to resolve the Issue.
    Thanks in Advance.
    Regards
    SNB.

    Dear All,
    Thanks for updating the information. But we are not able to open the Screen only  after Clicking on INBOX and then UNread document to do the further process. Do you have any Report or T-code so that i can delete it.
    Regards
    SNB.

Maybe you are looking for

  • FASB 52 in F.05 transaction

    Hello, If the company works with 3 curr. types and you need to run every month the F.05 fx.val., when you need to flag the "translate valuation difference" field  in STEP 1 in the FASB 52 part. You always run the step 2 with the "translate valuation

  • On 11.2.0.1 cannot change REMOTE_LISTENER parameter

    [oracle@rs1pre91dvdba01 oracle]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 7 11:14:00 2011 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 6

  • Setting up device driver environment

    Hi , I have got Solaris 8.0 on Intel in one of the computers in my company but do not know how to install the DDI/DKI environment . Could somebody point out the procedures.Thanks in advance Pranjal

  • Moving Music From iPod to Playlist or LIbrary - Can't do it

    In some of my playlists the dreaded exclamation mark appears. In locating these songs, I find them on my iPod. It seems that I can not move them to a Playlist or to the Library. I believe them to be tunes I've purchased thru iTunes. Why can't I move

  • How do I paste .mov video in to iDVD 3 and burn?

    I have a nearly 2 GB video .mov file I want to burn to a DVD so I can play it in my television DVD player, but when I paste the file into iDVD 3 and put the disk in to burn it does not work. What am I doing wrong?