Saturday, 13 September 2008

SAP BI Logistics Data Extraction

Steps for SAP BI Logistics Data Extraction:

1. Transfer the logistics DataSource for transaction data from Business Content
With the transfer of the DataSource, the associated extraction structure is also
delivered, but the extraction structure is based on LIS communication structures.
Furthermore, based on the extraction structure for the DataSource, a restructuring
table that is used for the init and full update to BW is generated.
Naming convention:
DataSource 2LIS__<:event>; where <:event>is
optional
Examples:
2LIS_11_VAITM: 11 = SD Sales VA = sales order, delivery schedule ITM (→
ITEM) = document position
2LIS_02_HDR: 02 = MM purchasing HDR (→ HEADER ) = Document header
Extraction structure MC<:event group>0;
where MC is derived from the associated communication structures and
is optional
Examples:
MC11VA0ITM: Extraction structure for the DataSource 2LIS_11_VAITM
MC02M_0HDR: Extraction structure for the DataSource 2LIS_02_HDR, where
M_ indicates the group for the events MA (order), MD (delivery schedule), ME
(contact) and MF (request).
Restructuring table (= setup table) SETUP
Example:
Extractton structure: MC11VA0IT ⇒ Restructuring table:: MC11VA0ITSETUP

2. Maintain extraction structure (transaction LBWE)
This means that fields can be added to the extraction structure that is delivered
with the DataSource without modifying anything. On the one hand, fields from
the LIS communication structures that are assigned to the extraction structure can
be used, that means standard fields that SAP has not selected, and on the other
hand, customer fields that were attached to the LIS communication structures
with the append technique can be used. After the extraction structure is created,
it is generated automatically and the associated restructuring table is adapted.

3. Maintain/generate DataSource

In the DataSource maintenance, you can assign the properties Selection, Hide,
Inversion (= Cancelation) and Field Only Known in Customer Exit to the
fields of the extraction structure. After enhancing the extraction structure, the
DataSource always has to be generated again!

4. Replicate DataSource into the BW (=metadata upload)

5. Assign replicated DataSource to the InfoSource with flexible update

6. Maintain mapping and transfer rules & choose transfer method PSA
When the transfer rules are activated, the BW transfer structure (comprised of
fields from the replicated DataSource) is generated as a mirror image of BW in
the SAP system. With the PSA transfer method, during activation of the transfer
rules, in addition to the transfer structure, a PSA table is generated, the structure
of which is based on the transfer structure.

7. Define update rules for the data target (BasicCube/ODS object) in regard to
the InfoSource with flexible update

8. Set extraction structure for updating to active (transaction LBWE)
In this way, data can be written to the restructuring table or the delta queue from
then on using the extraction structure (see following steps).

9. Fill the restructuring table/restructure (OLI*BW)
During this process, no documents should be created or changed in the system!
In some applications, it is possible to fill the restructuring table beforehand in
simulation mode. These results are listed in a log (transaction LBWF). Before
filling the restructuring table, you must ensure that the content of the tables is
deleted (transaction LBWG), preventing the table from being filled multiple
times. Once the restructuring tables are filled, document editing can resume as
long as Unserialized V3 Update or Queued Delta is selected in the next step.
Be absolutely sure that no V3 collection run is started until the next successful
posting of an InfoPackage for delta initialization (see step 15).

10. Select update method
. Unserialized V3 update
. Queued delta
. Direct delta

11. Create an InfoPackage for the DataSource and schedule the Delta Initialization
in the Scheduler
This updates the BW-relevant data from the restructuring table to the data
target (BasicCube/ ODS object) using the ETL process (the same is valid for
a full update!). Since the restructuring table is not longer needed after delta
initialization, the content can be deleted (transaction LBWG).

After successful delta initialization, document editing can resume, as long as the
direct delta update method was selected in step 13. This means that BW-relevant
Δ data is written directly to the delta queue.
Note:
If the DataSource supports early-delta initialization, the Δ data can be written
to the delta queue during delta initialization. This feature is controlled with
an indicator in the Scheduler.

12. Start V3 collection run (transaction LBWE)
This step is only necessary when the update method unserialized V3 Update or
Queued Delta was selected in step 13. By starting a corresponding job for an
application, the BW-relevant Δ data is read from the update tables or extraction
queue and written to the delta queue.

