How to create a working SaveAsDoc command

Hi Everybody,
I need to create a SaveAs command to save converted document (from previous versions to CS5) without any user intervention.
Unfortunately all the utility functions like IDocFileHandler, IDocumentUtils, etc. don't work or miss the saveAs command completely or in part.
I'd like to create a command using the usual way like:
InterfacePtr<ICommand> saveAsCommand(CmdUtils::CreateCommand(kSaveAsDocCmdBoss));
It works but I don't know what parameter I need to pass to the command object.
May any of yout poin me out on where to find the right information?
Is there any class for the SaveAs command data like for many other commands? (for example IID_IRECOVERDOCUMENTCMDDATA for
the command kRecoverDocumentCmdBoss).
Some of you may wonder why I need to create a SaveAs command when there is plenty of helper functionalities to achieve that. Well, it seems
that all the functionalities I know don't work (crash) in my specific situation. :-\
Thanks a lot in advance.
Luca Severini

Thanks for your helpful reply Jack.
I was going to infer the right parameters from other commands using same parameters but your reply speeded-up my work.
About the boolean flag, accordingly with SaveAs command defined in IDocFileHandler interface it may be this: bool8 asStationery.
As happens with Save command, also SaveAs command doesn't crash if I avoid to use IDocFileHandler, IDocumentCommands or
any other helper interface.
Take present this code runs inside a cooperative thread from IIdleTask::RunThread().
Here is an excerpt from my code which seems to work fine:
If there is any mistake pleas elet me know.
Luca
UIDRef docRef = gGlobals->GetCurDocRef();
IDataBase* database = docRef.GetDataBase();
ASSERT(database);
InterfacePtr<IDocument> curDocument(docRef, UseDefaultIID());
ASSERT(curDocument);
InterfacePtr<IDocFileHandler> docFileHandler(Utils<IDocumentUtils>()->QueryDocFileHandler(docRef));
ASSERT(docFileHandler);
if(curDocument->IsModified())
     ErrorUtils::PMSetGlobalErrorCode(kSuccess); // Cleans the global error code
     if(curDocument->IsConverted() || curDocument->IsMissingPlugins() || !curDocument->IsSaved())
          if(docFileHandler->CanSaveAs(docRef))
               const IDFile *destFile = database->GetSysFileFromOpen();
               ASSERT(destFile);
              // docFileHandler->SaveAs(docRef, destFile, kSuppressUI); // Crash on CS5 with Automatic Import...
               InterfacePtr<ICommand> saveAsCommand(Utils<IDocumentCommands>()->CreateSaveAsCommand());
               ASSERT(saveAsCommand);
               saveAsCommand->SetItemList(UIDList(docRef));
               InterfacePtr<ISysFileData> fileData(saveAsCommand, UseDefaultIID());
               ASSERT(fileData);
               fileData->Set(*destFile);
               InterfacePtr<IUIFlagData> uiFlagData(saveAsCommand, UseDefaultIID());
               ASSERT(uiFlagData);
               uiFlagData->Set(kSuppressUI);
               InterfacePtr<IBoolData> stationaryFlag(saveAsCommand, UseDefaultIID()); // Does this the asStationery flag like in IDocFileHandler ?
               ASSERT(stationaryFlag);
               stationaryFlag->Set(kFalse);
               if(CmdUtils::ScheduleCommand(saveAsCommand) == kSuccess)
                    while(!saveAsCommand->IsDone() && ErrorUtils::PMGetGlobalErrorCode() == kSuccess)
#ifdef DEBUG
                         DebugStr("Waiting to finish with document saving...\n");
#endif
                         idleTask->YieldToEventLoop(100);
else
          if(docFileHandler->CanSave(docRef))
               // docFileHandler->Save(docRef, kSuppressUI); // Crash on CS5 with Automatic Import...
               InterfacePtr<ICommand> saveCommand(Utils<IDocumentCommands>()->CreateSaveCommand(docRef, kSuppressUI));
               ASSERT(saveCommand);
               if(CmdUtils::ScheduleCommand(saveCommand) == kSuccess)
                    while(!saveCommand->IsDone() && ErrorUtils::PMGetGlobalErrorCode() == kSuccess)
#ifdef DEBUG
                         DebugStr("In attesa conclusione del salvataggio...\n");
