Skip to Content

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.

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Mario Tibollo

    hi,

    maybe I misunderstand the tittle of the post, but I don’t see where in the xls/macro you trigger the chain. No action is set in your example, hence no chain is triggered, i would think. So, can you please explain where the chain is triggered, or maybe change the tittle if you can’t.

    regards,

    M.

    (0) 
    1. Phani KV Post author

      Hi,

      End user will run the Macro in excel it will automatically convert to XLS to CSV  format.

      we have shared drive user will put all excel sheets there only.

      process chain will trigger through start variant and i add screen shot please check.

      Thanks,

      Phani.

      (0) 
      1. Mario Tibollo

        ok got it. The tittle of the blog is not reflecting the content.

        according to the tittle i would expect a macro raising an event in BW or something similar…

        regards,

        M.

        (0) 
        1. Phani KV Post author

          Thanks for asking Mr Tibollo.

          Macro not raising an event. in process chain i am not created an event.it is simple process chain.

          user will run the macro it will automatically convert to XLS to CSV format.

          all files i saved in the AL11 – SAP directories.

          Thanks,

          Phani.

          (0) 

Leave a Reply