13. Create an InfoPackage for the DataSource in BW and schedule the Delta Update
in the Scheduler
The BW-relevant Δ data from the delta queue for the DataSource is updated to
the data target (BasicCube/ODS object) using the ETL process.

Extract Structures

2LIS_11_VAHDR – MC11VA0HDR – Sales Document Header
2LIS_11_VAITM – MC11VA0ITM - Sales Document Item
2LIS_11_VASCL – MC11VA0SCL – Sales Document Schedule Line

Setup Tables

2LIS_11_VAHDR - MC11VA0HDRSETUP
2LIS_11_VAITM - MC11VA0ITMSETUP
2LIS_11_VASCL - MC11VA0SCLSETUP

Friday, 12 September 2008

BI Key Value showing 'X' after upgrade from 3.x to 7.X

After upgrade from 3.x to 7.x, Calculated KF value showing as 'X' if there a function variable used as Replacement Path. Following is the solution:

Run the following program using SE38 and change from 'Before Aggregation' to 'After Aggregation'

RSR_VAR_REPPATH_AGGREGATION.

See the attached image.





Hopefully this will solve the problem.

Thursday, 11 September 2008

SAP BI Query Strategy

This section will provide the best practice for Query strategy..

Will updated Soon...

Maintain your BI Query in Production System

This section provides the effective way to maintain query in your BI Production System.

Updated Soon.

How to create a Virtual InfoProvider

Virtual Infoprovider has its own advantages. This Section describes how to create virtual InfoProvider.

This section will be updated soon.

Executing BI Query in a Program

Sometime it required to run BI Queries in background. Few of the advantages of running queries in background are:

1. Programatically critical calculations can be passed as variable values which is not always easy to create using standard functions in Query Designer
2. Result of query need to send to external system which is not possible using InfoSpokes

To accomplish this use the following program. This program is tested using BI 3.X system. Will be validated in 7.X system very soon.

The program will be published very soon....

Monday, 8 September 2008

Copy a role in transaction PFCG fails with the error message "No entry exist for the type COLL_AGR in the table AGR_FLAGS"

Create a Program with Name Z_ADD_COLL_FLAG and run the program to resolve the error.

