Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9146

Re: Execute an Excel-file via SAP VBS

$
0
0

Hi Lutz,

 

slowly, I realize what this is about.

 

1. You could maintain your way and try the following.

for example:

 

Instead of using:

 

session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").selectedNode = "F00009"

session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").pressKey "Enter"

 

to use this:


session.findById("wnd[0]/tbar[0]/btn[71]").press

session.findById("wnd[1]/usr/txt130_FIND").text = "myExcel-File"

session.findById("wnd[1]/tbar[0]/btn[0]").press

session.findById("wnd[0]/usr/cntlIMAGE_CONTAINER/shellcont/shell/shellcont[0]/shell").pressKey "Enter"

 

2. Or you could start with the favorites also a VB script , which then launches an Excel macro.

for example:

 

. . .

set Wshell = CreateObject("WScript.Shell")

wshell.run "c:\tmp\myExcel-File_Auto_Open.xlsm",1,false

...

 

or:

. . .

on error resume next

Set xclApp = GetObject(, "Excel.Application")

If Err.Number <> 0 Then

  Err.Clear

  Set xclApp = CreateObject("Excel.Application")

End If

on error goto 0

 

xclapp.ScreenUpdating = false

xclapp.Visible = false

xclapp.DisplayAlerts = false

xclApp.Workbooks.Open("c:\tmp\myExcel-File_No_Auto_Open.xlsm")


xclapp.Run "myExcel-File_No_Auto_Open.xlsm!myExcel-Macro", wscript.arguments(0), wscript.arguments(1)

. . .

 

3. Or you could use GuiXT and InputAssistant and the command pushbutton with parameter process: Synactive         and    Synactive documentation

 

WithPushbuttonyou can create your own pushbuttons within an SAP screen or within the toolbar. You can make both the menu functions and the navigation to other transactions directly accessible with your own pushbuttons.


  • Pushbutton (row,column)"Pushbutton text" "FCode" Process="..." 
    Adds a pushbutton on position (row,column). The pushbutton invokes the internal codeFCode. This can be a code from the menu, e.g. SCMP, a transaction code like /NFB01 or/OMM02 or a F-key or a combination of F-keys in format /nn.
    Process="..."  relates to the InputScript file. You can omit the "fcode" parameter if only "Enter" is needed in order to continue with the transaction.



4: Or with GuiXT and without InputAssistant:


With Image you can display image files in the SAP screens.What is the point of having images and graphics in SAP screens? Four principal reasons spring to mind. Firstly, to create a recognizable context. Secondly, to orientate us within a screen. Thirdly, to give the screen a personal, friendly touch. Fourthly, images can carry a mass of vital information, in particular if the choice of image is data dependent.


By clicking on the image, you can start PC applications. This is obtained by using the additional parameter Start="string":

Image (row,column)"Name of image file" Start="string"

  • You can display documents of all registered file types
  • You can start .exe or .bat files with parameters


5. Or . . .


Regards,

ScriptMan

 

 

 

 

 

 



Viewing all articles
Browse latest Browse all 9146

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>