Run MS Office and other utilities program using ABAP program

The purpose of this report is to run MS office and other utility *.EXE file using ABAP program or report.
We will see how to find the *.EXE program in WINDOWS XP.










  1. Go to the C: drive check the *.EXE file you would like to run.
In this as shown below:




Similarly check for EXCEL, PICTURE manager etc.
  1. Go the transaction SE38 and create a executable report.
  2. We have created a program with push button to execute MS office program   and other *.EXE programs.
  3. Please find the code below:
---------------------------------------------------------------------*
*& Report  ZOFFICE_COCKPIT
*&
*&---------------------------------------------------------------------*
*&Name :http://sapmatrix.blogspot.in/
*&
*&---------------------------------------------------------------------*

REPORT  ZCOCKPIT.


SELECTION-SCREEN :begin of BLOCK M1 with FRAME  TITLE text-001.
  SELECTION-SCREEN  PUSHBUTTON /15(20) text-002  USER-COMMAND word."Word
  SELECTION-SCREEN  PUSHBUTTON /15(20) text-003  USER-COMMAND excel."Excel
  SELECTION-SCREEN  PUSHBUTTON /15(20) text-004  USER-COMMAND power."Power Point
  SELECTION-SCREEN  PUSHBUTTON /15(20) text-005  USER-COMMAND outl."Outlook
  SELECTION-SCREEN  PUSHBUTTON /15(20) text-006  USER-COMMAND pict."Picture manager
  SELECTION-SCREEN  PUSHBUTTON /15(20) text-007  USER-COMMAND script."MS script editor
SELECTION-SCREEN:END OF BLOCK M1.


AT SELECTION-SCREEN.
  data :l_ucomm TYPE  sy-ucomm.
  l_ucomm = sy-ucomm.

  CASE l_ucomm.
    WHEN 'WORD'.
      CALL FUNCTION 'GUI_RUN'
        EXPORTING
          command = 'C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE'
               .

    WHEN 'EXCEL'.
      CALL FUNCTION 'GUI_RUN'
        EXPORTING
          command = 'C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE'
      .
    WHEN 'POWER'.

      CALL FUNCTION 'GUI_RUN'
        EXPORTING
          command = 'C:\Program Files\Microsoft Office\OFFICE11\POWERPNT.EXE'
      .
      .
    WHEN 'OUTL'.
      CALL FUNCTION 'GUI_RUN'
        EXPORTING
          command= 'C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE'
      .
    WHEN 'PICT'.
      CALL FUNCTION 'GUI_RUN'
        EXPORTING
          command = 'C:\Program Files\Microsoft Office\OFFICE11\OIS.EXE'"PICTURE MANAGER
        .
        WHEN 'SCRIPT'.
      CALL FUNCTION 'GUI_RUN'
        EXPORTING
          command = 'C:\Program Files\Microsoft Office\OFFICE11\MSE7.EXE'" MS Script
      .
    WHEN OTHERS.
  ENDCASE.
  1. now Execute  the Program.
  2.  










     


    Now click the mouse on MS POWERPOINT 
     







    This will open a power point all other *.EXE also works in the same way.  















Protected by Copyscape Web Copyright Checker

No comments:

Post a Comment

/*Newer Post*/ Older Post Home