*&---------------------------------------------------------------------*
*& Report Z_ADD_COLL_FLAG *
*& *
*&---------------------------------------------------------------------*
*& This report identifies roles without an entry for FLAG_TYPE *
*& COLL_AGR in table AGR_FLAGS and adds this entry. *
*&---------------------------------------------------------------------*
REPORT z_add_coll_flag LINE-SIZE 90.
TABLES: agr_define, agr_flags, agr_agrs, agr_1250.
DATA: it_agr_define LIKE agr_define OCCURS 100,
wa_agr_define LIKE agr_define,
it_agr_flags LIKE agr_flags OCCURS 100,
it_agr_flgs_u LIKE agr_flags OCCURS 100,
wa_agr_flags LIKE agr_flags,
wa_agr_agrs LIKE agr_agrs,
wa_agr_1250 LIKE agr_1250.
DATA: roles_wo_flg TYPE i,
undef_roles TYPE i,
flag_val LIKE smensapnew-customized.
* Testmode
PARAMETERS: testmode AS CHECKBOX DEFAULT 'X'.
* Selection of all roles because all roles must be checked
SELECT * FROM agr_define INTO TABLE it_agr_define.
* I) Check of all roles
LOOP AT it_agr_define INTO wa_agr_define.
SELECT SINGLE * FROM agr_flags INTO wa_agr_flags
WHERE agr_name = wa_agr_define-agr_name
AND flag_type = 'COLL_AGR'.
IF sy-subrc NE 0.
* No COLL_AGR entry found => It must be added.
CLEAR wa_agr_flags.
wa_agr_flags-agr_name = wa_agr_define-agr_name.
wa_agr_flags-flag_type = 'COLL_AGR'.
* Check whether it is a single or composite role
* Does the role have authorizations?
SELECT SINGLE agr_name FROM agr_1250 INTO wa_agr_1250
WHERE agr_name = wa_agr_define-agr_name.
IF sy-subrc EQ 0.
* Yes, it has! => Single role
wa_agr_flags-flag_value = space.
ELSE.
* Does the role contain single roles?
SELECT SINGLE agr_name FROM agr_agrs INTO wa_agr_agrs
WHERE agr_name = wa_agr_define-agr_name.
IF sy-subrc EQ 0.
* Yes, it has! => Composite role
wa_agr_flags-flag_value = 'X'.
ELSE.
* No, it doesn't! => Status unclear => It is defined as single
* role.
wa_agr_flags-flag_value = space.
APPEND wa_agr_flags TO it_agr_flgs_u.
ENDIF.
ENDIF.
APPEND wa_agr_flags TO it_agr_flags.
ENDIF.
ENDLOOP.
* II) Display of the results
DESCRIBE TABLE it_agr_flags LINES roles_wo_flg.
IF roles_wo_flg GT 0.
WRITE: / 'Roles without flag type COLL_AGR in table AGR_FLAGS:',
roles_wo_flg.
SKIP.
ULINE (47).
WRITE: / '', (30) 'Role', '', (10) 'Role Type', ''.
ULINE (47).
LOOP AT it_agr_flags INTO wa_agr_flags.
IF wa_agr_flags-flag_value EQ space.
WRITE: / '', (30) wa_agr_flags-agr_name,
'', (10) 'Single', ''.
ELSE.
WRITE: / '', (30) wa_agr_flags-agr_name,
'', (10) 'Collective', ''.
ENDIF.
ENDLOOP.
ULINE (47).
DESCRIBE TABLE it_agr_flgs_u LINES undef_roles.
IF undef_roles GT 0.
SKIP.
WRITE: / 'Roles defined as single due to an unclear status:',
undef_roles.
SKIP.
LOOP AT it_agr_flgs_u INTO wa_agr_flags.
WRITE: / wa_agr_flags-agr_name.
ENDLOOP.
ENDIF.
ELSE.
WRITE: / 'No inconsistent roles found'.
ENDIF.
* III) Database update
IF roles_wo_flg GT 0 AND testmode EQ space.
* The database update is performed role by role using function module
* PRGN_SET_COLLECTIVE_AGR_FLAG in order to get change documents.
LOOP AT it_agr_flags INTO wa_agr_flags.
IF wa_agr_flags-flag_value EQ 'X'.
flag_val = 'X'.
ELSE.
flag_val = space.
ENDIF.
CALL FUNCTION 'PRGN_SET_COLLECTIVE_AGR_FLAG'
EXPORTING
activity_group = wa_agr_flags-agr_name
collective_agr_flag = flag_val.
ENDLOOP.
WRITE: / 'Table AGR_FLAGS updated'.
ENDIF.

Sunday, 7 September 2008

SAP BI Transaction List

