Skip to Content

This document briefs about the program object implementation for one of the interesting activities which I did past few days.

To give an introduction about program object – In BusinessObjects we are allowed to execute the external scripts such as batch file, VB script, Java script or even a java code itself using program objects. The advantage is even you can schedule them to run periodically as your BusinessObjects report.We have planned to automate some of our regular housekeeping activities using program objects. Please refer my blog here for some of the list of housekeeping activities. http://scn.sap.com/community/bi-platform/blog/2012/10/22/businessobjects-monitoring-and-housekeeping-activities

One of such activity is archiving the log files created in BusinessObjects installation folders periodically every week.  This is to ensure that the Installation folder size is optimal and manageable. The idea here is to create a program object which take care of the archival process and schedule this to run at regular interval. Let me brief what I did for my requirement.

Size of our Logging folder within BusinessObjects Installation directory keep on increasing on daily basis. We do have a necessity to keep the old log files for at least last two months (retention period). Archived log should not be maintained in Installation folder to keep the size of Installation drive optimum. So we planned to move the old log files from Installation Log folder to a Log backup directory somewhere in a shared drive every 2 weeks for possible future environment investigation.Any log file files that are aged more than 60 days will be deleted permanently from the Log files stored in Shared drive.

Below steps will give you the detailed steps to implement the program objects.

1. Initial Setup in CMC

/wp-content/uploads/2013/04/1_211067.jpg

Make sure the credential you give above has appropriate rights (Logon,Execute) at Operating system level.

2. Adding Program Object

/wp-content/uploads/2013/04/2_211068.jpg

/wp-content/uploads/2013/04/3_211069.jpg

Scheduling Program Object

/wp-content/uploads/2013/04/4_211079.jpg

     Adding program Objects parameter if any (May be parameter for the VB Script) /wp-content/uploads/2013/04/5_211080.jpg

     Adding program Objects logon parameter (OS level where script has to run) if you want to give specifically. If not this details will be taken from Initial CMC Program Object configuration.

/wp-content/uploads/2013/04/6_211081.jpg

     Finally this would be my result and what I required

/wp-content/uploads/2013/04/7_211082.jpg

   Please note Program Objects will be handled by Adaptive Job Servers. Hope you find this interesting.

To report this post you need to login first.

