Copy static text from one MIF documents to other MIF document

Hi All,
I'm trying to copy the text frames and their contents from one document to other document.
I"m following the bellow steps..!
1. Open Template1.mif by F_ApiSimpleOpen()
2. Create new document called "Template2.mif" using "F_ApiCustomDoc"
3. Import the required formats by
F_ApiSimpleImportFormats(Template2,Template1,FF_UFF_COLOR |FF_UFF_COMBINED_FONTS |FF_UFF_COND |FF_UFF_DOCUMENT_PROPS |FF_UFF_FONT |FF_UFF_MATH |FF_UFF_PAGE |FF_UFF_PGF |FF_UFF_TABLE |FF_UFF_VAR))
4. Read the text frames from "Template1" and create new text frame in Template2
     pgfId = F_ApiGetId(FV_SessionId, Template1, FP_FirstFlowInDoc);
     while (pgfid) {
     //     create a new text frame in Template2
          tFrameId = F_ApiNewGraphicObject(Template2, FO_TextFrame, pFrameId);
          objGraphicId = F_ApiGetId(Template1, pgfId, FP_FirstTextFrameInFlow);
     //assigning the properties of text frames
          propspdf = F_ApiGetProps(docIdfrom, objGraphicId);
          F_ApiSetProps(docIdto, tFrameId,&propspdf);
Till this step, it is working as expected.
Next I need to read the paragraphs of each text frame and put only static text available in the TEXT FRAMES OF Template1 in newly crated TEXT FRAMES of Template2. But ignore the variables in the text frames.
I tried to work with the following piece of code
     doc2PgfId = F_ApiGetId(docIdfrom, objGraphicId, FP_FirstPgf);
     doc1PgfId = F_ApiGetId(docIdto, tFrameId, FP_FirstPgf);
     while (doc2PgfId && doc1PgfId)
               F_ApiDeallocatePropVals(&propspdf);
               tispdf = F_ApiGetText(docIdfrom, doc2PgfId, FTI_String|FTI_PgfBegin|FTI_PgfEnd);
               tisspdf = F_ApiGetText(docIdto, doc1PgfId, FTI_String);
               n=tispdf.len;
               n1=tisspdf.len;
               for(i=0; i<tispdf.len;i++){
                     ti = &tispdf.val[i];
                     tiT = &tisspdf.val[i];
                     //compare the text type and handle each text item appropriately
                     switch(ti->dataType){
                     //handle normal free flowing text
                      case(FTI_String):
                       //F_ApiAlert("In String", FF_ALERT_CONTINUE_NOTE);
                       tr.beg.objId = pgfId;
                       tr.beg.offset = ti->offset;
                       trT.beg.objId = tr.beg.objId;
                       trT.beg.offset = tr.beg.offset;
                    F_ApiDeallocatePropVals(&props);
                    props = F_ApiGetTextProps(docIdfrom, &tr.beg);
                    F_ApiSetTextProps(docIdto, &trT.beg,&props);
                    name1=(StringT)ti->u.sdata;
                    textLoc=F_ApiAddText(docIdto, &trT.beg,name1);
        //textLoc.objId = pgfId1;
        //textLoc.offset = textLoc.offset;
        //if the text string is a part of a variable then
        //it would have been taken care of so ignore it
        break;
       case(FTI_PgfBegin):
                  pgfId = ti->u.idata;
                  pgfId1 = tiT->u.idata;
                  propspdf = F_ApiGetProps(docIdfrom, pgfId);
                  F_ApiSetProps(docIdto, pgfId1,&propspdf);
                   break;
       case(FTI_PgfEnd):
             pgfId = 0;
             pgfId1= 0;
             textLoc.offset=0;
             bPgfalive = False;
             break;
     //Get ID of next pgf in frame
where am I going wrong? Is there any simple way of doing it?
How do I go ahead with this? Please help..!
Thanks,
Basav

Hi Michael,
Thanks for quick reply..!
There was a piece of code which validates whether the text frame I needed exists or not. I intentionally removed so as to not to confuse the reader.
Let me give you a clear picture that what I want to do..!
I've a MIF file and XML file that has the details of text frames and its contents in the MIF. XML looks like
<?xml version="1.0" encoding="UTF-8"?>
<MyProjectXML>
<TextFrame frame="fr18111dd"><P>Basava</P></TextFrame>
<TextFrame frame="fr224362cc"><P>Prabhu</P></TextFrame>
<TextFrame frame="fr2547"><P>5 Year Performance (US Dollar)</P></TextFrame>
</MyProjectXML>
My MIF file has more than 50  named text frames. Some of them are in XML file, like - fr18111dd, fr224362cc,fr2547. These text frames have the static text,variables and tables. [ Tables I've kept it aside to work later for now]
What I need -
Need a MIF file that has frames available in XML file and replace the variables with the values given in <P> tag and keep the static text as it is.
I'm trying the other way now, Open the MIF file and delete all the text frames except the frames mentioned in the XML file and save as new file.
Let me know if I'm doing anything wrong here..! That will save my time and effort.
Am I clear on my query? and what I wanted to achive ? Let me know otherwise..!
Thanks,
Basav

Similar Messages

  • Sales order Userexit to copy item text from one line item to other

    Hi Gurus,
                 I have an urgent issue. Based on item category in sales order, for one line item, I am getting item text. Now I have to copy same item text to other line item.
    Till now I tried save_document_prep & save_document to
    build object tdname & fetch all tdid from table stxh for object 'VBBP'.
    After that READ_TEXT and SAVE_TEXT function module.
    But during creation of sales order I am not able to get any value in STXH table for created sales order. Now I want to know from which internal table I can get item text ?  (some internal table should be there like xvbap to get text per line item)
    Or is there any other way to do this... Please help.
    Points will be rewarded.
    Thanks,

    Hi ,
    try something like this .
            l_name = ls_vbap-vbeln.
            IF l_name IS INITIAL.
              l_name = 'XXXXXXXXXX'.
            ENDIF.
            CONCATENATE l_name ls_vbap-posnr INTO l_name.
            CALL FUNCTION 'READ_TEXT'
                name            = l_name
    Regards
    Prabhu

  • Indesign repeatedly crashes when I copy text from one InDesign document to another InDesign document

    Indesign CC repeatedly crashes when I copy text from one InDesign document to another InDesign document. Is it possible to solve this problem?

    Without system information and details like what text formatting, language settings, fonts used, paragraph styles even down to the spell check language nobody can even begin to guess.
    Mylenium

  • How do I copy a page from one pdf  document to another?

    I am a newbe!

    That was easy.Thank you.
         Re: How do I copy a page from one pdf document to another?
    created by George Johnson in Creating, Editing & Exporting PDFs - View the full discussion
    If you open both documents, you can drag a page from the Pages panel (on the left of the window) of one document and drop it into the Pages panel of another.
    You can also extract one or more pages from a document to create a new document, and then insert the pages from this new document into another. In Acrobat 11 you 'd do this by doing:
    Tools > Pages > Extract
    and then:
    Tools > Pages > Insert from File
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/6163925#6163925
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/6163925#6163925
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/6163925#6163925. In the Actions box on the right, click the Stop Email Notifications link .
    Start a new discussion in Creating, Editing & Exporting PDFs at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0 .

  • How I forward text from one iphone 4 to other, only forward the calls

    how I forward text from one iphone 4 to other, only forward the calls

    you can't forward incoming texts to another phone automatically.

  • How to copy a node from one dom document to another?

    I have one dom document that I have to split up into multiple dom documents. I am able to get the inividual nodes that I want to put into seperate documents.
    My problem occurs when I create a new dom document and try to add the node from the parent document. I get an exception saying (copied from api: WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. )
    How can I make it so that I can copy a node from one document and add it to another.

    Have you checked out the API called importNode in the DOM Document. It lets you move nodes between different documents.
    This api lets you simply copy the existing node from one document into another. without creating any new nodes for it.
    I have done a small example please have a look.
    Book.xml
    <?xml version="1.0"?>
    <books>
      <book>
        <name>Inside Corba</name>
      </book>
      <book>
        <name>Inside RMI</name>
      </book>
    </books>------------------------
    Book2.xml
    <?xml version="1.0"?>
    <books>
      <book>
        <name>Core Java </name>
      </book>
      <book>
        <name>Core JINI</name>
      </book>
    </books>-------------------
    MoveNode.java (copies nodes from doc2 into doc1)
    import java.io.*;
    import javax.xml.parsers.*;
    // structures
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class MoveNode
      public static void main(String[] args)
        // step1. create a factory and configure it
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        // step2. set various configurations
        factory.setValidating(false); // do not need validation at this time.
        factory.setIgnoringComments(false); // do not ignore comments
        factory.setIgnoringElementContentWhitespace(false); // do not ignore element content whitespace.
        factory.setCoalescing(false);
        factory.setExpandEntityReferences(true);
        // step 3 create a document builder
        DocumentBuilder builder = null;
        try
          builder = factory.newDocumentBuilder();
        catch(ParserConfigurationException e)
          e.printStackTrace();
        try
          Document doc1 = builder.parse(new File("book.xml"));
          Document doc2 = builder.parse(new File("book2.xml"));
          if (doc1 == null || doc2 == null)
            System.out.println("doc1 is null or doc2 is null");
            System.exit(1);
          } // if
          // fetch books from doc2
          NodeList list = doc2.getElementsByTagName("book");
          System.out.println("number of books found " + list.getLength());
          Node node1 = list.item(0);
          Node node2 = list.item(1);
          // get the root node of doc1
          Node root = (Node) doc1.getDocumentElement();
          root.appendChild(doc1.importNode(node1, false));
          root.appendChild(doc1.importNode(node2, false));
          //now doc1 should have 4 nodes
          System.out.println(doc1.getElementsByTagName("book").getLength());
        } // try
        catch(SAXException se)
          se.printStackTrace();
        catch(IOException ie)
          ie.printStackTrace();
    hope this helps.
    regards,
    Abhishek.

  • How do I copy a page from one Pages document to another using Pages 5.0?

    I posted this question on another page, and haven't recieved an answer to it yet. However I have found a temporary solution, so I am posting this here in case anyone else has a similar problem.
    The issue here is that I have just upgraded from Snow Leopard to Maverick (10.9.1), and my Pages also upgraded (to 5.0.1), altering my Pages documents. This is the issue, as as far as I can see the new Pages does not offer some of the basic needs that the old Pages did! In other words it is worse than the previous version.
    Using the upgraded new Pages 5.0.1 seems to result in some major editing problems for me. If you upgrade, make sure you KEEP the old version of Pages 09 (v 4.3). That is what has saved me!  If you have the same problems I have had - explained below, you will still be able to close the new version and open your Pages document in the old version, provided it is not a new Pages document. If it is, it will be possible to export it as a Pages 09 document and edit properly.
    After upgrading to the new Pages 5.0.1, when I open documents in Pages and try and copy a section from one document to another (easy before using the thumbnails) many of the Menu items previously available are visible but appear faded and are not possible, including Insert>Section Break/Page Break/Page Number and Edit>Cut/Copy/Delete/Undo/Redo
    This even happens if I duplicate the Pages document and try and do any of these from the Duplicate (which should be an easily editable copy).
    My solution has been to simply open all Pages documents that Iwant to edit (or may want to edit in future) in the old Pages app (v 4.3), which I never got rid of. That has meant I can continue editing and copying a section (of 1 or more pages) from one Pages document to another.
    If anyone reading this has figured out a way to edit Pages documents using the new version 5.0.1 please post an explanation, and I will try it!

    And there are those who don't like me repeating the same message over and over again in this forum!
    Apple has removed over 90 features from Pages 5.
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5, after Exporting your files to Pages '09, and rate/review it in the App Store, then get back to work.
    Peter

  • MAXDB copy log file from one server to the other server.

    Hi All,
    I want to copy a log file from one server to the other server , the database is Maxdb and i don't know how to do it. I want to do it through command prompt, (set of commands required) the front end tool which we are using is DBM ( database manager). Please help.
    Regards
    M.A

    Hi,
    Basically, the process is of log shipping. Transferring logs from DC to DR system.
    For that, you can check HowTo - Standby DB log shipping - MaxDB - SCN Wiki
    This is script based. I have not done it but the idea remains the same.
    Regards,
    Divyanshu

  • How can I copy/paste text from one page to another?

    I feel like I am taking crazy pills... is there really no way to copy a text box (or group) from one page to another while creating books in Aperture 3?  Lets say I have my entire book laid out and I want to add one paragraph at the end on one page which will push text and photos down a half page or so... in most programs for the last decade or so they added really cool functionality... cut/paste...  It seems like the apple developers are aware of it because they are in the context menus but they don't work on text, only photo boxes.  Additionally, you can copy/paste text but it erases all formatting.
    Seriously, am I missing something?  I have trouble believing that they can't include this function.
    Anyone else have this issue?

    Update... it seems to only happen with text boxes which I create.  So when I try an existing theme I can cut/copy/paste just fine, but in that same theme if you edit the layout and add a new text box, I can't copy paste it anywhere... the options are in the menu but nothing happens.
    Thoughts? Solutions?
    I am running 3.4.3 on a MacBook Pro OS X 10.8.3

  • Copying goals/objectives from one appraisal documnt to other.(Not working)

    I have a requirement in which all the "Goals/Objectives" from the previous years appraisal documents are to be copied to the newly created appraisal documents for the current year.
    I take the details of the previous years appraisal document using "HRHAP_DOCUMENT_GET_DETAIL" .
    I use the exact data of the previous years document making only minor changes (document header dates) and then create a new appraisal document using FM "HRHAP_DOCUMENT_SAVE".
    The error is that the Goals/Objectives do not get copied completely....
    eg. The previous years document has 3 goals
    "xxx
    yyy
    zzz"
    The newly created will have 3 goals but the texts of the goals will not get copied and will display the default text. eg:
    "New Goal
    New Goal
    New Goal"
    Using Other FM's like HRHAP_DOCUMENT_CREATE or HRHAP_DOC_UPDATE_BODY_AND_SAVE also give the same results.
    The problem might be because I am directly using "body_elements" from the previous document in the new document w/o any edits.
    Any n all suggestions highly welcome....

    Hi,
    Try like this ...
    To get all the templates use this FM
    CALL FUNCTION 'HRHAP_TEMPLATE_GET_LIST'
        EXPORTING
          add_on_application = 'PA'
          plan_version       = '01'
        IMPORTING
          t_templates        = tb_templates.
    Data :  tb_s_with_or_without    TYPE hap_s_sel_with_or_without.
    tb_s_with_or_without-sel_display_existing = 'X'.
    *--To get the list the documents
      CALL FUNCTION 'HRHAP_DOCUMENT_GET_LIST_XXL'
        EXPORTING
          add_on_application    = ' '
          plan_version          = '01'
          t_templates           = tb_templates
          s_sel_status          = tb_hap_status-----> mandatory table to pass --just pass it
          t_sel_status_sub      = gt_1000_status_sub---->pass this if u r considering the Sub statuses also
          s_sel_with_or_without = tb_s_with_or_without---->check above
          t_appraisees          = tb_appraisees---> get all appraisal Ids into this table form HRHAP table
        IMPORTING
          t_documents           = tb1_docs.---> will get all the documents
    Regards,
    Padmasri.

  • How to copy a structure from one SAP system to other SAP system in ABAP

    Hi All,
      We have a requriement where need to copy an strcture of 250 feilds from on SAP system to other SAP system , do any one know how to do it .
    Regards
    Channu

    Channappa,
    It is really not hard to manually create the structure. Ctrl-Y copy from the source system screen and paste in the target system screen. You'll have to do this one page at a time. So, you will have to repeat it 9 times (or 18 times if you have to copy/paste component list and type separately).
    I can assure you that you can finish the task in less than 30 minutes.

  • Copying sales order from one company code to other

    Hi,
    I am trying to copy one sales order data from one company code to another, all the details should be same other than the company code and some fields , for this I am using std BAPI Getdetail to get all the details of sales order and passing to BAPI, CREATE FROM DAT2 , so that I create new order.
    When I check the new order, I see everything same but CANCEL DATE value in the ITEM Overview is not copied, I checked the original order , it has cancel date value. The order is an AFS order with AFS tabs.
    I Checked the BAPI GET Detail FM, it doesn't retrieve that information, moreover it doesn't have that field ( J3_ACADA) in the ITEM structure. I can see cancel date value in VBAP. The ITEM structure in CREATE FROM DAT2 also doesn' have that field.
    I can populate using USER_EXIT but I need to get the value from original order.
    How to copy the cancel date value to new order.It should happen only for the orders which I run through this report.
    Any suggestions let me know.
    Thanks

    Hi Uma,
    As my understand, the couple Tcode FS15 and FS16 is used to copy GL master data from in same client or different client.
    The file attract from FS15 will be stored in SAP, not in your local computer.
    And when you run FS16, the system will file this file and upload it.
    Here is selection screen in FS15, you can determine the file name, and keep the batch input name as default.
    After executed, the file is generated with message like below
    Then, go to tcode FS16 with parameter:
    You can untick "Check file only" for Production run.
    When you execute it, the batch input RFBISA20 is generated.
    After that, you go to tcode SM35 to check the batch input RFBISA20, excute this batch input here and check the log.
    Julie

  • Copying a page from one InDesign document to another

    I have a page in an InDesign document (which contains graphics) that I would like to copy to another InDesign document, but Copy / Past does not work.

    Have both files open...
    In the source file open the pages panel and select the page(s) you want to copy, from the panel menu choose move page(s), and select the destination file and specify a position.

  • Why do objects get bigger when I copy and paste from one Keynote document to another?

    I have 2 keynote presentation files open. I select some objects on one slide, apple-C to copy, go over to a blank slide in another file, and apple-V to paste. The item(s) get pasted but are much bigger - they take up way more of the new slide than they did for the old one.  What am I missing? Why can't I copy it with the same relative size it used to have?

    Chances are that small file used to be a PowerPoint file - PowerPoint deals in inches instead of pixels (which blows my mind).
    I would first convert the smaller file to a larger resolution - that should keep most of the scaling intact - and then copy and paste. In my opinion you'll probably have to re-polish your presentation once you've changed the resolution as some things will probably be a bit wonky.

  • Copying a Window from One Smartform to the Other

    Hello Experts!
    I was wondering if there is a way that I can copy a window and then paste it on another smartform.. it is that simple. I have tried the normal righ clicking and copy and paste but it does not work.
    Thank you,
    Val.

    Hi
    I donot think It is possible. But you can copy a smartform to your own development classes.
    For that you need to do the following things.
    Check the link
    Re: change std invoice smart form?
    Reward if make some sense to you
    Thanks
    Krushna

Maybe you are looking for