0

I currently have a report which runs for local files (already downloaded from SAP) perfectly. The report is built by a written macro, which uses the path of the local files to run.

For that reason I have to automatically download these files out of the SAP. To write the macro I just saved 2 files local. Now I want to use the macro for all the files in SAP.

I already recorded a SAP VBScript, which opens the file I need.

So what I need now is that you tell me if I'm going the right path or if I missed something important:

  1. installed a scheduled Task, which runs at a certain time a powershell script

  2. (not implemented) Auto Login in SAP, (implemented) open & save the specific file

  3. (not implemented) write the path of the file in the XML

  4. (implemented) powershell script runs automatically a personal macro for specific files written in the XML-file

  5. (implemented) save the report for every single file in the SharePoint

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
F. Michal
  • 19
  • 2
  • 10
  • Do you have the option of scheduling a job and have the files written / sent to you periodically? – vwegert Dec 08 '16 at 06:50

1 Answers1

0

To log into a remote site, you could use:

$creds = Get-Credential
Invoke-WebRequest -Credential $creds -Uri http://your.sap.location

To write a path to an xml file

$pathtostore = c:\yourfilepath.txt
$pathtostore | Export-CliXml c:\yourpath\yourfilename.xml

I can't give much more detail with the question as stated.

Jim Moyle
  • 637
  • 4
  • 11