Skip to Content
author's profile photo Former Member
Former Member

Excel and Word

Hi Experts,

I have done function manuals,

data: BEGIN OF itab OCCURS 0,

FLAG(1),

END OF itab.

CALL FUNCTION 'WS_EXCEL'

EXPORTING

FILENAME = ''

  • SYNCHRON = ' '

TABLES

data = itab

EXCEPTIONS

UNKNOWN_ERROR = 1

.

its executed to open excel format. its ok.

how to display in word document. what is call function of name?

Reply me soon,

S.Suresh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jun 09, 2008 at 10:47 AM

    Hi Friend,

    There is no easy way to call word from SAP well you can always use OLEDB but for the easy part here is the CODE

    PARAMETERS: PROG(70) DEFAULT

    'C:\Program Files\Microsoft Office\Office\WINWORD.EXE'.

    PARAMETERS: FILE1(70) DEFAULT 'C:\TEMP\TEST.TXT'.

    CALL FUNCTION 'WS_EXECUTE'

    EXPORTING

    PROGRAM = PROG

    COMMANDLINE = 'FILE1'

    INFORM = ' '

    EXCEPTIONS

    FRONTEND_ERROR = 1

    NO_BATCH = 2

    PROG_NOT_FOUND = 3

    ILLEGAL_OPTION = 4

    GUI_REFUSE_EXECUTE = 5

    OTHERS = 6.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi,

      see below code..

      data: p(255) type c VALUE 'C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE'.

      data: r type i.

      CALL FUNCTION 'GUI_EXEC'

      EXPORTING

      command = p

      • PARAMETER = PARAMETER

      IMPORTING

      RETURNCODE = R .

      if r ne 0.

      write: / 'Prog:',p,'not found'.

      endif.

      its executed by open word document..

      Advances,

      S.Suresh.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.