0% found this document useful (0 votes)
259 views

Enhancing LO DataSources - Step by Step PDF

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
259 views

Enhancing LO DataSources - Step by Step PDF

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Enhancing LO DataSource – Step by Step

Enhancing LO DataSource – Step by Step

Applies to:
SAP BI, NW2004s Business Intelligence.

Summary
This article explains step by step procedure to enhance LO DataSource. It is explained by enhancing
standard DataSource 0Customer_attr (Customer) by adding a couple of Z fields. Though it explains steps for
master data DataSource enhancement same can be applied for transaction data DataSources as well. I
coupled the process with screen shots to make it more users friendly.
Author: Vikash Agrawal
Company: Wipro Technologies
Created on: 27th November 2006

Author Bio
Vikash Agrawal is a Certified SAP BI Consultant with Wipro Technologies. He has extensive cross
functional experience and has been with end to end SAP implementations, upgrades, and BI - Portal
Integration projects across manufacturing domain. He has also worked in the area of distribution of finished
goods as well as remodeling of Distribution Supply Chain.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 1
Enhancing LO DataSource – Step by Step

Table of Contents
Create a Table of Contents in Microsoft Word. To change, right-click on the TOC and select Update Field.
Applies to: ........................................................................................................................................ 1
Summary.......................................................................................................................................... 1
Author Bio ........................................................................................................................................ 1
Overview .......................................................................................................................................... 3
Appending the Structure .................................................................................................................. 4
Filling up the Appended Structure ................................................................................................... 9
Wrtie ABAP Code....................................................................................................................... 12
Regenerate & Check the Customized Objects .............................................................................. 16
Related Content............................................................................................................................. 18
Disclaimer and Liability Notice....................................................................................................... 19

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 2
Enhancing LO DataSource – Step by Step

Overview
Purpose of this exercise is to enhance LO DataSource, Customer_Attr one to be specific. I needed to add
following field to Customer_Attr DataSource. One need to start from recognizing the fields / components type
and then look for the table from where data could be picked up to fill up these fields.

No Component Component Type Description (NOT TO USE ANY


WHERE)

1 Zz1payer KUNN2 Payer

2 Zz1Pcc_area KKBER Payer’s Credit Control Area

3 Zz1Pind_cd2 BRAN2 Payer’s Industry Code2

4 ZZ1pcustgrp KDGRP Payer’s Customer Group

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 3
Enhancing LO DataSource – Step by Step

Appending the Structure


DataSources reside in the source system so If I need to customize DataSource, I need to go to source
system, one can directly login to Source System ( R/3 in our case) or From BW also can remotely login to
Source System.

• Logon to BW

o Go to Administrator Workbench (RSA1).

o Go to Source systems.

o Choose R/3 Source System (where your DataSource resides) - Right Click & go to
“Customizing for Extractors”.

• It shall take you to Source System ( R/3)

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 4
Enhancing LO DataSource – Step by Step

• Choose “Edit DataSources and Application Component Hierarchy”

• Go to “0CUSTOMER_ATTR” Customer Number DataSource ( or whatever DataSource you decide to


customize)

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 5
Enhancing LO DataSource – Step by Step

• Click on DataSource

• Scroll down to reach the appended structure

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 6
Enhancing LO DataSource – Step by Step

• Double Click on appended structure – ZBIW_KNA1_S1 (or your chosen one) & add the fields ( which
you wish to add to DataSource)

• Check, save & activate - It will append this to Extract Structure of DataSource.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 7
Enhancing LO DataSource – Step by Step

• Go Back

• Click on 0CUSTOMER_ATTR (DataSource)

• Now Click on Extract Structure – BIW_KNA1_S (in my case), check out the appended field below
append structure.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 8
Enhancing LO DataSource – Step by Step

Filling up the Appended Structure


• Post appending the structure, we need to fill this Append with data – For this

o LOGON to Source System (R/3)

o Go to T Code – CMOD

o Choose the project – Which you are using for Master Data Enhancement. Project
“ZSDBWNEW” in my case. ( you need to create project in case you are doing enhancement
on this BW system for the first time)

o Click on Enhancement Assignments

o Click on Change

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 9
Enhancing LO DataSource – Step by Step

• Press Continue – In case it prompts for some confirmation like “Enhancement project already active”
etc.

• Choose the following -

o Enhancement – RSAP0001

o Click on Components.

• It will take you to -

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 10
Enhancing LO DataSource – Step by Step

• Choose”EXIT_SAPLRSAP_002” & Click on this.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 11
Enhancing LO DataSource – Step by Step