RS00 - Start menu
RS12 - Overview of master data locks
RSA0 Content Settings Maintenance
RSA1 BW Administrator Workbench
RSA10 Realtime Test Interface Srce System
RSA11 Calling up AWB with the IC tree
RSA12 Calling up AWB with the IS tree
RSA13 Calling up AWB with the LG tree
RSA14 Calling up AWB with the IO tree
RSA15 Calling up AWB with the ODS tree
RSA1OLD BW Administrator Workbench (old)
RSA2 OLTP Metadata Repository
RSA3 Extractor Checker
RSA5 Install Business Content
RSA6 Maintain DataSources
RSA7 BW Delta Queue Monitor
RSA8 DataSource Repository
RSA9 Transfer Application Components
RSADMIN maintenance
RSADRTC70 TO ADR11 Conversion of table TC70 in ADR11
RSANWB Model the Analysis Process
RSANWB_CRM_ATTR Fill CRM Attributes
RSANWB_EXEC Execute Analysis Process
RSANWB_IMP Calculation of Importance
RSANWB_START_ALL Model the Analysis Process
RSANWB_SURVEY Analysis Process: Create Target
GrpRSAN_CLTV CLTV Modeling
RSARCH_ADMIN BW Archive Administration
RSARFCEX Variant for RSARFCEX
RSASSIBTCH Schedule Assistant in Background
RSATTR Attribute/Hierarchy Realignment Run
RSAWB New AWB
RSAWBSETTINGSDEL Delete user settings of the AWBRSB0 Maintain OLAP authorization objectRSB1 Display authorization objectRSB2 Data Marts Generation Center
RSBBS Maintaining BW Sender-Receiver
RSBBS_WEB Transaction for the RRI in the Web
RSBCTMA_AC xCBL Action Codes
RSBCTMA_DT Mapping of Ext./Int. Document Type
RSBEB Business Explorer Browser
RSBMO2 Open Hub Monitor
RSBO Open Hub Maintenance
RSBOH1 Open Hub Maintenance
RSBOH2 Open Hub Maintenance
RSBOH3 Open Hub Maintenance
RSBO_EXTRACT Auth Check Open Hub Extraction
RSBROWSER BW Browser
RSBWREMOTE Create Warehouse User
RSCATTAWB CATT Admin. Workbench
RSCDS Summarization routine
RSCONCHA Channel conversion
RSCONFAV Favorites Conversion
RSCRMDEBUG Set Debug Options
RSCRMISQ Regis. of Infosets for Target Groups
RSCRMMDX Edit MDX
RSCRMMON Monitor Query Extracts
RSCRMSCEN Regist. Closed-Loop Scenarios
RSCRM_BAPI Test Program for RSCRM Interface
RSCRM_REPORT BW Queries with ODBO (to 2nd 0B)
RSCRT BW Monitor (Near)-Real-Time Loading
RSCR_MAINT_PUBLISH Maint. of Publishing Variables CR/CERSCR_MAINT_URL Maint. of URL Variables for CR/CE
RSCUSTA Maintain BW Settings
RSCUSTA2 ODS Settings
RSCUSTV1 BW Customizing - View 1
RSCUSTV10 BW Customizing - View 10
RSCUSTV11 BW Customizing - View 11
RSCUSTV12 Microsoft Analysis Services
RSCUSTV13 RRI Settings for Web Reporting
RSCUSTV14 OLAP: Cache Parameters
RSCUSTV15 BW Customizing - View 11
RSCUSTV16 BW Reporting
RSCUSTV17 Settings: Currency Translation
RSCUSTV18 DB Connect Settings
RSCUSTV19 InfoSet Settings
RSCUSTV2 BW Customizing - View 2
RSCUSTV3 BW Customizing - View 3
RSCUSTV4 BW Customizing - View 4
RSCUSTV5 BW Customizing - View 5
RSCUSTV6 BW Customizing - View 6
RSCUSTV7 BW Customizing - View 7
RSCUSTV8 BW Customizing - View 8
RSCUSTV9 BW Customizing - View 9
RSD1 Characteristic maintenance
RSD2 Maintenance of key figures
RSD3 Maintenance of units
RSD4 Maintenance of time characteristics
RSD5 Internal: Maint. of Techn. Chars
RSDBC DB connect
RSDB_ADD_ID_2_CRM Create External ID for CRM-GP
RSDB_INIT Initial Download of D&B Data
RSDCUBE Start: InfoCube editing
RSDCUBED Start: InfoCube editing
RSDCUBEM Start: InfoCube editing
RSDDV Maintaining Aggregates
RSDIOBC Start: InfoObject catalog editing
RSDIOBCD Start: InfoObject catalog editing
RSDIOBCM Start: InfoObject catalog editing
RSDL DB Connect - Test Program
RSDMD Master Data Maintenance w.Prev. Sel.
RSDMD_TEST Master Data Test
RSDMPRO Initial Screen: MultiProvider Proc.
RSDMPROD Initial Screen: MultiProvider Proc.
RSDMPROM Initial Screen: MultiProvider Proc.
RSDMWB Data Mining Workbench
RSDODS Initial Screen: ODS Object Processng
RSDODSD Initial Screen: ODS Proces. (Deliv.)
RSDPMDDBSETUP Creates a MOLAP Database in MSAS
RSDPMOLAPDS MOLAP DataSource creation
RSDPRFCDSETUP Create MOLAP Rfc Tests
RSDSD DataSource Documentation
RSDU_SHOWTEMPINCTAB
RSDU_SHOWTEMPINCTABRSDV Validity Slice Maintenance
RSD_ACAT Maintain InfoObject catalog
RSEDIT Old editor
RSEIDOCM Variant for
RSEIDOCMRSENQ Display of Lock Log
RSEOUT00 Variant for
RSEOUT00RSFH Test Transaction Data Extractors
RSFLAT Flat MDXRSFREQUPL Frequent upload from source systems
RSGWLST Accessible Gateways
RSH1 Edit hierarchy initial screen
RSH3 Simulate hierarchies
RSHIER Hierarchy maintenance w/o AdmWB
RSHIERINT Hierarchy maintenance from AdmWB
RSHIERSIM Simulate hierarchies
RSICUBE Maintain/Change InfoCubes (Internal)
RSIMG BW IMGRSIMPCUR Load Exchange Rates from File
RSINPUT Manual Data Entry
RSIR_DELTATRACK KPro Delta Tracking
RSISET Maintain InfoSets
RSKC Maintaining the Permittd Extra Chars
RSLDAPSYNC_USER LDAP Synchronization of Users
RSLGMP Maintain
RSLOGSYSMAPRSMD Extractor Checker
RSMDCNVEXIT Conversn to Consistent Intern. Vals
RSMDEXITON Activate Conversion Routine
RSMO Data Load Monitor Start
RSMON BW Administrator Workbench
RSMONCOLOR Traffic light color in the Monitor
RSMONITOR_DB D&B Integration
RSMONMAIL Mail Addresses for Monitor Assistant
RSNPGTEST Test Network Plan Control
RSNPGTEST2 Test Network Plan Control
RSNSPACE BW Namespace Maintenance
RSO2 Oltp Metadata Repository
RSO3 Set Up Deltas for Master Data
RSOCONTENT Administration of a Content System
RSOCOPY Copy from TLOGO Objects
RSODADMIN Administration BW Document Managemt.
RSOR BW Metadata Repository
RSORBCT BI Business Content Transfer
RSORMDR BW Metadata Repository
RSPC Process Chain Maintenance
RSPC1 Process Chain Display
RSPCM Monitor daily process chains
RSPFPAR Display profile parameter
RSQ02 Maintain InfoSets
RSQ10 SAP Query: Role Administration
RSQ11 InfoSet Query: Web reporting
RSRAJ Starts a Reporting Agent Job
RSRAM Reporting Agent Monitor
RSRAPS Manages Page Store
RSRCACHE OLAP: Cache Monitor
RSRCATTTRACE Catt transaction for trace tool
RSREP BW Administrator Workbench
RSRFCCHK RFC destinations with logon data
RSRHIERARCHYVIRT Maintain Virtual Time Hierarchies
RSRQ Data Load Monitor for a Request
RSRR_WEB Report-Report Interface in Web
RSRT Start of the report monitor
RSRT1 Start of the Report Monitor
RSRT2 Start of the Report Monitor
RSRTRACE Set trace configuration
RSRTRACETEST Trace tool configuration
RSRV Analysis and Repair of BW Objects
RSRVALT Analysis of the BW objects
RSR_TRACE Trace Monitor
RSR_WEB_VARIABLES Variable Entry in Web
RSSCD100_PFCG Change Docs for Role Administration
RSSCD100_PFCG_USER for Role Assignment
RSSCM_APPL Application settings SCM4.0 and BW
RSSD Access for scheduler
RSSE Selection start InfoCube
RSSGPCLA Maintain program class
RSSG_BROWSER Simple Data Browser
RSSM Authorizations for Reporting
RSSMQ Start Query with User
RSSMTRACE Reporting Log Authorization
RSSTARTMON Starting the monitor in parall.proc.
RSSU53 Display authorization check BW
RST22 Old Short-Dump Overview
RSTB Choose Object Name
RSTBHIST Table history
RSTG_BUPA Target Group Sel. Business Partners
RSTG_CUST Target Group Selection Customers
RSTG_DB Target Group Selection D&B
RSTG_DB_WEB Target Group Selection D&B
RSTPRFC Create Destination for After-Import
RSU0 Update rules overview
RSU1 Create update rules
RSU1I Create update rules
RSU1O Create Update Rules
RSU2 Change update rules
RSU2I Change update rules
RSU2O Change Update Rules
RSU3 Display update rules
RSU3I Display update rules
RSU3O Display Update Rules
RSU6 Delete update rules
RSU6I Delete update rules
RSU6O Delete update rules
RSU7 Data Extraction: Maintain Parameters
RSUSR003 Check standard user passwords
RSUSR200 List of Users per Login Date
RSWELOGD Delete Event Trace
RSWEWWDHMSHOW Display Background Job SWWERRERSWEWWDHSHOW Display Work Item Deadline Monitorng
RSWWCLEAR Execute Work Item Clearing Work
RSWWCOND Execute Work Item Rule Monitoring
RSWWDHEX ExecuteWorkItemDeadlineMonitoring
RSWWERRE Start
RSWWERRERSZC Copying Queries between InfoCubes
RSZDELETE Deletion of query objects
RSZT Get Test Component
RSZTESTFB Shortcut Function Test Environment
RSZV Call up of view V_RSZGLOBV
RSZVERSION Set frontend version
RS_AWB_REMOTE Remote AWB Staging
RS_BCT_BWBEOTYP Maintain BW Backend Object Types
RS_DS_CHECK Check consistency request
RS_ISTD_REMOTE Maintain InfoSource
RS_LOGSYS_CHECK Source System ToolRS_PE
RS_ACTIVATE Activation of BEx Personalization
RS_PERS_BOD_ACTIVATE Activate BEx Open Pers.
RS_PERS_BOD_DEACTIVA Deactivate Pers. for BEx Open
RS_PERS_VAR_ACTIVATE Activate Variable Pers.
RS_PERS_VAR_DEACTIVA Deactivate Pers. for Variables
RS_PERS_WTE_ACTIVATE Activate Web Template Pers.
RS_PERS_WTE_DEACTIVA Deactivate Pers. for Web Template
SP01 Spool

