Upload Flat File in SAP BI/BW

Similar documents
Step by Step Guide How to Copy Flat File from Other Application Server to BI and Load through Info Package

Deleting the Requests from the PSA and Change Log Tables in Business Intelligence

SAP BI/BW LO Extraction

Converting and Exporting Data in XML Format

Step by Step Procedures to Load Master Data (Attribute and Text) from FlatFile in BI 7.0

Step by Step Guide for Language Translation Tool

ALE Settings, for Communication between a BW System and an SAP System

Inventory Management in SAP BW

Extractor in R/3 and Delta Queue

Compounding in Infoobject and Analyzing the Infoobject in a Query

SAP BI Generic Extraction Using a Function Module

Step by Step Guide to Extract Batch Master Data via Generic and Classification Datasource to BW

Working with SAP BI 7.0 Data Transfer Process (DTP)

Creating Transaction and Screen Variants

How to Assign Transport Request for Language Translation?

Data Flow from LBWQ/SMQ1 to RSA7 in ECC and Delta Extraction in BI

Data Extraction and Retraction in BPC-BI

Restricting Search Operators in any Search View

Create Automatic Mail Notification/ Alert for Process Chain Monitoring

Guidelines for Effective Data Migration

Scenario... 3 Step-by-Step Solution Virtual Infocube... 4 Function Module (Virtual InfoCube)... 5 Infocube Data Display... 7

How to Load Data from Flat Files into BW PSA

Embedding Crystal Reports inside ECC ALV Reports

SAP CRM-BW Adapter an Overview

Transfer of GL Master from Source SAP System to a Target SAP System through IDOCS

BW Performance Monitoring

Creating New Unit of Measure in SAP BW

Understanding DSO (DataStore Object) Part 1: Standard DSO

Creation and Configuration of Business Partners in SAP CRM

Different Types of Alerts for Process Chains. Table of Content

ABAP How To on SQL Trace Analysis

Quick Viewer: SAP Report Generating Tool

Step by Step guide of Report-to- Report Interface in BW Reporting

Reverse Transport Mechanism in SAP BI

Understanding BW Non Cumulative Concept as Applicable in Inventory Management Data Model

LSMW: Upload Master Data using Batch Input Recording

How to Generate Stack Xml for Ehp4 and Above Upgrade

Release Strategy Enhancement in Purchase Order

SAP BW - Generic Datasource Function Module (Multiple Delta Fields)

Creating Web Service from Function Modules/BAPIs & Integrating with SAP Interactive Forms

Deploying Crystal Reports on Top of a SAP BI Query

How to Modify, Create and Delete Table Entries from SE16

ABAP Proxy Interfacing

ABAP Debugging Tips and Tricks

Introduction to COPA and COPA Realignment

Deleting the User Personalization done on Enterprise Portal

Step by Step Guide to Create a Generic Datasource Based on Infoset Query Populated Via External Program

SAP CRM Campaign Automation

SAP BW - Excel Pivot Chart and Pivot Table report (Excel)

SAP BW 7.3: Exploring Semantic Partitioning

Inventory Management (0IC_C03) Part - 3

Step by Step Procedure to Block and Debug a CIF Queue Flowing from R/3 to APO System

How to Integrate CRM 2007 WebClient UI with SAP NetWeaver Portal

Creating Content Using SO10 Objects and Text Symbols

SPDD & SPAU Adjustments Handbook

Step by Step Procedure to Create Broadcasters, to Schedule and to Enhance of SAP- BI Queries from Query Designer

Display Options in Transaction SE16

Process Controlled Workflow SRM 7.0 (Using BRF)

Query OLAP Cache Optimization in SAP BW

Web Dynpro ABAP: ALV and Table in Popup Window

SAP Workflow in Plain English

SAP NetWeaver Developer Studio 7.30 Installation Guide

Multi Level Purchase Order Release Strategy

Multi Provider Creation Based on Sales and Planning Info Cubes

SAP CRM 7.0 for Newbies: (Part 1) Simple BOL Object Creation for CRM Webclient UI

Step by Step Guide to Archiving and Deleting of XML Messages in SAP NetWeaver PI

Exposing RFC as Web Service and Consuming Web Service in Interactive Forms in ABAP

SAP MM: Purchase Requisition with Classification and Workflow Approval

Customer Exit Variables in SAP BW/BI Reports First day of the Current/Previous Month

Step By Step Procedure to Create Logical File Path and Logical File Name

How to Create an ecatt?

Merge PDF files in ABAP

Middleware Configuration and Monitoring for Master Data Transfer from SRM to ECC

Sending an Image File Through XI in a File-to-Mail Scenario

Table of Contents. Passing Data across Components through Component Controller between Two Value Nodes

SAP CRM Middleware Configurations

Case Study of a Segregation of Duties Project

Creating and Scheduling Publications for Dynamic Recipients on SAP Business Objects Enterprise

Data Aquisition Techniques in SAP Netweaver BW BI

ABAP for Functional Consultants

Web Dynpro: Multiple ALV Grids and Layouts in ALV

Currency Conversion using Variables in SAP BI -Reporting

Tutorial - Creating Pop Up Window Using New Features in WebDynpro Java CE 7.1 Ehp1

SAP BW Configuration Basic System Settings

SAP CRM 7.0 E2C Setup: CRM via Toolset

Integration of SAP R/3 with BO Universe Using Data Federator Connector

APD to Update Marketing Attributes from SAP BI to SAP CRM

Message handling in SAP CRM Web UI

Configuration and Utilization of the OLAP Cache to Improve the Query Response Time

Connecting to SAP BW with Microsoft Excel PivotTables and ODBO

XSLT Mapping in SAP PI 7.1

Table of Content. SAP Query creation and transport Procedure in ECC6

