You are on page 1of 26

SAP How-to Guide

Database & Technology


SAP Business Warehouse

How To... Load a File into SAP BW Integrated Planning

Applicable Releases:
SAP BW 7.3 or higher

Version 3.6
December 2016

Copyright 2016 SAP AG. All rights reserved.

All other product and service names mentioned are the trademarks of

No part of this publication may be reproduced or transmitted in any form

their respective companies. Data contained in this document serves

or for any purpose without the express permission of SAP AG. The

informational purposes only. National product specifications may vary.

information contained herein may be changed without prior notice.

The information in this document is proprietary to SAP. No part of this

Some software products marketed by SAP AG and its distributors

document may be reproduced, copied, or transmitted in any form or for

contain proprietary software components of other software vendors.

any purpose without the express prior written permission of SAP AG.

Microsoft, Windows, Excel, Outlook, and PowerPoint are registered

This document is a preliminary version and not subject to your license

trademarks of Microsoft Corporation.

agreement or any other agreement with SAP. This document contains

IBM, DB2, DB2 Universal Database, System i, System i5, System p,


System p5, System x, System z, System z10, System z9, z10, z9, iSeries,
pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390,
OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power
Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER,

only intended strategies, developments, and functionalities of the SAP


product and is not intended to be binding upon SAP to any particular
course of business, product strategy, and/or development. Please note
that this document is subject to change and may be changed by SAP at
any time without notice.

OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS,

SAP assumes no responsibility for errors or omissions in this document.

HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex,

SAP does not warrant the accuracy or completeness of the information,

MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and

text, graphics, links, or other items contained within this material. This

Informix are trademarks or registered trademarks of IBM Corporation.

document is provided without a warranty of any kind, either express or

Linux is the registered trademark of Linus Torvalds in the U.S. and other
countries.
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either
trademarks or registered trademarks of Adobe Systems Incorporated in
the United States and/or other countries.
Oracle is a registered trademark of Oracle Corporation.
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open
Group.
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame,
and MultiWin are trademarks or registered trademarks of Citrix Systems,
Inc.
HTML, XML, XHTML and W3C are trademarks or registered trademarks
of W3C, World Wide Web Consortium, Massachusetts Institute of
Technology.

implied, including but not limited to the implied warranties of


merchantability, fitness for a particular purpose, or non-infringement.
SAP shall have no liability for damages of any kind including without
limitation direct, special, indirect, or consequential damages that may
result from the use of these materials. This limitation shall not apply in
cases of intent or gross negligence.
The statutory liability for personal injury and defective products is not
affected. SAP has no control over the information that you may access
through the use of hot links contained in these materials and does not
endorse your use of third-party Web pages nor provide any warranty
whatsoever relating to third-party Web pages.
SAP How-to Guides are intended to simplify the product implementtation. While specific product features and procedures typically are
explained in a practical business context, it is not implied that those
features and procedures are the only approach in solving a specific

Java is a registered trademark of Sun Microsystems, Inc.

business problem using SAP NetWeaver. Should you wish to receive

JavaScript is a registered trademark of Sun Microsystems, Inc., used

additional information, clarification or support, please refer to SAP

under license for technology invented and implemented by Netscape.

Consulting.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP

Any software coding and/or code lines / strings (Code) included in this

BusinessObjects Explorer, StreamWork, and other SAP products and

documentation are only examples and are not intended to be used in a

services mentioned herein as well as their respective logos are

productive system environment. The Code is only intended better explain

trademarks or registered trademarks of SAP AG in Germany and other

and visualize the syntax and phrasing rules of certain coding. SAP does

countries.

not warrant the correctness and completeness of the Code given herein,

Business Objects and the Business Objects logo, BusinessObjects,

and SAP shall not be liable for errors or damages caused by the usage of

Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other

the Code, except if such damages were caused by SAP intentionally or

Business Objects products and services mentioned herein as well as their

grossly negligent.

respective logos are trademarks or registered trademarks of Business

Disclaimer

Objects Software Ltd. Business Objects is an SAP company.

Some components of this product are based on Java. Any code change

Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere,

in these components may cause unpredictable and severe malfunctions

and other Sybase products and services mentioned herein as well as their

and is therefore expressively prohibited, as is any decompilation of these

respective logos are trademarks or registered trademarks of Sybase, Inc.

components.

Sybase is an SAP company.

Any Java Source Code delivered with this product is only to be used by
SAPs Support Services and may not be modified or altered in any way.

Document History
Document Version

Description

1.0 April 2007