Using Virtual Key Figure / Characteristics in an InfoSet

Virtual Key Figures(VKF) / Characteristics can also be used in an InfoSet. An example here to demonstrate is as follows:
Example: The InfoSet ( ZV_IS1) is based on two ODSs (Product-ZV_OPD and Shipper-ZV_OSHPR) . The requirement is to create a virtual Key Figure [Discounted Price ZVPRV] which is a part of the Shipper ODS( ZV_OSHPR) which will filled up at runtime.

The algorithm of the calculation is a complex calculation and based on a Function Module(ZV_FMPRC1). Moreover ZV_FMPRC1 will input the Product No and Shipper Number, access database table and perform complex calculations and the output would be the required ZVPRV.

To complete the task please use the following methods:

1. Create a Key Figure (ZVPRV) and attach to the Shipper ODS.
2. TCode: SE19 create an implementation using definition RSR_OLAP_BADI.
3. TCpode: SE24 Create the follwing attributes by modifying the generated class name in Step 2.

For Key Figure:
Attribute : P_KYF_ZV_IS1___F38
Level : Instance Attribute
Visibility : PublicAssociation
type : I

For Characteristics:
Attribute : P_CHA_ZV_IS1___F1
Level : Instance Attribute
Visibility : PublicAssociation
type : I

