Process Chains triggering through Macro in Excel
I have got requirement recently working on the Excel based process chains. Everyday new records will be added into the excel sheets and we need to trigger all these files into the BW server through process chain automatically. As we have all these Excel files in the desktop.
I found the solutions
1. Save the files in AL11 (SAP Directories) by using the below function modules.
ARCHIVFILE_CLIENT_TO_SERVER
ARCHIVFILE_SERVER_TO_CLIENT
If we use the above FM you have develop the ABAP program in SE38.
2. Writing the logic in Excel Macro. (No need ABAP Program)
Select the excel sheet go to view menu -> select the Marco -> click on Marco->
Create the new Macro -> give the new Macro name -> select Macro
Next screen will appear.
Sub saveSheetsAsCSV()
Dim i As Integer
Dim fName As String
Application.DisplayAlerts = False
For i = 1 To Worksheets.Count
fName = "D:\usr\sap\DEV\DVEBMGS03\work\STAFFING_PROJECT\ " & i
ActiveWorkbook.Worksheets(i).SaveAs Filename:=fName, FileFormat:=xlCSV
Next i
End Sub
above code will convert xls format to csv format automatically while running the Macro by user
user will update the excel sheets and every day they will run the Macros
It will automatically overwrite the records while running the Macro in excel.
We saved the excel sheet in AL11 – SAP Directories.
Check the data source path – AL11 Directories
Note:- I am not explaining the how to create the DSO, CUBE, Process chains.
Please look at the Process chains daily scheduling.
Process chain triggered daily once a day and every day it will load full. I used the delete PSA request and
delete data target content form cube before loading to cube
Check the daily scheduling
in start process i given the time every morning 6:00 AM.
Hope it will help.
Thanks,
Phani.