8.13.2008

ETL Fundamentals

Fundamentals of ETL Service Architecture

ETL service comprises of two parts: Staging engine and Storage Service. Staging engine manages staging process for all data received from several source systems. It interfaces with the AWB scheduler and monitor for scheduling and monitoring data load processes. However, Storage Service manages and provides access to data targets in SAP BW and the aggregates that are stored in relational and multidimensional database management systems.

It is true, however, that the extraction technology provided as an integral part of SAP BW is restricted to database management systems supported by mySAP technology and that it does not allow extracting data from other database systems like IBM IMS and Sybase. It also does not support proprietary file formats such as dBase file formats, Microsoft Access file formats, Microsoft Excel file formats, and others. On the other hand, the ETL services layer of SAP BW provides all the functionality required to load data from non-SAP systems in exactly the same way as it does for data from SAP systems. SAP BW does not in fact distinguish between different types of source systems after data has arrived in the staging area. The ETL services layer provides open interfaces for loading non-SAP data.

Extraction at Service Levels



SAP BW can be integrated with other SAP components based on application programming interface (API) service. It provides a framework to enable comprehensive data replication based on data extractors that encapsulate the application logic. Data Extractor fills the extract structure of data source with a data from data source and offers sophisticated handling of changes. In addition to supporting extractors, the service APIs also enable online access via RemoteCube technology and flexible staging for hierarchies. On the other hand SAP provides an open interface called Staging Business Application Programming Interface (BAPI) to extract data from non-SAP sources. BAPI serves the purpose of connecting third- party ETL tools to SAP BW and provides access to SAP BW objects which facilitates use of customer extraction routines. Data can be extracted at the database level by using: DB connect, flat files and XML. DB connect facilitates extraction directly from DBMS. In this the metadata files are loaded by replicating metadata tables and views into the metadatory repository of SAP BW. Data can also be uploaded from flat files by creating routines for extraction of data and XML files can be extracted through XML via Administrator Workbench in SAP BW.

NOTE: SAP BW provides three ways to extract data at the database or file level: DB Connect, flat file transfer, and XML. SAP BW provides flexible capabilities for extracting data directly from RDBMS tables using DB Connect.


read more...

BW - Metadata Modelling

The administration services in SAP BW can be availed through Administration Workbench (AWB). It is a single point of entry for data warehouse development, administration and maintenance tasks in SAP BW with Metadata modeling component, scheduler and monitor as its main components as described in the figure hereunder:
Click on "READ MORE" for viewing the figure
Metadata modeling: Metadata modeling component is the main entry point for defining the core metadata objects used to support reporting and analysis. This includes everything from defining the extraction process and implementing transformations to defining flat or multidimensional objects for storage of information.


Modeling Features
* Metadata modeling provides a Metadata Repository where all the metadata is stored and a Metadata Manager that handles all the requests for retrieving, adding, changing, or deleting metadata.
* Reporting and scheduling mechanism: Reporting and scheduling are the processes required for the smooth functioning of SAP BW. The various batch processes in the SAP BW need to be planned to provide timely results, avoid resource conflicts by running too many jobs at a time and to take care of logical dependencies between different jobs. These processes are controlled in the scheduler component of AWB. This is achieved by either scheduling single processes independently or defining process chains for complex network of jobs required to update the information available in the SAP BW system. Reporting Agent controls execution of queries in a batch mode to print reports, identify exception conditions and notify users and pre compute results for web templates.
* Administering ETL service layer in multi- tier level: SAP’s ETL service layer provides services for data extraction, data transformation and loading of data. It also serves as the staging area for intermediate data storage for quality assurance purposes. The extraction technology of SAP BW is supported by database management systems of mySAP technology and does not allow extraction from other database systems like IBM, IMS and Sybase. It does not support dBase, MS Access and MS Excel file formats. However, it provides all the functionality required for loading data from non- SAP systems as the ETL services layer provide open interfaces for loading non-SAP data.



read more...

SAP Business Warehouse (BW)

Extract from the BW Cookbook Volume 1: "The SAP Business Information Warehouse enables Online Analytical Processing (OLAP) to format the information of large amounts of operative and historical data. OLAP technology enables multi-dimensional analyses according to various business perspectives. The preconfigured Business Information Warehouse Server for core areas and processes ensures information views within the entire enterprise."


Extract from the BW Cookbook Volume 2:

Settings In SAP (R/3) Source System

STEP 1. Install Plug-In

STEP 2. Defining Source System

TRANSACTION CODE: SPRO -> SAP Ref. Img ->

If R/3 system is 4.0B -> Cross Application components -> Distribution ALE -> Basic Settings -> set up logical system -> Maintain logical systems -> New entries -> maintain the entries as : ->


read more...

Send report as attachment in background

REPORT zpwtest .

TABLES : t001 .
TYPE-POOLS slis .

DATA : t_t001 TYPE TABLE OF t001 ,
t_abaplist TYPE TABLE OF abaplist .

DATA : w_abaplist TYPE abaplist .

SELECT-OPTIONS : s_bukrs FOR t001-bukrs OBLIGATORY .
PARAMETERS : p_list TYPE c NO-DISPLAY .

START-OF-SELECTION .

IF sy-batch = 'X' AND p_list IS INITIAL .

* Submit report and get list in memory
SUBMIT zpwtest EXPORTING LIST TO MEMORY
WITH s_bukrs IN s_bukrs
WITH p_list = 'X'
AND RETURN.

* Get the list from memory.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = t_abaplist
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

* Send report to mail receipent
PERFORM send_mail .

ELSE.
PERFORM select_data .
PERFORM display_data .
ENDIF.

*SO_NEW_DOCUMENT_SEND_API1

*&---------------------------------------------------------------------*
*& Form select_data
*&---------------------------------------------------------------------*


