You are on page 1of 11

Restricting Invalid Characters from Loading into SAP BI 7.

Applies to:
This article applies to SAP BI 7.0.

Summary
This document explains how to restrict invalid characters from getting loaded into SAP BI, which in turn results into data loading errors. The source for these characters could be any one accepted by SAP.

Author: Company:

Anurag Krishna Dev Infosys Technologies Limited

Created on: 10 April 2009

Author Bio
Anurag Krishna Dev is an SAP Certified Solution Consultant and working at Infosys Technologies. He has been involved in SAP BI consulting practice for 3 years now. He has expertise in executing implementation and support projects for multiple clients.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 1

Restricting Invalid Characters from Loading into SAP BI 7.0

Table of Contents
Introduction .........................................................................................................................................................3 Practical scenario / Data loading errors ..........................................................................................................3 Root cause analysis ........................................................................................................................................3 Permitted characters .......................................................................................................................................3 How to handle invalid characters........................................................................................................................4 Related Contents ..............................................................................................................................................10 Disclaimer and Liability Notice..........................................................................................................................11

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2

Restricting Invalid Characters from Loading into SAP BI 7.0

Introduction
This article address the problems/errors arising while loading the data into SAP BI because of the presence of special characters not permitted by SAP in the source data. This article also intends to help developers understand what all are the valid characters and how to handle the scenarios when any unpermitted characters are present in the source. Practical scenario / Data loading errors

Here are some of the common errors which appear while loading when the source data contains invalid characters:1. Error in SID generation :-

2. Error when assigning SID: Action VAL_SID_CONVERT table

3. Characteristic 0material contains invalid characters :-

4. Activation of M records from DataStore object terminated :-

Root cause analysis

The cause of all the errors mentioned above is the presence of special characters in the source data, which is not permitted to be loaded into SAP BI. As a standard, SAP allows only All capitalized characters, and presence of any small letters or special characters in the source data will result into error.
Permitted characters

No small letters are allowed for characteristic values (for example, in the Info Object maintenance). It depends, however, on the language being used as to whether a character is in capital letters. It is guaranteed that the characters '!"%&'()*+,-./:;<=>?_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' are capitalized in all languages. Thus these characters are permitted for characteristic values. If we have to load the small letters a to z then we need to check mark the lower case letters setting in the Info Object maintenance screen.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 3

Restricting Invalid Characters from Loading into SAP BI 7.0

How to handle invalid characters


Following are the different ways to avoid error resulting from presence of invalid characters
1 Maintenance of the permitted extra characters in SAP BW

If we have such a system that still delivers the unpermitted character then we can make the setting in SPRO IMG Activity and enter such characters in the following path First Go to Transaction SPROSAP Reference IMGSAP Customizing implementation guideSAP Net weaverBusiness IntelligenceGeneral BI SettingsMaintain permitted extra characters (Or we can directly go to transaction RSKC)

Basically system checks what all languages are installed in the system at this point of time and whether these characters are capitalized in all these languages or not. In case when all these characters are capitalized in all the installed languages then these characters are also accepted in the characteristic values.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 4

Restricting Invalid Characters from Loading into SAP BI 7.0

Note: All languages that you install subsequently are not checked. It is possible that the validity of these additional characters is then not guaranteed, and the select ability of the entire master data is, therefore, come at risk.

1.1 Correcting the data in the source system

This is just another way to avoid all the data loading error. We need to check whether some how it is possible to correct the source data at the source system level before loading into SAP BW.
1.2 Change the data in PSA

If it is not possible to correct the data in the source system then we can edit the data in the PSA. First we need to load the data in PSA by running the Info package. Once the data has been loaded in PSA then
1.2.1 Go to Data source maintenance screen 1.2.2 Click on manage PSA

1.2.3 Select the request and click on PSA maintenance

1.2.4 In PSA maintenance select the data Package Number that you wish to edit and then click on continue

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 5

Restricting Invalid Characters from Loading into SAP BI 7.0

A. Select the particular row and click on change

B. Change the record and click on continue

C. Finally save the modified record.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 6

Restricting Invalid Characters from Loading into SAP BI 7.0

1 Eliminate the invalid character by using ABAP routine in transfer rule This is yet another and effective way to eliminate the invalid characters in the source data. In this process basically we write the ABAP routine in Transfer rule of the field which is suspected to contain invalid character. This routine compares the source characters with the permitted set of characters in SAP BI. If all the source characters are within the permitted set then that record is loaded normally. In case we have any source record having invalid character then this routine eliminate that invalid character from passing into BI and filtered record gets loaded to SAP BI.

To illustrate this process we will take an example scenario. Lets take the Flat file scenario and suppose we have the file having records with invalid characters for material column:-

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 7

Restricting Invalid Characters from Loading into SAP BI 7.0

Its quite obvious that this file contains the invalid character highlighted above. In order to eliminate these invalid characters we need to write the ABAP routine (described above) in the transfer rules. For this purpose we will select the rule type as Routine for material field as following

Then write the following ABAP routine in the window that comes, where system says Write your Code here ABAP Routine:
*$*$ begin of routine - insert your code only below this line ... "insert your code here *-- fill table "MONITOR" with values of structure "MONITOR_REC" *- to make monitor entries ... "to cancel the update process * raise exception type CX_RSROUT_ABORT. ... "to skip a record * raise exception type CX_RSROUT_SKIP_RECORD. ... "to clear target fields * raise exception type CX_RSROUT_SKIP_VAL. DATA : INT_VAR TYPE /BI0/OIMATERIAL. [Here your Field will come] DATA : STR_VAR1(20) TYPE C. DATA : VAR2 TYPE I. DATA : VAR3 TYPE I. *-*

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 8

Restricting Invalid Characters from Loading into SAP BI 7.0

DATA : VAR4 TYPE I. DATA : STR_VAR6(20) TYPE C. MOVE SOURCE_FIELDS-MATERIAL TO INT_VAR. TRANSLATE INT_VAR TO UPPER CASE . IF INT_VAR CN ',<>?/\:;"''ABCDEFGHI JKLMNOPQRSTUVWXYZ!%^&*()__+=1234567890' STR_VAR1 = INT_VAR+0(SY-FDPOS). VAR2 = STRLEN( INT_VAR ). VAR3 = SY-FDPOS + 1. VAR4 = VAR2 - VAR3. STR_VAR6 = INT_VAR+VAR3(VAR4). CONCATENATE STR_VAR1 STR_VAR6 INTO RESULT. ELSE. RESULT = INT_VAR. ENDIF. .

In the above routine you might need to change your field name in place of Material, and also the length of the variables. For rest of the fields we can go for Direct Assignment. Then save and activate the transfer rules. In the next step create the DTP to execute this transformation between the Data source and the target DSO. Execute the DTP and display the data loaded. Following is the screen shot of the data loaded in DSO

As we can see here that the invalid characters coming in the material field have been eliminated and data has been loaded successfully.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 9

Restricting Invalid Characters from Loading into SAP BI 7.0

Related Contents
Psa Easy maintenance Many Records Edited in PSA PSA

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 10

Restricting Invalid Characters from Loading into SAP BI 7.0

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.

SAP COMMUNITY NETWORK 2008 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 11

You might also like