Initial release of this how-to solution

2.0 August 2007

2.1 October 2007

2.2 November 2007

2.3 December 2007

2.4 February 2008

3.0 August 2012

Added option for SAPGUI based file upload (for example from
BEx Analyzer)
Disabled variable and file browse fields after selecting
"Upload"
Fixed incorrect data during merge phase when field
conversion is turned on
Fixed runtime error CALL_FUNCTION_CONFLICT_ GEN_TYP
when field conversion is turned on
Added automatically conversion of URL parameter to upper
case
Added chapter with important notes
Maximum of 500 message in output log to prevent seemingly
hanging uploads with many errors
New planning function type for "File Download"
Removed limitation on InfoObjects
Support for variables with multiple values, intervals, or
selection options
Fixed rounding errors when uploading currency amounts with
three or more decimals
Corrected key figure values in new example files
Support of user exit variables
Fixed error when variable is restricted to single value but field
is not included in file
Support for key figure values with thousand separator
Fixed error when uploading key figure values with decimal
comma
Enabled conversion exit in variable screen
Removed context info from message output (can be enabled
again with show_messages parameter)
Added search help for all selection fields including special
characteristics like fiscal period
Added check that 0INFOPROV must be filled for uploads on
MultiProviders
Support for CSV format for upload and download (new
parameters for data separator and escape character)
Improved auto-detection of file format
Added info messages to display version and detected file
format
New parameter for checking for duplicate records
New parameter to define display of +/- sign for download
New and improved alternative user interface
Function to generate the required master data for ZIP_*
InfoObjects
Added BADI for performing custom transformations during
upload and download
Integrated File Upload/Download with Report-ReportInterface

3.1 March 2013

3.2 March 2014

3.3 October 2015

3.4 December 2015

3.5 June 2016

3.6 December 2016

New parameter setting for download to select field description


instead of technical name in header line
Automatic recognition of UTF byte-order-mark during upload
Added ready-for-input variables for all parameters
Added support for XLS format for upload with SAPGUI
Added load from application server (which enables upload
from and download to Analysis Office)
File Upload is now supported for SAP BW 7.40
Minimum release increased to SAP BW 7.30
Updated screen shots to show GUI-based planning modeler
and web-based file upload/download application
Added enhancement to support F4-BADI
Added option to sort variables on selection screen
New option to display instructions and support information to
end-users (See Appendix 5.2)
Fixed value help for compounded characteristics in SAP BW
7.40
Fixed dump with new UI and data preview in SAP BW 7.40
Correction of show_previews parameter documentation
Fixed decimal places formatting when downloading quantity
key figures
Performance improvements for file download
Added support for formula variables
New option to set maximum number of visible messages in log
(See Appendix 5.2)
Fixed issue when using delta mode and duplicate record check
Added support for exit variable which are ready for input
Download of key figures other than Amount or Quantity
will take Decimal setting in to consideration when using
Convert Fields option
Fixed file format derivation when downloading using SAPGUI
connection and prompting for file name, for example in
transaction RSPLAN
Added description on how to switch system connection for
Excel-based solution (Analysis Office workbook)
Improved error message in case of character
format/encoding issues
Added detection of incorrect field separator (semicolon
instead of comma and vice versa)
Fixed check of header line parameter in file download
New Standard File Upload functionality
Support for Advanced DataStore Objects for SAP BW powered
by SAP HANA

Typographic Conventions
Type Style

Description

Example Text

Words or characters quoted


from the screen. These
include field names, screen
titles, pushbuttons labels,
menu names, menu paths,
and menu options.
Cross-references to other
documentation

Example text

Emphasized words or
phrases in body text, graphic
titles, and table titles

Example text

File and directory names and


their paths, messages,
names of variables and
parameters, source text, and
names of installation,
upgrade and database tools.

Example text

User entry texts. These are


words or characters that you
enter in the system exactly
as they appear in the
documentation.

<Example
text>

Variable user entry. Angle


brackets indicate that you
replace these words and
characters with appropriate
entries to make entries in the
system.

EXAMPLE TEXT

Keys on the keyboard, for


example, F2 or ENTER.

Icons
Icon

Description
Caution
Note or Important
Example
Recommendation or Tip

Table of Contents
1.

Business Scenario............................................................................................................. 1

2.

Background Information ...................................................................................................2

3.

Prerequisites .....................................................................................................................3

4.

Step-by-Step Procedure................................................................................................... 4
4.1

4.2
4.3
4.4
5.

Planning Function Type ........................................................................................................ 4