FORM select_data.

SELECT *
INTO TABLE t_t001
FROM t001
WHERE bukrs IN s_bukrs .

ENDFORM. " select_data

*&---------------------------------------------------------------------*
*& Form display_data
*&---------------------------------------------------------------------*
FORM display_data.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_structure_name = 'T001'
TABLES
t_outtab = t_t001
EXCEPTIONS
program_error = 1
OTHERS = 2.

IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

ENDFORM. " display_data

*&---------------------------------------------------------------------*
*& Form send_mail
*&---------------------------------------------------------------------*
FORM send_mail.

DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
listobject LIKE abaplist OCCURS 10,
compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
w_object_hd_change LIKE sood1,
compressed_size LIKE sy-index.


* Fot external email id
* receiver_list-recextnam = 'XXXXXXXXXXXX@XXXXXX.COM'.
* receiver_list-recesc = 'E'.
* receiver_list-sndart = 'INT'.
* receiver_list-sndpri = '1'.

* FOr internal email id
receiver_list-recnam = sy-uname .
receiver_list-esc_des = 'B'.
APPEND receiver_list.


* General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
* Mail subject
w_object_hd_change-objdes = 'Message subject'.
* Mail body
APPEND 'Message content' TO message_content.

CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
compressed_size = compressed_size
TABLES
in = t_abaplist
out = compressed_attachment.


DESCRIBE TABLE compressed_attachment.

CLEAR packing_list.
packing_list-transf_bin = 'X'.
packing_list-head_start = 0.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = sy-tfill.
packing_list-objtp = 'ALI'.
packing_list-objnam = 'Object name'.
packing_list-objdes = 'Attachment description'.
packing_list-objlen = compressed_size.
APPEND packing_list.

CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = w_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = message_content
receivers = receiver_list
packing_list = packing_list
att_cont = compressed_attachment.


ENDFORM. " send_mail


read more...

Minimum Code Required to Send SAP Mail

REPORT ztest .

CONSTANTS : c_high TYPE sodocchgi1-priority VALUE '1' .

DATA : i_content TYPE TABLE OF solisti1 ,
i_rec TYPE TABLE OF somlreci1 .

DATA : wa_docdata TYPE sodocchgi1 ,
wa_content TYPE solisti1 ,
wa_rec TYPE somlreci1 .

* Fill document data
wa_docdata-obj_name = 'MESSAGE' .
wa_docdata-obj_descr = 'test' .
wa_docdata-obj_langu = 'E' .
wa_docdata-sensitivty = 'F' .
wa_docdata-obj_prio = c_high .
wa_docdata-no_change = 'X' .
wa_docdata-priority = c_high .

* Fill object content
CLEAR wa_content .
wa_content-line = 'test mail' .
APPEND wa_content TO i_content .




* Fill receivers
CLEAR wa_rec .
wa_rec-receiver = sy-uname .
wa_rec-rec_type = 'B'.
APPEND wa_rec TO i_rec .


CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = wa_docdata
TABLES
object_content = i_content
receivers = i_rec
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.

IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.


read more...

Smartform/Sapscript Page Counter - Mode

Smart Forms records page numbering using page counters. You query these using system fields

&SFSY-PAGE& for the current page number
&SFSY-FORMPAGES& for the total number of pages in the form
&SFSY-JOBPAGE& for the total number of pages of all forms in the print job

You can use the following modes to define which values the different page counters can accept

Initialize : This will reset the page counter.
Increase : Increase the page counter by 1.
Leave Counter Unchanged : Does not increase page counter.
Page and Total Page Unchanged : Hold all the values.

Initialize, Increase, and Hold only change &SFSY-PAGE& accordingly. &SFSY-FORMPAGES& and &SFSY-JOBPAGES& are increased by one regardless of this setting.

Page and Total Page Unchanged has the effect that not only &SFSY-PAGE& but also &SFSY-FORMPAGES& remain unchanged.
Click on Read More for Picture.......................................



Page numbering mode of a form page

Mode of the counter of a form page.

The page counter can be set so that the number of the previous page is incremented, the page number is reset to its initial value, or the previous page number is repeated.


read more...

8.12.2008

Standard SAP SD Reports

Reports in Sales and Distribution modules (LIS-SIS):

Sales summary - VC/2
Display Customer Hierarchy - VDH2
Display Condition record report - V/I6
Pricing Report - V/LD
Create Net Price List - V_NL
List customer material info - VD59
List of sales order - VA05
List of Billing documents - VF05
Inquiries list - VA15
Quotation List - VA25
Incomplete Sales orders - V.02
Backorders - V.15
Outbound Delivery Monitor - VL06o
Incomplete delivery - V_UC
Customer Returns-Analysis - MC+A
Customer Analysis- Sales - MC+E
Customer Analysis- Cr. Memo - MC+I
Deliveries-Due list - VL04
Billing due list - VF04
Incomplete Billing documents - MCV9
Customer Analysis-Basic List - MCTA
Material Analysis(SIS) - MCTC
Sales org analysis - MCTE
Sales org analysis-Invoiced sales - MC+2
Material Analysis-Incoming orders - MC(E
General- List of Outbound deliveries - VL06f
Material Returns-Analysis - MC+M
Material Analysis- Invoiced Sales - MC+Q
Variant configuration Analysis - MC(B
Sales org analysis-Incoming orders - MC(I
Sales org analysis-Returns - MC+Y
Sales office Analysis- Invoiced Sales - MC-E
Sales office Analysis- Returns - MC-A
Shipping point Analysis - MC(U
Shipping point Analysis-Returns - MC-O
Blocked orders - V.14


Order Within time period - SD01
Duplicate Sales orders in period - SDD1
Display Delivery Changes - VL22


read more...