Similarly you can create other Characteristic.

Note: Remember to follow the syntax for:
Key Figure P_KYF_
Characteristics P_CHA_
Visibility of the attributes must be Public rather than private
Association must be I
Level should be Instance Attribute

You can find the name of the key figure and characteristics from the query designer view of the InfoSet. As InfoSet uses a different Technical name than the underneath ODSs. In this case it uses ZV_IS1___F38 for the key figure ZVPRV, ZV_IS1___F1 for Shipper ID for example.

Step 4. Go to the Methods Section and Double Click on the Method

[IF_EX_RSR_OLAP_BADI~DEFINE]. Sample code can be used by editing the required changes.

CASE i_s_rkb1d-infocube.
WHEN 'ZV_IS1'. " When using the InfoSet
l_s_chanm-chanm = 'ZV_IS1___F1'.
l_s_chanm-mode = rrke_c_mode-read.
APPEND l_s_chanm TO c_t_chanm.
l_s_chanm-chanm = 'ZV_IS1___F37'.
l_s_chanm-mode = rrke_c_mode-read.
APPEND l_s_chanm TO c_t_chanm.
l_kyfnm = 'ZVPRV'.
l_s_chanm-mode = rrke_c_mode-no_selection.
APPEND 'ZV_IS1___F38' TO c_t_kyfnm.