Configuring HTTPs Connection in SAP PI 7.10

Dynamic Authorization Concept and Role Assignment in BI

First step to Understand a Payroll Schema

Order Split Usage in Production Orders

SDN Community Contribution

SAP CRM System 6.0/7.0. For more information, visit the Customer Relationship Management homepage

Standard SAP Configuration of SMS through HTTP with Third Party SMS Gateway

A Step-by-Step guide on SMTP Configuration and File to Mail Scenario Using Process Integration Scenario in PI 7.1

Transcription:

Applies to: SAP BI/BW Summary This Article demonstrates the step by step process to upload Flat file to an ABAP Table then load the same into SAP BI/BW objects via process Author: Obaidullah Shaikh Company: AG Technologies Created on: 15 September 2011 Author Bio Obaidullah shaikh is a SAP BI Consultant with AG Technologies. He has good skill in technical areas (ABAP) and he has experience of multiple custome reports development and has experience of Migration/upgradation projects as well. 2011 SAP AG 1

Table of Contents Introduction... 3 Create table... 3 ABAP Program... 4 Create Data source... 6 Replicate that Datasource... 7 Create Transformation... 7 Create Info Package... 8 Create DTP... 8 Create Process chain... 9 Create an Event... 10 Start Condition of Process Chain... 10 Schedule the process chain... 10 Create a T-Code... 11 Run that T-Code... 12 Select File... 12 Check the Chain log... 13 Related Content... 14 Disclaimer and Liability Notice... 15 2011 SAP AG 2

Introduction Most of the companies are maintaining some of the transactions in Flat file (Excel Sheet) and they want to load that flat file to SAP BI, there are multiple ways to load Flat file into BW. BI consultant will maintain the Data flow for that flat file and whenever file will come via an email or any other way, BI person will load it manually on daily basis but this is not the right way to load flat file. BI consultant uses any tool to transfer the file from client to Application server and load from there via process chain. But this is also not a best practice in all the types of operating system specially Windows. Because while transferring the file virus will also move and that will create problem in server so the best way is to transfer it via ABAP Code. This document will discuss how can load data from file to ABAP table and then we will load the same to BI object. User just needs to run a Transaction code and select the corresponding file, he want to load. Create table Create a table in BW that will store the records structure of that table will same as flat file 2011 SAP AG 3

ABAP Program Write the following ABAP program in SE38 DATA S_FILE TYPE STRING. To Get Path of csv file that need to loaded in BI CALL FUNCTION 'WS_FILENAME_GET' IMPORTING FILENAME = S_FILE. ZTEST is ABAP TABLE in SAP BI System that will store the records coming from Flat file TABLES ZTEST. DATA: BEGIN OF WA1, MAT(18) TYPE C, PLANT(5) TYPE C, END OF WA1, ITAB LIKE TABLE OF WA1, WA_FINAL LIKE ZTEST, ITAB_FINAL LIKE TABLE OF WA_FINAL. DATA STR TYPE STRING. DELETE FROM ZTEST. CALL FUNCTION 'GUI_UPLOAD' EXPORTING FILENAME FILETYPE = S_FILE = 'ASC' HAS_FIELD_SEPARATOR = 'X' TABLES DATA_TAB = ITAB. DATA J TYPE I. DATA L TYPE I. CLEAR STR. "The Following code will convert the data from internal table to Database Table LOOP AT ITAB INTO WA1. L = STRLEN( WA1-MAT ). Since data is Comma separated that's why a record will be a string e.g. M01, 1000 will be a single string that needs to be separated depending upon "Commas in between the string WHILE WA1-MAT+J(1) <> ','. CONCATENATE STR WA1-MAT+J(1) INTO STR. J = J + 1. 2011 SAP AG 4

ENDWHILE. WA_FINAL-MAT = STR. CLEAR STR. J = J + 1. WHILE J < L. CONCATENATE STR WA1-MAT+J(1) INTO STR. J = J + 1. ENDWHILE. WA_FINAL-PLANT = STR. CLEAR STR. APPEND WA_FINAL TO ITAB_FINAL. J = 0. INSERT INTO ZTEST VALUES WA_FINAL. ENDLOOP. "FM to Trigger Event that will trigger Process chain of Data load DATA EVENT TYPE STRING. EVENT = 'ZPATH_IP'. CALL FUNCTION 'BP_EVENT_RAISE' EXPORTING EVENTID = EVENT. 2011 SAP AG 5

Create Data source Create a DataSource in SAP BI (RSO2 T-code) You can also maintain generic delta also in this data source 2011 SAP AG 6

Replicate that Datasource Replicate the Datasource from RSDS and activate it Create Transformation 2011 SAP AG 7

Create Info Package Create DTP 2011 SAP AG 8

Create Process chain 2011 SAP AG 9

Create an Event Create an event from SM64 that will trigger Chain. Start Condition of Process Chain Schedule the process chain 2011 SAP AG 10

Create a T-Code Create a T-code from SE93. User will just need to run this t-code Enter descrition and select start object as Program and selection screen(report transaction) Enter the ABAP Program name (ZINS_PATH) 2011 SAP AG 11

Run that T-Code Select File After running the T-code, A dialog will pop-up to select the file that is going to be loaded 2011 SAP AG 12

Check the Chain log Data is successfully loaded to BW 2011 SAP AG 13

Related Content http://forums.sdn.sap.com/thread.jspa?threadid=1281874 https://www.sdn.sap.com/irj/scn/wiki?path=/display/scm/move%252ba%252bfile%252bfrom%252bsourc e%252bto%252btarget%252bdirectories%252bin%252bapo https://www.sdn.sap.com/irj/scn/thread?messageid=7224879#7224879 2011 SAP AG 14

Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document. 2011 SAP AG 15