• We need to write ABAP Code to fill up Appended Fields in “0Customer_Attr” through the Include
mentioned here i.e. include zxrsau02.

• Double Clicking on this will take to ABAP Editor to put in the code.

• Go to Change Mode.

• This Code is to be inserted before “endcase” of already written code.

• Make Sure Tables KNVV, BIW_KNVV_S, KNKK, KNA1, KNVP ( these are table from which I need to
extract values of appended fields) are declared at the very start of the code.

Wrtie ABAP Code


<< ABAP CODE>>
DATA : l_biw_knvv_s LIKE biw_kna1_s.
DATA : zz1payer LIKE knvp-kunn2, zz1pcc_area LIKE knkk-kkber,
zz1pind_cd2 LIKE kna1-bran2,zz1pterm LIKE knvv-zterm,
zz1pcustgrp LIKE knvv-kdgrp.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 12
Enhancing LO DataSource – Step by Step

<<From here Code is to be added>>

when '0CUSTOMER_ATTR'.
clear i_counter.
loop at i_t_data into l_biw_kna1_s.
* Selection of Payer against “Sold to” of Customer
select * from knvp
where kunnr = l_biw_kna1_s-kunnr
and VKORG = l_biw_kna1_s-vkorg
and VTWEG = l_biw_ kna1_s-vtweg
and SPART = l_biw_kna1_s-spart
and parvw = 'RG' .

if sy-subrc eq 0.
l_biw_kna1_s-zz1payer = knvp-kunn2.
Else
l_biw_kna1_s-zz1payer = l_biw_kna1_s-kunnr.
Endif

<<* If Payer is found then pick up Payer's credit control area>>


select * from knkk
up to 1 rows
where kunnr = l_biw_kna1_s-zz1payer.
endselect.

if sy-subrc eq 0.
l_biw_kna1_s-zz1pcc_area = knkk-kkber.
endif.

<<* If Payer is found then pick up Payer's Industry Code2>>


select * from kna1
up to 1 rows
where kunnr = l_biw_kna1_s-zz1payer.
endselect.

if sy-subrc eq 0.
l_biw_kna1_s-ZZ1pind_cd2 = kna1-bran2.
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 13
Enhancing LO DataSource – Step by Step

endif.

<<* If Payer is found then pick up Terms of Payment, Payer's Customer


Group>>
select * from knvv
where kunnr = l_biw_kna1_s-zz1payer
and VKORG = l_biw_kna1_s-vkorg
and VTWEG = l_biw_kna1_s-vtweg
and SPART = l_biw_kna1_s-spart.

if sy-subrc eq 0.
l_biw_kna1_s-zz1pterm = knvv-zterm.
l_biw_kna1_s-zz1pcustgrp = knvv-kdgrp.
endif.

modify i_t_data from l_biw_knvv_s.


endloop.

• Do the “Check” before Save, if no errors are found the Save & Activate”.

• Go Back.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 14
Enhancing LO DataSource – Step by Step

• Do the Check again & if no errors then Activate.

• Go Back and then Activate. (Keep activating while going back on every step).

• Come Out.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 15
Enhancing LO DataSource – Step by Step

Regenerate & Check the Customized Objects


• Now Final Step – We need to regenerate the DataSource & make sure Newly Added Attributes
(Starting with ZZ) are not HIDE.

• Logon to BW System – Go to Administrator Workbench (RSA1) – Go to Source systems – Choose


Source System (R/3 in our case) - Right Click & go to “Customizing for Extractors”.

• Choose “Edit DataSources and Application Component Hierarchy”

• Go to “0CUSTOMER_ATTR” Customer Number DataSource & Click on CHANGE. Scroll Down.

• Keep clicking on Right Sign if it prompts for any confirmation.

• Scroll down & Go to Fields starting with ZZ & make sure these are not HIDE (remove the sign from
HIDE check box).

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 16
Enhancing LO DataSource – Step by Step

• Click on DataSource & Generate, as shown below

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 17
Enhancing LO DataSource – Step by Step

• Go back

• Next Steps are Checking Extractors & Loading data.

Related Content
• SAP Network Blog: Extract Checker https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3094
• SAP Network Blog: LOGISTIC COCKPIT - WHEN YOU NEED MORE - First option: enhance it!
https://weblogs.sdn.sap.com/pub/wlg/1262
• SAP Network Blog: How to retain deltas when you change LO extractor in Production system
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3785
• SAP Network Blog: Custom fields and BW extractors: Making a mixed marriage work!
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1591

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 18
Enhancing LO DataSource – Step by Step

• 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 DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2006 SAP AG 19

You might also like