4.1.1
Check Prerequisites ................................................................................................ 4
4.1.2 Import Objects ......................................................................................................... 5
4.1.3 Maintain Master Data .............................................................................................. 7
Planning Model....................................................................................................................... 8
Example for "File Upload"................................................................................................... 14
Example for "File Download" ..............................................................................................17

Appendix......................................................................................................................... 19

How To... Load a File into SAP BW Integrated Planning

1.

Business Scenario

You are using SAP BW Integrated Planning and have the requirement to load external data into your
planning application. Typically data is loaded into SAP BW using the data staging functionality.
However, you are looking for an easier way to upload data from a file that can be performed by business
planners.
Note
Starting with SAP BW 7.5 SP 4 there is standard functionality available to upload data. This
makes most features provided by this how-to solution obsolete. Please always try to use
the standard and therefore supported file upload feature. See the following blog to get
started: https://blogs.sap.com/2016/07/21/planning-engine-improvements-for-bpcembedded-model-pak-and-bw-ip-with-bw-750-sp4/
This paper describes a solution that allows business planners to load a file directly into their planning
application using a web browser. The following screen shows the user interface. The planner is
prompted for the file name and simply chooses Upload. The system will load the file and validate its
content. If there are no errors the planner can save the changes. The newly loaded data is immediately
available in planning applications and queries.

The updated solution also provides a way for planners to download data in various file formats. The
download files can be edited and uploaded in the same format.

December 2016

How To... Load a File into SAP BW Integrated Planning

Additional features:

Various file formats: tab-delimited, fixed length, XML, CSV, or XLS


Various code pages: Unicode, UTF-8, UTF-16, and other code pages
Option for overwriting of or appending to existing data including delta mode
Text files with or without header line
Conversion of numbers and dates according to user settings
Conversion of characteristic value according to conversion routine (for example ALPHA
conversion or external to internal material numbers)
Conversion of amounts according to currency format configuration
Flexible definition of fields and field order in upload file
Support for virus scanning (if installed with SAP NetWeaver)
Direct upload and download of file without any prompts (for example from BEx Analyzer)

After the initial implementation there are no program changes required in order to use these features.
All options can be configured using the Planning Modeler.
For additional information about this solution please check the following blogs:
https://blogs.sap.com/2014/08/13/how-to-load-a-file-into-bw-integrated-planning-version-3/

2.

Background Information

The solution has three parts: a planning function type for processing the loaded data, a planning
function that contains the configuration of the file format, and a user interface for uploading a file.
The first part is a new planning function type. This new upload function type is implemented in ABAP
and contains the logic to process the loaded data. It converts the data from various external formats
into the internal format of SAP NetWeaver and also performs several consistency checks. Just like any
other planning function type, the upload function type validates the data against characteristic
relationships and performs checks against data slices.
The second part is a planning function based on the newly defined upload planning function type. In this
planning function you configure the characters set (Unicode, non-Unicode, or code page), whether the
file data should overwrite or be added to existing data, and whether the file contains a header line or not.
The final part is a Web Dynpro application which provides a self-explaining user interface for uploading
files. This application allows the user to enter the file name or browse for the file on his computer and
then execute the upload. The application will display any messages generated by the upload function. If
there are errors the user can correct the mistakes and load the file again. If the upload is successful the
application allows the user to save the changes into the corresponding InfoCube.

December 2016

How To... Load a File into SAP BW Integrated Planning

Note
The solution is not intended for mass data uploads. Processing large files with the upload
function can take a long time. It is recommended to use the standard data staging
functionality of SAP BW to load those large files instead.
Similarly, three parts exist for the file download: a planning function type for compiling the data into a
file structure, a planning function that contains the configuration of the file format, and a user interface
for downloading a file.

3.

Prerequisites

This section lists the prerequisites that must be in place before you can use this how-to guide and the
File Upload/Download features.
Release:

SAP BW release 7.3 or higher

A BI Java Stack is not required.


Upgrade from previous versions:
CAUTION
Importing the new version of the File Upload/Download as a transport will overwrite any
modifications you made to the previous solution! If you made any modifications, backup
the custom coding before importing the new transport.
The current version contains enhancement spots that allow you to add custom logic to
enhance the solution without modification.
Limitations:

The File Upload/Download is available in English only

Both File Upload and Download require data change authorization and will temporarily lock the
selected data (just like any other planning function)

December 2016

How To... Load a File into SAP BW Integrated Planning

4.

Step-by-Step Procedure

Here is a high-level overview about the steps that need to be performed:


Part 1 Planning Function Type
Part 1a Check Prerequisites
Part 1b Import Objects
Part 1c Maintain Master Data
Part 2 Planning Model
Part 3 User Interface

4.1

Planning Function Type

...

4.1.1

Check Prerequisites

1. Go to transaction RSA1.
Example
We will use InfoCube 0DBPS_C01 as an example. Check that the InfoCube exists and is
active. If it does not exist in your system, activate it from the BI Content.

2. Check that InfoArea 0BWTCT_PLAN exists and is active. If it does not exist in your system,
activate it from the BI Content.
Note: The new objects will be created in this InfoArea.

December 2016

How To... Load a File into SAP BW Integrated Planning

3. Go to transaction RSD1.
Characteristic 0TCTIOBJNM will be used for the parameter definition of the planning function.
Check that the InfoObject exists and is active. If it does not exist, activate it from the BI Content.
Optionally, load the master data and texts for characteristic 0TCTIOBJNM. This will make it
easier to select the InfoObjects that you want to include in the upload file.

4.1.2 Import Objects


...

1. All necessary objects are included in a transport.


Unzip the files and copy them into the transport directory of your BW system (K9*.CBW into
COFILES directory, R9*.CBW into DATA directory).
Then go to transaction STMS, select your system, add the new transport to the import queue,
and finally import the transport.
For more information, please see SAP Note 13719.
CAUTION
Importing the new version of the File Upload/Download as a transport will overwrite any
modifications you made to the previous solution! If you made any modifications, backup
the custom coding before importing the new transport.

December 2016

How To... Load a File into SAP BW Integrated Planning

2. Go to transaction SE24 and check that ABAP classes ZCL_RSPLF_FILE_UPLOAD and


ZCL_RSPLF_FILE_DOWNLOAD exist and are active.

3. Go to transaction RSPLF1 and check that planning function types ZRSPL_FILE_UPLOAD and
ZRSPL_FILE_DOWNLOAD exist and are active.

4. Go to transaction SICF and check that the services for ZRSPLF_FILE_UPLOAD_V3 and
ZRSPLF_FILE_DOWNLOAD_V3 are activated (or ZRSPLF_FILE_UPLOAD
ZRSPLF_FILE_DOWNLOAD if you want to use the old version).
You can find the services under /default_host/sap/bc/webdynpro/sap/
Right-click on it and select Activate service.

December 2016

How To... Load a File into SAP BW Integrated Planning

4.1.3

Maintain Master Data

...

Some master data and text table entries are required for the solution to work properly. You can
generate these entries automatically. Go to transaction SE37 and execute function module
ZRSPLF_FILE_UPLOAD_MASTER_DATA.
Note
The texts will be generated for "English" language only. You can use standard functionality
to translate the texts.
A log will be displayed at the end of the generation. Check that all ZIP_* InfoObjects have been updated
correctly.

You can also find these InfoObjects in transaction RSA1, InfoObject Catalog ZIP_FILE_UPLOAD_CHA.

December 2016

How To... Load a File into SAP BW Integrated Planning

4.2

Planning Model

...

1. Launch the Planning Modeler (transaction RSPLAN) and select the InfoProvider that you want to
load data into.

The example in this how-to paper uses InfoProvider 0DBPS_C01.

2. Go to Aggregation Level and create an aggregation level.


Example
Aggregation Level: FILE_LVL.

December 2016

How To... Load a File into SAP BW Integrated Planning

3. Select the fields you want to upload. Save and activate the aggregation level.
Example
Used fields: 0CURRENCY, 0FISCVARNT, 0FISCYEAR, 0D_REVEN,
0D_CUSTOMER, 0D_VERSION

4. Go to Filter and create filter.


Example
Filter: FILE_FLT.

5. For example, add Version to the filter and restrict it to variable "Plan version" (0D_PVERS).
Typically you will include fields for organizational criteria as well here.

December 2016

How To... Load a File into SAP BW Integrated Planning

Exit variables are supported. They will be processed in the first phase (I_STEP = 1).
Important
The filter is used for locking data. If you do not include any variables, all data will be locked!
6. Save the filter.
7. Go to Planning Function and create function using the File Upload type.
Example
Planning Function: FILE_UPL.

8. Set the parameters for the planning function.

December 2016

10

How To... Load a File into SAP BW Integrated Planning