26 Comments

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

  1. Animesh Kumar

    Hi Mani, Nice share.. 😎

    I got one question. Since services are up and running, some of the services will have write lock on the files. How are you moving these files which has write lock over to the archiving folder.

    ~Animesh Kumar

    (0) 
    1. Manikandan Elumalai Post author

      Thanks for the comments Animesh,

      Please note am always moving log files that are atleast 15 days old, not the latest ones.

      I think I need to add bit more information in the document to make it more clear.

      Thanks,

      Mani

      (0) 
    1. Manikandan Elumalai Post author

      Hi Emmanuel,

      Try the below VB Script for Log file movement,

      ————————————————————————————————————

      Dim SOURCE, TARGET
      Dim fso, SourceObj, TargetObj, fileObj

      SOURCE = “D:\BI Platform\SAP BusinessObjects Enterprise XI 4.0\logging”
      TARGET = “D:\BOLogs2\”

      Set fso = CreateObject(“Scripting.FileSystemObject”)
      Set SourceObj = fso.GetFolder(SOURCE)

      For Each fileObj in SourceObj.Files

      If DateDiff(“d”, fileObj.DateLastModified, Now) > 150 Then
      fileObj.Move (TARGET)
      End If

      Next

      ————————————————————————————————————

      Regards,

      Mani

      (0) 
      1. Jawahar Konduru

        Hi Mani,

        I did try this script. But slightly changed to delete the files instead of moving. I am trying to run the script on BO Server, it is not allowing to delete the files. But i can manually delete the files. I have admin privileges on the server. Any thoughts?

        Dim SOURCE

        Dim fso, SourceObj, TargetObj, fileObj

        SOURCE = “D:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\Logging”

        Set fso = CreateObject(“Scripting.FileSystemObject”)

        Set SourceObj = fso.GetFolder(SOURCE)

        For Each fileObj in SourceObj.Files

        If DateDiff(“d”, fileObj.DateLastModified, Now) > 90 Then

        fileObj.delete true

        End If

        Next

        (0) 
        1. Manikandan Elumalai Post author

          Hi Jawahar,

          Have you tried Run as Administrator option. I think you might be missing rights related to delation rights through scripts. I would recommend you to go ahead and check with your OS administrator for appropriate rights.

          Thanks

          Mani

          (0) 
  2. karthik Prasath

    Hi Mani,

    How can I execute the shell script available in a Linux server named let’s say abc in a path /opt/bubobj/remove.sh through the program object?

    Thanks,

    Karthik

    (0) 
    1. Manikandan Elumalai Post author

      Karthik,

      I havent tried it yet in Linux box. But it should work as long as you have appropriate rights and logical path access (Linux drive mapped in windows as logical drive) you should be able to do it

      Regards

      Mani

      (0) 
    1. Chandrashekhara Kotrappa

      Michael,

      Its an old post, but I was also looking for a better answer to this question. The only workaround I found is to get the Input FRS path for that program & modify it from there. It would be nice if SAP comes up with option to open/download it & also upload it back with replace option as given with the Excel files in BI Launchpad.

      -CK

      (0) 
  3. Missy Mazzola

    Hi Mani,

    How do I set this up such that it will move the logs from multiple webi servers? Potentially move all logs from each webi server to one location even on another server? Do I have to have separate scripts for each webi server? And where woud I explicitly name the server (fully qualify it)?

    Any light you or anyone else can shed would be very helpful!

    Thanks,

    Missy

    (0) 
  4. Thomas Evans

    I did something similar (with the Program Object) but used a simple batch file to delete some logs:

    REM ****SAP BO Housekeeping****

    sc stop BOEXI40Tomcat
    sc stop BOEXI40SIATEST01

    RD /S/Q “D:\Program Files (x86)\SAP BusinessObjects\Tomcat6\logs”
    RD /S/Q “D:\Program Files (x86)\SAP BusinessObjects\Tomcat6\work\Catalina”

    sc start BOEXI40Tomcat
    sc start BOEXI40SIATEST01

    Hope this helps someone 🙂

    Thanks,
    Thomas

    (1) 
  5. Patricia Ciavarelli

    Hi-

    I had program objects running well in 3.1 but I am having issues in 4.0 SP5.

    Here is what is happening to me.

    1.  If I access the script in its original (pre-import to BObj) location, my user can run the entire script:  Access file, edit file to change delimited from “;” to “|” and delete any quotation marks from the file, then SFTP the file to another server and delete the file to empty the directory for tomorrow’s run.

    2.  When I run the file after importing through BObj, The script is still able to SFTP the file to the other server, but it neither edits the file first, nor is it able to delete it.

    How can I make sure that my domain user (me) has proper access to the imported location of the script so that the script is able to reach out and do what it needs to…?

    Thanks-

    Patti

    (0) 
  6. Ranjith Jacob

    Hi Mani,

    thank you for the blog. I am following the blog but the screenshots are not clear. please can you tell the option selected in second screenshot. is it folder ? should we create a new folder? also you are giving the vbs script from your local desktop, I am running the script in linux, so should I point the os path where script resides?

    thanks,

    Ranjith

    (0) 
    1. Animesh Kumar

      Hello,

      If you click on the picture it will zoom-in. you can then see the details. BTW 2nd picture tells to add a program file i.e. CMC >> Folders >> inside a folder right click ADD > Program file.

      you would not be able to run vbs script on linux, unless you try to accommodate wine command with it. But you should not use wine application on an enterprise server.

      Animesh

      (0) 
  7. Michael Artz


    Hi Thanks so much for this tutorial and I have a question!

    I am using a third party jar, opencsv for this app.

    If I did not need opencsv, I could deploy it to BOE and I would not need to package or extract the jars that the program needs. The reason being that BusinessObjects already has them in the java/lib folder – as you know!

    However, how can I include the opencsv jar without packaging all the jars with my runnable jar? Basically, I need to do the same as “configure build path” in Ecplise for my project, but I need to do that through the Business Objects platform, so that I am configuring their build path.

    Do you know what I’m talking about?

    (0) 

Leave a Reply