#endif
     result = ErrorUtils::PMGetGlobalErrorCode();
     if(result != kSuccess)
          errorMessage = ErrorUtils::PMGetGlobalErrorString();
          time.CurrentTime();
          sprintf(msgStr, "Errore %d \"%s\" in salvataggio documento\r", result, errorMessage.GrabCString());
          gGlobals->GetLogs()->WriteLog(&time, msgStr);
if(docFileHandler->CanClose(docRef))
     docFileHandler->Close(docRef, kSuppressUI, kFalse);
     result = ErrorUtils::PMGetGlobalErrorCode();
     if(result != kSuccess)
          errorMessage = ErrorUtils::PMGetGlobalErrorString();
          time.CurrentTime();
          sprintf(msgStr, "Errore %d \"%s\" in chiusura documento\r", result, errorMessage.GrabCString());
          gGlobals->GetLogs()->WriteLog(&time, msgStr);
else
          docRef = UIDRef::gNull;

Similar Messages

  • How to create New Work Center

    Dear Experts
                      How to create New Work Center?, what are all the inforamtions  need while creating workcenter.
    Regards
    Rajakarthik

    Hi,
    In addition to the above post, you need to identify that:
    1. Whether you need separate activity types and cost center for the newly created work center. These details are entered in the Costing View of the Work Center.
    If these are required then use KL01 to create new activity, KP26 to define the activity price.
    If required create cost element using T Code KA01 and Cost Center using KS01.
    Take help from the CO guy on this.
    2. Also  you need to ask the concerned about the operating times for the wor center. That is Start time and End time of WC. It is used for capacity evaluation and scheduling of the orders. It is maintained in the capacity view (Bottom left Button in the view).
    this view will also contain the details regarding the calendar, to be assigned to the work center, if needed. Collect details for this requirement. Also you can assign a different calendar to WC apart from factory calendar.
    3. Find out whether this WC will be operating in shifts or not. Accordingly maintain the details.
    Hope it is useful for you.
    Revert for clarifications
    Regards,
    Rohit.

  • How to create a work flow template

    HI
    how to create work flow template using EP.
    I am new to this division of  EP .
    Could some please give me a head start to go with this
    some how to docs or weblogs
    thanks
    pk

    Universal Worklist Configuration
    http://help.sap.com/saphelp_nw04s/helpdata/en/0c/19dfc6febc4f888701697ef23b16cd/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how to configure the universal worklist.pdf.
    Patricio.

  • How to create a working link anchor in an EXCEL document with the report generation toolkit?

    I am using the latest report generation toolkit and want to add links on the first worksheet pointing to the other worksheets in the same document.
    I am using the "Append Hypertext Link Anchor to Report" VI. The links are created, but don't work when clicking them.
    Question now is: How does a link to a cell on a different worksheet needs to look like?
    It can not be that complicated but all variations I tried did not work and I could not find any information about this problem. So any help is appreciated!
    Thanks and Regards,
    Ingo
    Solved!
    Go to Solution.

    Thanks, Brian, for your support! - It's working.
    It's hard to understand why NI did not pass this parameter to the top of the call chain...
    I also needed some time to understand the syntax of the string passed to the subaddress node:
    The name of the worksheet needs to be framed by single quotation marks and the following cell address must preceeded by an exclamation point (!).
    A working link pointing to cell "A1" of "Worksheet 1" looks like:
    'Worksheet 1'!A1
    Maybe also of interest: If you want to point the link to a worksheet inside the document itself, the parameter "address" (URL of link - href) can be left empty.
    Thanks and Regards,
    Ingo

  • How to create 2 Work Manager Apps on SMP Server (Agentry)

    Hi All,
    I encountered a problem with my SMP 2.3 SP3 in combination with Agentry  6.1.. and Work Manager 6.0.
    I have an already working version of WorkManger on my SMP Server on port 7003, but whenever I create another WorkManager version on a different port e.g. 7005 the SMP/Agentry Server displays the status STARTING but never finishes this processs state.
    The version of both Work Manager instances is the same, with the exception that the section [ANGEL Front End Ports] in the file Agentry.ini contains once the port 7003 and in the other file e.g. 7005.
    Has anyone a encountered a similar problem or is able to create two different WorkManager versions on the same AgentryServer?
    Regards,
    Thomas

    Hello Steve,
    thanks for your quick reply, the listenOn Port is at both applications the same I will fix that in a few seconds.
    the entry nonStandardJavaOptions is at both apps empty.
    the startup.log of the second application:
    14:16:58 03/19/2014: Starting server (64-bit Windows)
    14:16:58 03/19/2014: Administration client command port is 55086, status port is 55087
    14:16:58 03/19/2014: Looking for initial status connection...
    14:17:04 03/19/2014: Event: 0, 30, Admin client 10.33.160.94:55094 authenticated successfully.
    14:17:04 03/19/2014: Event: 0, 27, Admin client 10.33.160.94:55094 has connected
    14:17:04 03/19/2014: Reading system ini file.
    14:17:04 03/19/2014: ID: SAP Work Manager Server v6.0.0.0, Name: ???, Location: ???
    14:17:04 03/19/2014: Starting log file.
    14:17:04 03/19/2014: Loading message groups.
    14:17:04 03/19/2014: Starting threads.
    14:17:04 03/19/2014:    1 initial threads.  Threads will auto-scale.
    14:17:04 03/19/2014: Starting Server: Agentry v6.1.3.10212
    14:17:04 03/19/2014: Event: 0, 2, System Startup
    14:17:04 03/19/2014: Loading 1 front ends
    14:17:04 03/19/2014: Loading front end from angelvine.dll
    14:17:04 03/19/2014: ANGEL Front End: reading init files.
    14:17:04 03/19/2014: Event: 17, 14, ANGEL Front End v6.1.3.10212
    14:17:04 03/19/2014: Event: 0, 2, Loading the Agentry Server's public/private key for password exchanges.
    14:17:04 03/19/2014: Event: 0, 2, Key pair loaded successfully.
    14:17:04 03/19/2014: Starting Server Agent.
    14:17:04 03/19/2014: Agentry: Starting threads.
    14:17:04 03/19/2014:    1 initial threads.  Threads will auto-scale.
    14:17:04 03/19/2014: Agentry: Adding messages.
    14:17:04 03/19/2014: Event: 1, 4, Agentry v6.1.3.10212
    14:17:04 03/19/2014: Loading 1 agents
    14:17:04 03/19/2014: Loading agent from ag3.dll
    14:17:04 03/19/2014: Starting Server
    14:17:04 03/19/2014: Server: reading ini file
    14:17:04 03/19/2014: Initializing 2-HTTPXML from ag3httpxmlbe.dll
    14:17:04 03/19/2014: SystemConnection-2: Reading configuration information.
    14:17:04 03/19/2014: SystemConnection-2: Setting name to 'HTTP-XML Back End'.
    14:17:04 03/19/2014: HTTP-XML Back End: Initialized.
    14:17:04 03/19/2014: Event: 24, 4, Loaded HTTP-XML Back End (HTTPXML v6.1.3.10212) from ag3httpxmlbe.dll
    14:17:05 03/19/2014: Initializing 1-Java from ag3javabe.dll
    14:17:05 03/19/2014: SystemConnection-1: Reading configuration information.
    14:17:05 03/19/2014: SystemConnection-1: Setting name to 'Java Back End'.
    14:17:05 03/19/2014: Java Back End: Initialized.
    14:17:05 03/19/2014: Java Back End: Java Virtual Machine loaded.
    14:17:08 03/19/2014: Java Back End: Java Back End AJAPI version 5.0, release 6.1.3.10200
    14:17:08 03/19/2014: Event: 23, 101, Java Back End: AJAPI JAR version 6.1.3.10200 does not match the version of the Agentry Server
    14:17:08 03/19/2014: Java Back End: Initialized.
    14:17:08 03/19/2014: Event: 23, 4, Loaded Java Back End (Java v6.1.3.10212 (JVM version 1.6.0_22, AJAPI version 5.0 build 6.1.3.10200)) from ag3javabe.dll
    14:17:08 03/19/2014: Event: 20, 150, Loading Production application definitions using file "SAPWM-v1-0-0-app"
    14:17:08 03/19/2014: Event: 20, 152, Loading Production application definitions for default localization

  • How to create a working day/holiday attribute in Time Dimension with OWB ?

    Hello everybody,
    I am trying with no success to create a Time Dimension (with the wizard it would be easier...) with a working day or holiday attribute (0 or 1) to be able to calculate measures only on working time !!! I am totally sure it's possible, obviously, but I found nothing on forums... Could you help me ??
    I use OWB 11g, I need all fiscal year/quarter/month/week and all calendar year/quarter/month/week attributes so without any wizard it would be quite impossible... thank you for your help !
    NB: of course I know how to define if a day is a working one or not, but I currently can't add any columns in Time dim created with wizard...
    Francois
    Edited by: [email protected] on Jun 15, 2009 8:24 AM

    Hi,
    First of all, thanks everyone for your help.
    I did several tests this morning.
    First of all, i've tried with time_from = 000000 and time_to = 235959 (23:59:59 CET) and the activity has been created with Time From = 04:00:00 and Time To = 03:59:59
    Strange no ??
    I've also tried with 230000 for time from and time to but the activity has been created with Time From = 03:00:00 and Time to = 03:00:00
    I cannot understand the logic behind....
    Thanks,
    Johnny Baillargeaux

  • How to create a work center for Workflow

    Dear all,
    I need some material or help to create work center in workflow
    for agent assignment.
    or
    How to assign Multiple responsible agents for a specific task
    Regards,
    Gaurav Sood

    Hi Imthiaz,
    Good Morning,
    I will Like describe you the secnario that i am in.
    I have customised workflows for
    1. Please release PO
    2. PO release effected.
    Both creator and relesing authority get notification for the same
    in SAP Inbox.
    In Addition to that i want to assign few other people who should get notification of mail PO Released.
    can you explain a bit more about Expression table
    regards,
    Gaurav

  • How to create shift work centre

    Good Morning Guys
    Am trying to implement shift sequence in my company.There are three shifts currently running and between the shifts are divided into two, managers and the subordinate staff.Managers go on a 3day shift with 4 shifts one being on standby while the suborditates go on a 7 days shift rolling both of which work on the same work center.Am having challenges to do the configuration as i have no prior source of reference on how to implement such a scenario
    kindly assist
    Regards
    Hussein

    Your requirment is not very clear, according to my best understanding of your above explanation it is
    3 shifts per day for 7 days cycle
    7 days all subordinates (which means 3 days managers +subordinates and 4 days only subordinates)
    while only managers available for 3 days (Managers and Subordinates capacity available)
    This is how I managed to create the interval and shift in the same work center, check if this is what you are looking for
    Regards
    Murad

  • How to create backup using sql commands

    can i create a backup using sql/sqlplus commands

    I would actually advice you to use RMAN, instead of backup using sql commands, but if you want or have a requirment to do so..
    First off all you should ensire that your databasse is in archilog mode.. (ALL PRODUCTION DATABASES should be in archivelog mode)
    you can do it using sql*plus
    archive log list
    Then if you would like to make a cold backup (the only one posible in noarchivelog mode)
    ypu have to
    shutdown immediate
    copy all database files (you don't need to copy redo logs) to another device
    startup - to startup database
    Actually I will suggest that your read User manager Recovery guide from oracle documentation
    tahiti.oracle.com
    Best Regards
    Krystian Zieja / mob

  • How to create an lov with command link

    hi all
    i want to create an lov such that each of the values in the list have a command link. when i click on a particular value, that value should be removed from the lov list and displayed on my page.
    like for example, i want to send a mail to many ppl at the same time. from my address book, i click on the name of the person i want to send the mail and that name is added to my "Send To" list.
    Can anyone help me do this? i'm using jdev10g adf.
    thanks.
    preeti

    Hi,
    you should use the shuttle control in ADF Faces for this
    Frank

  • How to create OID attributes from command line in unix system

    Hi,
    I have to create OID attributes through ldif files in unix system. I dont know how to run it in unix system under which folder. I already have ldif files for creating OID attributes. Please help.

    Hi,
    unser the /your_ODI_HOME/agent/bin folder.
    Excute this
    sh startscen.sh REFRESH_ID 001 GLOBAL 5 -NAME=agent_ODI
    REFRESH_ID=Your Scenario name
    001:Version
    GLOBAL:Context name
    5=Log Level
    agent_ODI=Your agent name
    Regards

  • How to create a program shortcut (command line, not icon)

    Hi,
    I installed a program from source, it's a biological structure modeling software. How can I make a shortcut so that I just type in the name of the program to get it to start? Thanks!

    There are two ways of doing it, depending on what you want to accomplish. Both require that you edit the file ~/.bashrc (I assume you use bash)
    1) If the application places all the executable files in a given directory (let's say /opt/Application/bin/), you can access all those executables directly by simply telling your shell where to look (in the same way the shell automatically looks for executable files in eg. /usr/bin). In ~/.bashrc, you would have to add a line that looks like this:
    PATH="$PATH:/opt/Application/bin"
    2) If you just want to make a traditional "shortcut" that executes a given command, this can be done with alias. Add this command to your ~/.bashrc:
    alias shortcut="some command"
    In this case, typing shortcut into a terminal will be interpreted just like if you had typed some command instead.
    In order to try out these changes, either restart your terminal or run this command:
    source ~/.bashrc
    [EDIT]
    I was obviously beaten to it
    Last edited by Peanut (2009-05-26 23:12:47)

  • Apple helped set up userhomefolders on second volume of mini, i forgot how to create another user on command line

    Alright, I am setting up a mac mini with snow leopard server and the telephone help got me started but did not use the system preferences.  The intention is to set up accounts for up to 80 students.  I thought the person guided me through some documentation but now I cannot locate the docs to read them.  Can any one help this poor lost bit?

    All,
    I thought it may be related to spaces in the path in which the script was called from. I tried having the ODBC command script in another directory but the same thing happens. It will give me the "CONFIGSYSDSN: Unable to create a data source for the 'Oracle in OraClient10g_home1' driver: Could not load the setup or translator library with error code -2147467259". As soon as the script is done running I can manually double click the script and it adds the DSN fine.
    Thanks,
    Clif Bridegum

  • How to create db using sql commands?

    Had logged in to default database with the default login nmae and password. Under this default database, am i able to create another database in it? If so, what is the sql command to create/delete the new db?

    Chapter 2
    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96521.pdf
    Joel P�rez

  • How to create a working  Gateway service utilizing an Existing ECC Function Module?

    Hello All,
    Our ECC (Back end) has a Function module which is to be used by creating a Gateway service .Can you suggest the step by step procedure with which i can continue to expose the service?
    Any help on this is much appreciated!
    Thanks,
    Usha

    Hi Usha,
    the flag 'Local app' indicates where the implementation of the service is done because it can be done on the Hub or on the backend. (see my blog about deployment options SAP Gateway deployment options in a nutshell).
    If you choose 'Local App' the BEP API will be called on your hub while otherwise it will be called on the backend system to which the RFC destination points to which has been maintained in your system alias definition.
    Best Regards,
    Andre
    This is explanation offered by SAP Help:
    Indicates that the System Alias is to be used by BEP
    SAP NetWeaver Gateway applications can be developed either on a SAP Business
    Suite backend system or on a SAP NetWeaver Gateway hub system. To access the
    business logic from an SAP Business Suite backend system the software component
    IW_BEP (Backend Enablement and Event Provisioning) has to be deployed in your
    system landscape. IW_BEP can be deployed on the backend system or locally on the
    SAP NetWeaver Gateway hub system. Communication is handled via system aliases
    (RFC destinations).
    Use
    Set this flag if you use this system alias for an OData Channel application
    that has been developed on the BEP add-on which is deployed on the SAP NetWeaver
    Gateway hub system.
    In this case the system alias information (such as RFC destiation, Web
    service group, software version) is not used by SAP NetWeaver Gateway to
    call the BEP API (it is called locally). Instead the system alias information is
    passed through to the OData Channel application, so that it could then itself
    make a call to the corresponding backend system.