Example
Character Format = DEFAULT
Overwrite Data = X
Skip Header Line = X
Convert Fields = X
Convert Amounts = X
File Format = 0D_VERSION, 0FISCVARNT, 0FISCYEAR, 0D_CUSTOMER, 0CURRENCY,
0D_REVEN
File Name = (leave empty)
CSV Data Separator = ,
CSV Escape Character =
Check Duplicates = #

Tip
To maintain the File Format, you can enter the InfoObjects manually and don't have to pick
them from the list or value help.
9. Go to Planning Sequence and create a new planning sequence.
Example
Planning Sequence: FILE_SEQ.

Important
The description of the sequence is used as the title for the file upload web user interface.

December 2016

11

How To... Load a File into SAP BW Integrated Planning

10. Add the upload planning function as a step to the sequence and save it.

Tip
If required you may add other planning functions to the sequence to run before or after the
upload. For example you could add a FOX function to validate the uploaded data against
business rules.
Another idea is to set File Name to PROMPT in the planning function parameters. This
will allow you to execute and test the sequence in transaction RSPLAN (or using program
RSPLS_PLSEQ_EXECUTE.
11. Before you can execute the sequence in transaction RSPLAN, you will have to enter values for any
variables you might have defined.

December 2016

12

How To... Load a File into SAP BW Integrated Planning

Tip
If have several variables or want to repeat the save test many times, you can save you
selection as a variant.
12. Repeat steps 7 to 11 for the "File Download" planning function.
Example
Planning function = FILE_DWN (File Download Planning Function)
Function type = File Download

Use the same parameter settings as for the upload

13. Create a planning sequence for the file download similarly to the upload
Planning sequence = FILE_SEQ2

December 2016

13

How To... Load a File into SAP BW Integrated Planning

4.3

Example for "File Upload"

...

1. In order to launch the application, choose Web Dynpro Application Execute. This will bring up
the file upload application in a web browser. The URL is displayed in the properties of the Web
Dynpro application (see above).
Append the parameter for the planning sequence to the URL. See the appendix for a description
of additional parameters.
General format of the start URL:
http://<server>:<port>/sap/bc/webdynpro/sap/zrsplf_file_upload_v3?
planning_sequence=<name_of_sequence>
2. Start the Web Dynpro application.
Paste the URL into the address bar of your browser. The URL can be assigned to a portals role or
stored as a local bookmark.

3. Enter your selection criteria, select the upload file and start the upload.
Enter the file name or choose the Browse and select the file.

December 2016

14

How To... Load a File into SAP BW Integrated Planning

Then choose Upload.


The system will now read the file and start the planning function to process the file contents. The
data will be stored in the OLAP buffer (same as with any other planning function).
4. After loading the file, the data is displayed in two tables: One time in the original format of the file
and one time in the format of your aggregation level.

5. If you want don't like the result, you can choose "Undo".
Note: "Undo" is only possible before you save the changes.
6. Save the data
Choose Save to store the data in the InfoProvider.
The system will display either a success or an error message.

December 2016

15

How To... Load a File into SAP BW Integrated Planning

7. Exit the application by closing the browser window.

December 2016

16

How To... Load a File into SAP BW Integrated Planning

4.4

Example for "File Download"

...

1. In order to launch the application, choose Web Dynpro Application Execute. This will bring up
the file upload application in a web browser. The URL is displayed in the properties of the Web
Dynpro application (see above).
Append the parameter for the planning sequence to the URL. See the appendix for a description
of additional parameters.
General format of the start URL:
http://<server>:<port>/sap/bc/webdynpro/sap/zrsplf_file_download_v3?
planning_sequence=<name_of_sequence>
2. Start the Web Dynpro application.
Paste the URL into the address bar of your browser. The URL can be assigned to a portals role or
stored as a local bookmark.

3. Enter your selection criteria, select the desired file format and start the download.
The system will now read the data and start the planning function to compile the data into a file.
After selecting to download, the data is displayed in a table corresponding to the format of the
file. You can select to download the data in the given format (text, XML, or CSV) or to export it
directly to Microsoft Excel.

December 2016

17

How To... Load a File into SAP BW Integrated Planning

4. Click on the "Open File" button.


The browser will open another window which contains the file content. You can now save the file
on to your PC (for example with File > Save As in Microsoft Internet Explorer).
Alternatively, click the Save File button to save the file directly without viewing it.
5. Select "Next" to download more data or exit the application by closing the browser window.

December 2016

18

How To... Load a File into SAP BW Integrated Planning

5.

Appendix

Due to large file size, the appendix has been placed into a separate document. Please see SAP Note
2053696.

December 2016

19

www.sap.com/contactsap
scn.sap.com/docs/DOC-27566