WHEN OTHERS.
ENDCASE.

Step 5. Go to the Method [ IF_EX_RSR_OLAP_BADI~COMPUTE] and add the sample code .
FIELD-SYMBOLS type any.
FIELD-SYMBOLS TYPE ANY.
FIELD-SYMBOLS TYPE ANY.
DATA: l_zv_20dv TYPE curr09.

ASSIGN COMPONENT P_CHA_ZV_IS1___F1 OF STRUCTURE c_s_data TO .
ASSIGN COMPONENT P_CHA_ZV_IS1___F37 OF STRUCTURE c_s_data TO .
ASSIGN COMPONENT p_kyf_zv_is1___f38 OF STRUCTURE c_s_data TO .

CALL FUNCTION 'ZV_FMPRC1'
EXPORTING
prdt =
shipper =
IMPORTING
avg_val = l_zv_20dv.
= l_zv_20dv.

Step 6: Now you can add the Key Figure to the query and use it.

PSA EASY Maintenance Method: Search and Mass Maintenace of PSA Data

This applies to SAP BI (3.5, 3.0B, 7.x)

Summary :
There are limitations to search records in PSA and mass modify the records. PSA search in BI is a difficult task as it shows Data by Packets. Search and Replace values for a particular column in PSA is not easy. This document tries to overcome the limitations of PSA by providing customized methods. This document is divided into two parts. 1. Searching for a particular record in PSA 2. Mass change for a value in PSA [ This can be used for any other table ]

PART 1: Searching for a particular record in PSA :

Follow the steps to search a particular record in PSA


Step 1: Identify the request number from the data load monitor






Step 2: Fetch the table name for the request using the table RSTSODSPART using the Tcode SE16
Step 3: Put the request number from the Step 1 and enter into the request field and execute. It will display the record which contain the record as below.

Step 4: Select the Technical ODS name from the above screen and display the records using table name as Technical ODS name [TCode SE16 ]. Fill the Request number field from Step 1.


Here you can use filter to get the desired records.

PART 2: Mass change for a value in PSA
The ABAP program is created that can be use to replace any value from any table. This program is a generic program. If you need to alter any value from PSA it would be easy to maintain. After data load failure you find that 100,000 records contain some wrong value this program can be used to alter the values which will overcome the limit of PSA maintenance tool. This program can be used in any other application other than PSA.

Please download the file and create an ABAP program to execute.
Step1: TCODE: SE38


Step 2: This is the sample Code.
DATA :
dref TYPE REF TO data,
it_grid_fcat TYPE lvc_t_fcat,
struct_grid_lset TYPE lvc_s_layo,
tab_info LIKE TABLE OF dfies.
FIELD-SYMBOLS :
LIKE LINE OF tab_info,
**** Output Structure****
TYPE table.
PARAMETER:
p_itab TYPE tabname,
p_fname TYPE fieldname,
p_extval(30),
p_repval(30).
*Assign the input value to -tabname
ASSIGN p_itab TO -tabname .
*-tabname
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = p_itab
CHANGING
ct_fieldcat = it_grid_fcat.
*Static method - no need to create object (use => )
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_grid_fcat
IMPORTING
ep_table = dref.
ASSIGN dref->* TO .
* Fetch Data
DATA:
con_syn(50),
set_syn(50).
CONCATENATE p_fname '=' 'P_EXTVAL' INTO con_syn SEPARATED BY space.
CONCATENATE p_fname '=' 'P_REPVAL' INTO set_syn SEPARATED BY space.
UPDATE (p_itab) SET (set_syn) WHERE (con_syn).
IF sy-subrc <> 0.
WRITE: 'Mission Impossible.. Operation Failed'.
ELSE.
WRITE: 'Operation Sucess'.
ENDIF.

Step 3: Activate the program
Step 4: Run the program



  • P_ITAB contain the table name to be modified. This can contain the table identified in Step 4.
  • P_FNAME contain the field name to be modified
  • P_EXTVAL old value to be replaced
  • P_REPVAL new value.

After executing the program, if executes properly it will comes up with the following message.

If does not execute properly it will comes with error message.