- Creating a shared file path at OS level:
- BW Steps
- BOBJ Steps
- Related Content
- 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
Creating a shared file path at OS level:
Creating the ABAP program to delete the previously created file:
*& Report ZBIW_FILE_DELETE_AL11
*& This Program will delete a file from Application server
*& Created BY: Shambhu Gupta
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= ‘Test.csv’ . “file name to be deleted
P_S_DIR= ‘/data/BOBJ/’. ” Path from where file will be deleted
CONCATENATE P_S_DIR P_S_FILE INTO P_S_PATH.
OPEN DATASET P_S_PATH FOR INPUT IN TEXT MODE ENCODING DEFAULT.
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’.
Creating the ABAP program to create the test file on Application server:
* *& Title : Program will create a file and place it at application server
* *& at specified path
* *& Created BY: Shambhu Gupta
“For Application server file
lv_filename TYPE rlgrap–filename.
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–filename.
lp_file = ‘Test.csv’ . “file name to be created
lp_fil2 = ‘/data/BOBJ/’ . ” Path where file will be created
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.
lv_filename = ls_split.
lv_file_str= 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.’.
ENDFORM . “write_file
* End Of Program
Creating the process chain
- Creation of the file-based event
- Attaching the event to the report.
Steps for Creating File Based Event.
1. Login to Central Management Console (CMC), it will appear like below screenshot.
- Type: File
- Event Name: Give any Event Name (Test File Event)
- Description: It is optional, Just mention the
purpose of Event
- Server: By default it will select the available
- File Name: Path of the File, for example (/data/BOBJ/Test.csv)
Once the File Event is created use in the report schedule
Steps for attaching the Event to the Report
Login to BI Launch pad, Right click on the report which need to scheduled based on File Event
Provide all the schedule details like Recurrence, Notification, Prompt so whatever is required, then select Event under this System Events and choose the File Event created