Maybe you are looking for

  • Locked out of my old Apple ID.

    My first Apple ID was based on an old e-mail account that I no longer have access to.  I used this Apple ID to purchase songs on iTunes from 2005 until 2012 (625 purchases).  Since then, I have been told my password is incorrect and I need to reset i

  • Acrobat 9.4 encountered a problem and needs to close

    We are embedding .pdf's using an OLE.  When we open the document, this error message is received.  I have duplicated it on two different computers. Thank you!

  • Setting a reverse counter of the # of characters as form is being filled.

    Hi, This question maybe a little strange. I was wondering, if it's possible to have a <counter> that counts the # of characters as it<s being typed into the field that I'll create in a form using Acrobat Pro. I've seen this function before, but in ot

  • MacPro Monitors Go Black

    Hi: I've got six identical MacPros (late 2010 MacPro5,1) all 2x2.66 GHz 6-core Intels we use for retouching. All have Apple-installed ATI Radeon HD 5870s. All have the Eizo CG241W plugged into the DVI port on the graphics card and old 20-inch Cine mo

  • How to get the " com.sun.xml.* " package?

    In a java xml sample, it uses a class "com.sun.xml.tree.XmlDocument". Its author said it is a internal class.But I can't find the class in "com.sun" package. Please tell me how to get the class? Thanks very much!