Feb 25, 2018

Transport or Migrate BEx Query changes from one environment to another (Admin)

Transport or Migrate BEx Query changes from one environment to another

In order to transport/migrate BEx query from lower environments to higher environment, follow below steps:

1) Login to SAP Logon Dev system

2) Go to T-code /nse01. Below screen will appear. Click on Display button at the bottom

3) You should be able to see your latest request number in the queue which needs to be transported/migrated to next system (in my case Quality environment)

4) Expand the request to root level and then starting downwards release each of the root requests first then the main one by clicking on Truck symbol (i.e. Release Directly). You'll be able to see all your changes in another system.

Feb 14, 2018

Automation of BW scheduled Jobs linked to BO Webi reprts




If BOBJ reports are scheduled to run on daily recurrence and for some reason if BW loads get delayed or failed, BOBJ report will not show the latest data.



To overcome the current scenario we are going to have BO reports scheduled based on file events. The file will be created based on the successful completion of BW data loads/process chains. This would make sure the report is generated and sent to users only if the process chain completes successfully.


In BW, we have created an ABAP program to create a test file on application server. This directory, where the file is created, is mounted on both BW server as well as BOBJ server. BOBJ reports will be scheduled prior to this file creation in BW. In BOBJ once the schedules starts, Event will continuously search for the file. In case the file is available prior to BOBJ report schedule time, Event doesn’t process. It will internally check with timestamp of BOBJ report schedule and file creation.  So, we are deleting the old file and replacing it with a new file after BW data loads.


Below is high level summary of the steps involved:

  • Create a share drive in BW and mount it to BOBJ server so that it can be accessed by both BW and BOBJ server. This is required so that file can be created in BW side and read in BOBJ side.
  • Create an ABAP Program to delete the previously created file
  • Create an ABAP program to create a sample test file on Application server
  • Create the File based Event on the BOBJ side and assign this event to the desired Report for scheduling


  • Accuracy in data since the report generates only after BW data load finishes
  • Incorrect data Reports aren’t sent to users if BW loads fail (especially useful on weekends wherein there is no monitoring)


Creating a shared file path at OS level:

Create a share drive in BW and mount it to BOBJ server so that can be accessed by BW system and BOBJ system with full rights with an admin user.  For example, \\AZSXX2120\data\BOBJ\ is directory that we created in BW where test file will be written. This file can be read from the BOBJ side.  This step is done by our BASIS team.

BW Steps

We have created two ABAP program to delete and create the test file. We included these two program in a process chain and attached the process chain with our transactional data load process chain. This helped to create the file only at the end of all transactional data load.

File deletion ABAP code:
*& Sample Testing. This program will delete a file from Application *& Server


data: p_s_path type pathextern. " Complete filepath
data: p_s_file type pathextern." File name
data: p_s_dir type pathextern. " Directory

p_s_file ='Orders.csv'.
"file name to be deleted

p_s_dir = '\AZSXX2120
\data\BOBJ\'. " Path from where file will be deleted

concatenate p_s_dir p_s_file into p_s_path.
condense p_s_path.

open dataset p_s_path for input in text mode encoding default.

if sy-subrc = 0.
close dataset p_s_path.
delete dataset p_s_path.

if sy-subrc eq 0.
write: 'File Deleted Succesfully', p_s_path.
write: 'No Authorization to delete or no file exists', p_s_path.

write: p_s_path, 'File does not exist'.

File Creation ABAP code:
*& Program will create a file and place it at application server

tables: rlgrap.
data: lv_file_str type string . "file Path For Application server file
data: lv_msg_text(50),
type localfile.

data l_lines type i.
data ls_split type string.
data lt_split like table of ls_split.
data lp_file type localfile.
data lp_fil2 like rlgrap.
= 'Orders.csv'. "file name to be created
= '\AZSXX2120\data\BOBJ'. " Path where file will be created

at line-selection.

call transaction 'AL11' .

* Start of selection

split lp_file at '.' into lv_file_str lv_filename .

translate lv_filename to upper case .

if lv_filename = 'CSV' .

clear : lv_filename .

split lv_file_str at '\' into table lt_split.
describe table lt_split lines l_lines.
* file name

loop at lt_split into ls_split.
if sy-tabix eq l_lines.
= ls_split.

= lp_file .
if lv_file_str is not initial.
perform write_file .
message 'File Path Needed .' type 'W'.
message '.CSV File Needed .' type 'W'.

free :lv_filename ,lt_split ,l_lines ,lv_file_str.
*& Form write_file – This will create a file at Application Server

form write_file .

concatenate lp_fil2 lv_filename '.csv' into lv_filename .
condense lv_filename no-gaps .
open dataset lv_filename for output in text mode
encoding default message lv_msg_text.

if sy-subrc eq 0.
write: 'File' ,lv_filename ,'created Successfully at Application server.'.
write: 'File' ,lv_filename ,' cannot get created at Application server.'.

The above two program in the process chain are included in our transactional data load chain. This ensures that file would be created only after BW transactional load is completed. After all sequences, BW system will write file on /data/BOBJ mount or share drive.

BOBJ Steps:

From the Business Objects side, we will be creating file-based event and attaching the event to the report. Once the recurrence schedule starts, the event will continuously search for the files specified in the path. If the file occurs prior to schedule time, event will not trigger, internally it will check with time stamp of file creation and schedule time. In case if the file occurs then need to delete it and write the file. Once the file placed, event will get triggered and schedule process starts to run the report.