MS_WORD_OLE_FORMLETTER

Hi all,
Could you please let me know how to use this Function: MS_WORD_OLE_FORMLETTER???
I have to add my fields to the word doc (when running the print program of layout) and open this word doc with added values...
Thank you in advance.
DIANA

<b>word_document</b> = location of the existing document in which you want to change the val (d:\Documents and Settings\user\Desktop\Doc1.doc)
<b>File_name</b> = File name to which the modified file to be saved (just give the same file name you opened - Doc1.doc - just the file name and not the whole path)
<b>Download_path</b>
path for downloading  (d:\Documents and Settings\user\Desktop\)
<b>Data_tab</b> = any internal table
<b>filednames</b> = field names of the internal table in a table .  for example if your itab has fielda, fieldb and fieldc , then this table first record value should be fielda and second record value should be fieldb, etc.
Hope this is clear.
Regards
Raja

Similar Messages

  • Word merge with MS_WORD_OLE_FORMLETTER

    We want to do a word-merge with MS_WORD_OLE_FORMLETTER, having two datasets (in internal tables) and making two documents in one run (to make sure all selections are the same). When trying this the word-template-document (or how do you call that) has to be openen beforehand and before being able to make the second document we have to close the first and open the second template.
    Has anyone have an idea what might be wrong ? What parameters can influence this behaviour ?
    Thanks.
    Kris

    Hi Graham,
    Did you receive any error message ? some thing like  40552 : The session has been
    terminated because of excessive transaction log space usage. etc., Please share if any to isolate the issue.
    Regards,
    Shirisha Paderu
    Disclaimer : This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or
    information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and
    Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

  • How to use "MS_WORD_OLE_FORMLETTER"

    I have done following in my prog.
    Defined internal table itab1 with field line(100).
    used GUI_UPLOAD to upload data from word file.
    then called MS_WORD_OLE_FORMLETTER.
    here i am not getting what exactly FIELDNAMES means. FIELDNAMES                = 'what should be passed here'.
    please explain i want to upload data from word file make changes to it and then save it in word file .
    I need to trace the changes done to the old file and save changes to some ztable. How should i find the changes because data in the internal table is comming in the encrypted format.

    <b>word_document</b> = location of the existing document in which you want to change the val (d:\Documents and Settings\user\Desktop\Doc1.doc)
    <b>File_name</b> = File name to which the modified file to be saved (just give the same file name you opened - Doc1.doc - just the file name and not the whole path)
    <b>Download_path</b>
    path for downloading  (d:\Documents and Settings\user\Desktop\)
    <b>Data_tab</b> = any internal table
    <b>filednames</b> = field names of the internal table in a table .  for example if your itab has fielda, fieldb and fieldc , then this table first record value should be fielda and second record value should be fieldb, etc.
    Hope this is clear.
    Regards
    Raja

  • Any body help me regarding MS_WORD_OLE_FORMLETTER?

    hi friends,
    i  have to display some fields of itab in word document.
    for this i searched this FM MS_WORD_OLE_FORMLETTER.
    But i am not getting how to use this FM. Even i searched in this forum. But in that i didn't find correct information.
    plz can any body explain it with simple example code.
    Regards,
    Shankar.

    hi ranga,
    thanks for ur replies. I tried already like this example. the problem is it's creating word file and it's showing only column names. but it's not shoing any itab information records.
    he re i am giving code. plz check it once...
    *& Report  ZHR_WORD_LETTER
    REPORT  ZHR_WORD_LETTER.
    TABLES: PA0002.
    DATA: BEGIN OF emp,
            ename LIKE PA0002-CNAME,
            place LIKE PA0002-GBORT,
          END OF emp.
    DATA: BEGIN OF columns OCCURS 10,
              colu(20),
          END OF columns.
    DATA: itab_emp LIKE TABLE OF emp WITH HEADER LINE.
    DATA: path_desc LIKE RLGRAP-FILENAME.
    SELECT cname gbort FROM PA0002 INTO TABLE itab_emp UP TO 10 ROWS.
    MOVE 'ENAME' TO columns.
    APPEND columns.
    MOVE 'PLACE' TO columns.
    APPEND columns.
    path_desc = 'c:\temp\'.
    CONDENSE path_desc.
    CALL FUNCTION 'MS_WORD_OLE_FORMLETTER'
      EXPORTING
       WORD_DOCUMENT             = 'emp'
    *   HIDDEN                    = 0
    *   WORD_PASSWORD             =
    *   PASSWORD_OPTION           = 1
       FILE_NAME                 = 'emp'
    *   NEW_DOCUMENT              =
        DOWNLOAD_PATH             = path_desc
    *   PRINT                     = ' '
      TABLES
        DATA_TAB                  = itab_emp
        FIELDNAMES                = columns
    EXCEPTIONS
       INVALID_FIELDNAMES        = 1
       USER_CANCELLED            = 2
       DOWNLOAD_PROBLEM          = 3
       COMMUNICATION_ERROR       = 4
       OTHERS                    = 5
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    CASE SY-SUBRC.
         WHEN 1. MESSAGE 'Invalid Columns' TYPE 'I'.
         WHEN 2. MESSAGE 'User Cancelled' TYPE 'I'.
         WHEN 3. MESSAGE 'Download Problem' TYPE 'I'.
         WHEN 4. MESSAGE 'Communication Error' TYPE 'I'.
    ENDCASE.
    ENDIF.
    WRITE: 'ok'.
    But finally i am getting Communication Error message.
    Regards,
    Shankar.

  • PDF form output

    Apparently you can make a PDF form output. But how did they do this:
    http://www.oracle.com/technology/products/reports/showcase/conmeds_OC_onePage.pdf
    Is it possible to make it in such a way that you can save the document including the entered data? If you try to do that now you get an Adobe Reader error.

    What I'd really like is to download directly to WORD from sapscript or smartform with logos, boxes intact just like they appear in PDF. 
    PDF Writer is a possibility, but do you think we could posibly achieve this with standard SAP Function modules:
    MS_WORD_OLE_FORMLETTER_PICTURE MS_WORD_OLE_FORMLETTER        
    If by using this FMs we wouldnt be using the sapscript and smartform technology by pretty much generating these documents over and over again, please confirm...
    Danke!
    Francisco

  • Transport to Word doc.

    Hi all,
    I have some word doc file template , and need to transport may output program to this word doc.
    Should I use some macro or how to do this. SAP has standard output buttons, but template must recognize output program values and fill it to corresponding places.

    try fm MS_WORD_OLE_FORMLETTER
    A.

  • Side effects of SP 18

    Hi all,
    Does anyone know what are the side effects with support package 18 for BI 7.00
    Thanks,
    Joseph M

    Hi Joseph,
    Please find the list of Side effects that might come during SP upgrade:
    Transaction BUP3 opens BP in change mode on first access
    PPOM: search function dumps
    HRALXSYNC: No repair if BP-integration is partly active
    Generation of testplan, testcase, project - long runtime
    Unable to logon to due to updating of INDX table
    ICF: ICF buffer filled because of special suffixes
    Collective corrections: Logon 2/2007
    SU01: Password change dialog box and 'Logon data' tab page
    SU01: Password change dialog box and 'Logon data' tab page
    Downports: CUA change docs, archiving, 12 hour time format
    'Group' Titles are not being displayed.
    ALV form : TOP-OF-LIST on TOP-OF-PAGE with page numbers
    ALV mean value: mean value calculated incorrectly
    ALV Grid: Selection column is no longer displayed
    Message logs displayed after sorting
    Minor performance improvement in PDF generation
    Object pool: Persistent objects are not saved
    OutputDevice name is getting chopped in oac0
    Files not being deleted from the filesystem after archiving
    MS Word as Editor in SAPscript and Smart Forms
    MS Word as Editor in SAPscript and Smart Forms
    MS Word as Editor in SAPscript and Smart Forms
    MS Word as Editor in SAPscript and Smart Forms
    RTF download from Unicode systems
    RTF download from Unicode systems
    Tax amount ignored in transaction total sales
    BW 0RENTOBJECT_ATTR, occupancy cost center missing
    BW master data, time-independent characteristics are deleted
    BW master data, time-independent characteristics are deleted
    Termination CELL_FUELLEN_FEMZ-02 during query generation
    Field symbol not assigned in CL_RSDD_STATOLAP
    BIA: Master data reorganization for Y tables is not adjusted
    BIA: Master data reorganization for Y tables is not adjusted
    BIA shadow index: Enhancement of analysis option
    Inaccuracies in OLAP cache
    Inaccuracies in OLAP cache
    Dump TYPELOAD_LOS with insert in /BI0/06* tables
    Displaying SQL and EXPLAIN in query statistics
    BIA index incorrect after cancelation request
    F4 Hierarchy variable ignores version and date restrictions
    i_objvers: RSD_IOBJNM_GET_FROM_INFOSET
    MDX: Too many values for NON EMPTY and WITH SET
    Termination RTIME_APPEND-02- in program SAPLRRS2
    X299 Brain in CL_RSDRC_MULTIPROV; form GET_PART_IOBJNM-01-
    Buffering the MultiProvider runtime object
    Buffering the MultiProvider runtime object
    Buffering the MultiProvider runtime object
    Buffering the MultiProvider runtime object
    Dynamic DATA table during reading of data
    Compounding and text variable, dynamic filter
    READMODE initial leads to READMODE = A for MultiProviders
    Releasing memory OLAP_CACHE
    Termination SIDS_DIVIDE in SAPLRRSI and hierarchies
    Performance improvement during analysis authorizations
    Text variable with replacement path and exception cells
    Formula variable not replaced (hierarchy deactivated)
    IP: Optimizations for writable InfoProviders
    Termination DMMAN 13; reading of delta buffer improved
    Termination DMMAN 13; reading of delta buffer improved
    The OLAP tunnel
    Planning functions: Distribution with keys
    DB6: Filling the aggregate in blocks with MDC
    DB6: Filling the aggregate in blocks with MDC
    DB6: Improve performance of data load
    RSD_IOBJ_CMP_GET: Compounded navigation attributes
    RSD_IOBJ_CMP_GET: Compounded navigation attributes
    P18:DSO:Dump if you activate too many requests together
    P17:DSO:Postprocessing ODS - activating and updating
    Connection of MultiProvider validation in RSDMPROM
    Post office bank current acct number not checked correctly
    Unclear message for creation of bank details
    Runtime batch selection
    DYNPRO_MSG_IN_HELP runtime error with F1 help for a char
    Change documents for AccessControlList
    Documentation changes for FiMa
    Incorrect read access for immediate repayment settlement
    Loading the runtime repositories with inactive plug-ins
    Loading the runtime repositories with inactive plug-ins
    Loading the runtime repositories with inactive plug-ins
    Variant: Changing sequence of selected fields
    Correction of Note 1099260
    table_illegal_statement in base_api_object_syn
    BP: TaxNumber: Duplicate check for VAT Registration Number
    Dump error when opening a corrupted email from Inbox
    &quot;required&quot; attribute(input field) does not work for HE Lang.
    Closing of popup(duplicate person) not handled properly.
    PCUI : Improving performance for relations fetch.
    R3AD_* stop entry in SMQ1 ERP after start initial/req loads
    error in displaying adobe forms in portal through preview
    BP_XDT: No creation possible of BP who is customer
    MS_WORD_OLE_FORMLETTER: Wrong spec. chrctrs in file download
    RHBEGDA0: No longer possible to shorten objects
    PPPM: Termination on Individual Dev tab page when saving
    Technical preparations for enhancement package
    Document Flow - Object Pool usage control
    Regards
    Gattu

  • Word Mail Merge

    I am using the following code to mail merge data in a table into a Word document:
    call function 'MS_WORD_OLE_FORMLETTER'
          exporting
            WORD_DOCUMENT             = FILEFORM
            HIDDEN                    = 0
            WORD_PASSWORD             =
            PASSWORD_OPTION           = 1
            FILE_NAME                 = FILEDATA
            NEW_DOCUMENT              =
            DOWNLOAD_PATH             = FILEPATH
           PRINT                     = PFPRINT
          tables
            DATA_TAB                  = FDATA
            FIELDNAMES                = FIELDS
         exceptions
           INVALID_FIELDNAMES        = 1
           USER_CANCELLED            = 2
           DOWNLOAD_PROBLEM          = 3
           COMMUNICATION_ERROR       = 4
           others                    = 5.
    Fdata has both text and numeric data in fileds F1, F2, F3,...Fn
    FIELDS has one field containing rows with text data corresponding to the field names of Fdata i.e F1, F2, F3,...Fn.
    My program does not open my word mail merge template, FILEDATA, automatically to fill it with contents of Fdata. Instead a new document is opened with the message "Insert the mail merge fields" and a pop up window asking which filed and record delimeters to use. Where am I going wwrong?

    I will rephrase my question:
    How does the function module 'MS_WORD_OLE_FORMLETTER' work?
    My understnading is that:
    1. WORD_DOCUMENT  is the document that contains the merge fields which will be filled with data. It is the final document that will appear after the function has been executed.
    2. File_Name is the file (can be word document) that will be used as the data source by word_document.
    3. DOWNLOAD_PATH is were File_name is located.
    4. DATA_TAB  contains the merge data. Its contents will be written onto File_name.
    5. FIELDNAMES is he internal table containing the field names that correspond to the fields on WORD_DOCUMENT. It also writes its contants to File_Name.
    Since the data source of a mail merge document should have delimited fields, how do I go about this in the File_Name?
    Regards,

  • Send an e-mail to all my vendors

    hello,
    Can I send throgh the SAP a message (via e-mail, or via fax) to all my vendors or to all the vendors with certion criteria?

    there is no standard transaction to do this.
    I used to send letters to vendors and customers with small program that calls function module MS_WORD_OLE_FORMLETTER
    which triggers the serial letters functionality in Microsoft word on your local PC. so you can write the letter in word, and only do the selection of vendors and submitting variable fields like address ia the function module.
    However, for your case it is probably easier to retrieve the email address from ADR6 table directly and do all the rest outside SAP.
    do SE16 at table LFA1 and get the address numbers from all your vendors.
    then use this address number to pull all email addresses from ADR6 table.

  • Looping through several employee numbers

    My program calculates salary  for a given period for an employer and prints the result in a word doc using the function MS_WORD_OLE_FORMLETTER. This works fine when I have only one employer. When I enter several employee numbers the information is collected correctly in a table but only the first record is printed. I have an impression that the program executes as many times as there are employee numbers instead of executing once by looping through the employee numbers before printing the result. How can I print all the information for several employers?

    The shorter version of the code is as foolows:
    Loop at i_result into w_rt "loop through payroll results for given period
      case w_rt-lgart
      "do some calulations for this employee for
       FIELD-SYMBOLS: <fsd>, <fsl>   type any.
                 CONCATENATE 'MF' w_rt-lgart INTO keyA_Merge.
                 assign component keya_merge of structure T_MergeData to <fsd>.
                 if sy-subrc = 0.
                    <fsd> = <fsd> + w_rt-betrg.
                 endif.
    end case
    endloop
    append t_mergedata to Fdata
    "Now create mail merge for all employees using Fdata
    call function 'MS_WORD_OLE_FORMLETTER'
          exporting
            WORD_DOCUMENT             = FILEFORM
            HIDDEN                    = 0
            WORD_PASSWORD             =
            PASSWORD_OPTION           = 1
            FILE_NAME                 = FILEDATA
            NEW_DOCUMENT              =
            DOWNLOAD_PATH             = FILEPATH
           PRINT                     = PFPRINT
          tables
            DATA_TAB                  = FDATA
            FIELDNAMES                = pFIELDS
    My problem is that the loop executes for one Employee and then goes on to the end of the program to do the mail merge. the program then "restarts" for the necxt employee. However through each program run/cylce the table t_mergedata is appended with the correct information. I would like to first collect all this info before executing the FM for all the records in t_mergedata.

Maybe you are looking for