cancel
Showing results for 
Search instead for 
Did you mean: 

MS_WORD_OLE_FORMLETTER

former_member429661
Participant
0 Kudos

Hi all,

i want to call the funktion "MS_WORD_OLE_FORMLETTER" to print multiple documents with the data of my SAP-itab.That what you do if you want to print a bulk letter with WORD where the adresses are stored in EXCEL.

call function 'MS_WORD_OLE_FORMLETTER'
      exporting
        WORD_DOCUMENT = 'X:\Projekte\Dichtheitspruefung\Alle\5_Serienbrief\AN1SAP'
*         HIDDEN = 0
*         WORD_PASSWORD =
*         PASSWORD_OPTION = 1
        FILE_NAME = 'DHPdaten'
*         NEW_DOCUMENT =
        DOWNLOAD_PATH = 'X:\Projekte\Dichtheitspruefung\Alle\5_Serienbrief\'
*         PRINT = PFPRINT
      tables
        DATA_TAB = lt_suchergebnis
        FIELDNAMES = lt_FIELDS
      EXCEPTIONS
        DOWNLOAD_PROBLEM = 1
        NO_DATA_TAB_ENTRIES = 2
        TABLE_MISMATCH = 3
        PRINT_PROBLEMS = 4
      OTHERS = 5.

Inside the FM is a CALL FUNCTION 'GUI_DOWNLOAD'. There i become an error "CONTROL_FLUSH_ERROR" when the FM try's to download the DATA_TAB.

CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
*     BIN_FILESIZE                  =
      filename                      = file
*     FILETYPE                      = 'ASC'
*     APPEND                        = ' '
      write_field_separator         = 'X'
*     HEADER                        = '00'
      trunc_trailing_blanks         = 'X'
*      col_select                    =
*      col_select_mask               =
      CODEPAGE                      = '4110'          "note 1036562
      WRITE_BOM                     = 'X'             "note 1036562
*   IMPORTING
*     FILELENGTH                    =
    TABLES
      data_tab                      = lt_download
   EXCEPTIONS
     file_write_error              = 1
     no_batch                      = 2
     gui_refuse_filetransfer       = 3
     invalid_type                  = 4
     no_authority                  = 5
     unknown_error                 = 6
     header_not_allowed            = 7
     separator_not_allowed         = 8
     filesize_not_allowed          = 9
     header_too_long               = 10
     dp_error_create               = 11
     dp_error_send                 = 12
     dp_error_write                = 13
     unknown_dp_error              = 14
     access_denied                 = 15
     dp_out_of_memory              = 16
     disk_full                     = 17
     dp_timeout                    = 18
     file_not_found                = 19
     dataprovider_exception        = 20
     control_flush_error           = 21
     OTHERS                        = 22.

So, i read in a thread that the 'GUI_DOWNLOAD' can't be used in a "batch" application. What have i to to, that this scenario can work in an webdynpro ABAP ? I did'nt find some code where someone tried this ! Am I on the wrong way ?

Thanks in advance...

--Bernd

Edited by: Bernward Henkel on Aug 24, 2010 5:43 PM

wasn't formatted...

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You aren't going to be able to use GUI_DOWNLOAD or OLE within Web Dynpro ABAP. These are technologies that rely upon the SAPGUI aren't going to be able to run in the web browser.

For this specific functional of bulk letter printing via Word, I would suggest that you just use SAPGUI Classic Dynpro. If you wanted to do the same in Web Dynpro ABAP you would have to try to use the OfficeControl but there isn't functionality for forcing the printing or really for such bulk processing. It would defintely be more difficult to parse in the data. I doubt you could get exactly the functionality of MS_WORD_OLE_FORMLETTER.

The closes to such bulk printing via template in Web Dynpro would be to use Adobe Forms.

former_member429661
Participant
0 Kudos

Hi Thomas,

thanks for the unbelievable fast answer. Is it possible that i'm the first developer who has such a problem ?

--Bernd

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> Hi Thomas,

>

> thanks for the unbelievable fast answer. Is it possible that i'm the first developer who has such a problem ?

>

> --Bernd

Specifically trying to use the old OLE Word interface for this in WDA- Perhaps. As I said many people probably now do such mass correspondence using Adobe Forms.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Bernward,

Were you able to find the solution to incorporate OLE commands inside ABAP WebDynpro?

I have a requirement to generate MS Word documents from within ABAP Webdynpro. I am unable to do it from within ABAP WebDynpro. Any suggestions how I could achieve this?

Thanks

Paul

former_member429661
Participant
0 Kudos

Hi Paul,

my solution is to use sapforms to generate one pdf-files with all letters inside to print as a bulk-letter.

--bernward