Key Figures getting added
Hi All,
We arein a process of migrating 3.x Transfer rules and update rules to NW2004s. We are following the standard procedure of migrating the objects such that transfer rules are migrated to a transformations and so do update rules.
In on of the objects while running the loads after migrations the key figures are getting doubled. We were able to debug the standard code and figure out where addition is happening. Strange things is this is a standard SAP code generated in all the migrated objectsbut in this particular case it has generated some extra code which is adding up the key figures. I am pasting code below for your reference and will appreciate if someone can help us to resolve this.
As mentioned above the below Read statement is standard in all the TRCS transformations which are migrated from update rules. This read statement fails with sy-subrc = 4 because <_yth_TG_1>. is empty at this stage but during execution it executes the statement INSERT <_ys_TG_1> INTO TABLE <_yth_TG_1> which populates <_yth_TG_1> and in turn makes the next read statement successful which is extra in this case. There is one more Read statement which is extra in this particular case and is adding up the key figures.
===== PUT groups to target
IF skipseg_all IS INITIAL.
READ TABLE <_yth_TG_1>
WITH TABLE KEY
here it is reading all the different characteristics and key figurs. eliminating this to cut short the lengthof message,
ASSIGNING <_ys_TG_1>.
G1_subrc = sy-subrc.
G1_tabix = sy-tabix.
IF G1_subrc = 0.
aggregation SUM
<_ys_TG_1>-POS_FRE = <_ys_TG_1>-POS_FRE + G1-POS_FRE.
<_ys_TG_1>-POS_OCC = <_ys_TG_1>-POS_OCC + G1-POS_OCC.
<_ys_TG_1>-POS_VAC = <_ys_TG_1>-POS_VAC + G1-POS_VAC.
<_ys_TG_1>-/BIC/ZKMOSALRY = <_ys_TG_1>-/BIC/ZKMOSALRY + G1-/BIC/ZKMOSALRY.
<_ys_TG_1>-/BIC/ZFILFTEFX = <_ys_TG_1>-/BIC/ZFILFTEFX + G1-/BIC/ZFILFTEFX.
<_ys_TG_1>-/BIC/ZWRKFTEPX = <_ys_TG_1>-/BIC/ZWRKFTEPX + G1-/BIC/ZWRKFTEPX.
ls_cross-insegid = 1.
ls_cross-inrecord = l_recno_SC_1.
ls_cross-outsegid = 1.
ls_cross-outrecord = <_ys_TG_1>-record.
CALL METHOD i_r_log->add_cross_tab
EXPORTING
I_S_CROSSTAB = ls_cross.
ELSE.
ASSIGN rdsTG_1->* to <_ys_TG_1>.
CLEAR <_ys_TG_1>.
MOVE-CORRESPONDING G1 TO <_ys_TG_1>.
<_ys_TG_1>-requid = l_requid.
l_recno_TG_1 = l_recno_TG_1 + 1.
ls_cross-insegid = 1.
ls_cross-inrecord = l_recno_SC_1.
ls_cross-outsegid = 1.
ls_cross-outrecord = l_recno_TG_1.
CALL METHOD i_r_log->add_cross_tab
EXPORTING
I_S_CROSSTAB = ls_cross.
Record# in target = sy-tabix - if sorting of table won't be changed
<_ys_TG_1>-record = l_recno_TG_1.
INSERT <_ys_TG_1> INTO TABLE <_yth_TG_1>.
IF sy-subrc <> 0.
CALL METHOD cl_rsbm_log_step=>raise_step_failed_callstack.
ENDIF.
ENDIF. "Read table
This read statement is extra in this code and when this executes the sy-subrc becomes zero and then it adds up the key figures.
READ TABLE <_yth_TG_1>
WITH TABLE KEY
**This also contains the characteristics and key figures which are being update as part of the transformations
ASSIGNING <_ys_TG_1>.
G2_subrc = sy-subrc.
G2_tabix = sy-tabix.
IF G2_subrc = 0.
aggregation SUM
<_ys_TG_1>-POS_OCC = <_ys_TG_1>-POS_OCC + G2-POS_OCC.
<_ys_TG_1>-POS_VAC = <_ys_TG_1>-POS_VAC + G2-POS_VAC.
<_ys_TG_1>-POS_COUNT = <_ys_TG_1>-POS_COUNT + G2-POS_COUNT.
aggregation MAX
IF G2-POS_CTSPAN > <_ys_TG_1>-POS_CTSPAN.
<_ys_TG_1>-POS_CTSPAN = G2-POS_CTSPAN.
ENDIF.
ls_cross-insegid = 1.
ls_cross-inrecord = l_recno_SC_1.
ls_cross-outsegid = 1.
ls_cross-outrecord = <_ys_TG_1>-record.
CALL METHOD i_r_log->add_cross_tab
EXPORTING
I_S_CROSSTAB = ls_cross.
ELSE.
ASSIGN rdsTG_1->* to <_ys_TG_1>.
CLEAR <_ys_TG_1>.
<_ys_TG_1>-CURRENCY = G1-CURRENCY.
MOVE-CORRESPONDING G2 TO <_ys_TG_1>.
<_ys_TG_1>-requid = l_requid.
l_recno_TG_1 = l_recno_TG_1 + 1.
ls_cross-insegid = 1.
ls_cross-inrecord = l_recno_SC_1.
ls_cross-outsegid = 1.
ls_cross-outrecord = l_recno_TG_1.
CALL METHOD i_r_log->add_cross_tab
EXPORTING
I_S_CROSSTAB = ls_cross.
Record# in target = sy-tabix - if sorting of table won't be changed
<_ys_TG_1>-record = l_recno_TG_1.
INSERT <_ys_TG_1> INTO TABLE <_yth_TG_1>.
IF sy-subrc <> 0.
CALL METHOD cl_rsbm_log_step=>raise_step_failed_callstack.
ENDIF.
ENDIF. "Read table
Thanks for looking into this and will appreciate your response on this.
Regards
Raman
Have you tried the same thing by deleting the extra 'READ' statement?
Similar Messages
-
Key Figure getting summed up in the report
Hello BW Gurus,
Please help me out on this as soon as possible as I need to resolve this issue by the end of today.
I have a Custom Key Figure 'X' in one of my ODS and I am hardcoding it with a constant value, say 1000. When I load the data and check the ODS table, the Key Figure value is seen as 1000. But when I run a query on a multiprovider that contains this ODS and 2 other cubes ( these cubes don't have the Key Figure X), the value of the Key Figure in the output of the query is getting added up. I need to see exactly 1000 for the Custom Key Figure in the query output. Please tell me how to do this?
Your help will be greatly appreciated and equally reqarded with points.
Thank you in advance.
Best Regards,
Deepthi.Hi Deepthi,
By default, when you run a query, if the KF you are displaying is not displayed with all the characteristics it is compounded, you'll get the KF added.
an example
the ods has:
char 1 char 2 KF
1 1 1000
1 2 1000
if in the query you only include char 1, you'll get a result as follows:
char 1 KF
1 2000
Hope this helps.
Regards,
Diego -
Virual Key figure exit does not work
Hi,
Detail - We are trying to build a logic for a virtual key figure.
We have created a VKF (Virtual key figure) and added that in cube and respective multi-provider.
We also added that VKF into the query .
Now we are using following approach and it doesnot work -
Approach 1 -
We created BADi called ZBIVAR_IMP based on RSR_OLAP_BADI using SE19 transaction. In this definition , we included our class - ZCL_IM_BIVAR_IMP
We activated this BADi definition and then in our Z Class - we have 3 methods, define, initialize and compute. We activated break-point .
We wrote a code there and followed sample code of CL_EXM_IM_RSR_OLAP_BADI class.
Now when we try to excute our query from RSRT, system doesnot stop at our break-point. In another words, this BADi is not getting called.
We also observed following settings if that matters --
1) When we go to RSRT for the query name and click on option, "No paraller processing" is on.
2) When we go to RSRT and click on technical info, we see "Virtual key Figure" property is set to NO. If this needs to be changed then how do we do that?
3) We activated BADi definition but not sure if we need to activate BADi implementation , if yes then how?
Approach 2 -
We develop code in one of the BEx user exit called EXIT_SAPMRSRU_001
In this exit , we have include called INCLUDE ZXRSRU02 .
We donot have any other includes such as ZXRSRZZZ or ZXRSRTOP. To be frank , we donot know how to use these includes and where are those available to be used?
Problem of this approach is we cannot use C_S_DATA that gets final logic of key figure to be used in BEx report.
Both of these approaches doesnot work..
Your help in this regard will be highly appreciated.
Thanks,
Raj.Hi BI technical folks..
I also have simillar issue at my place. Can someone help?
Thanks
A -
Key figure routine in update rules
I have a Cube (X) that gets data from a ODS (A) but one of the key figures gets the data from another ODS (B) with a routine in update rules and I want to change it to ODS (C)
A (All objects except one) - X (All objects except one)
B (0DEB_CRE_LC) - X (0DEB_CRE_LC)
select sum( DEB_CRE_LC )
into RESULT
from /BIC/AZDOC_SUB00
where OI_EBELN EQ COMM_STRUCTURE-OI_EBELN
and OI_EBELP EQ COMM_STRUCTURE-OI_EBELP
and /BIC/ZCLASC_ID EQ COMM_STRUCTURE-/BIC/ZCLASC_ID
and PSTNG_DATE LE l_datafim
and PSTNG_DATE GE l_datainicio
and /BIC/ZTPOPER = '9'.
My problem is that my ODS (C) doesn't have 0DEB_CRE_LC and the values are divided in 2 key figures (D) & (E), I want to sum both key figures into 0DEB_CRE_LC of the cube.
I tried a tip from a friend but didn't work, I'm lost (newbie), and apreciated some tips, it doesn't seem to sum anything
data: result1 type /BIC/AZPUR_S0100-/BIC/ZSLIQ_VAL,
result2 type /BIC/AZPUR_S0100-/BIC/ZSIVA_VAL.
select sum( /BIC/ZSLIQ_VAL ) sum( /BIC/ZSIVA_VAL )
into (RESULT1, RESULT2)
from /BIC/AZPUR_S0100
where OI_EBELN EQ COMM_STRUCTURE-OI_EBELN
and OI_EBELP EQ COMM_STRUCTURE-OI_EBELP
and /BIC/ZCLASC_ID EQ COMM_STRUCTURE-/BIC/ZCLASC_ID
and PSTNG_DATE LE l_datafim
and PSTNG_DATE GE l_datainicio.
write result1.
write result2.
Many thankxdata: result1 type /BIC/AZPUR_S0100-/BIC/ZSLIQ_VAL,
result2 type /BIC/AZPUR_S0100-/BIC/ZSIVA_VAL.
select sum( /BIC/ZSLIQ_VAL ) sum( /BIC/ZSIVA_VAL )
into (RESULT1, RESULT2)
from /BIC/AZPUR_S0100
where OI_EBELN EQ COMM_STRUCTURE-OI_EBELN
and OI_EBELP EQ COMM_STRUCTURE-OI_EBELP
and /BIC/ZCLASC_ID EQ COMM_STRUCTURE-/BIC/ZCLASC_ID
and PSTNG_DATE LE l_datafim
and PSTNG_DATE GE l_datainicio.
write result1.
write result2.
<u>RESULT = result1 + result2</u>
I still have to test it, first i was getting syntax errors because I didn't put spaces right sorry -
Hi group!!!
I need to add a unit of measure( i have it as char) to a calculated key figure in the report. I have done it several times when it is key figure by adding the unit when editing. I do not find the way when it is a "calculated key figure" Does any one know how it can be done?
Thank in advance for your help!!!!Hi Karthik,
This can be done with percentage functions available at Caluated keyfigure and new selection.
change CKF Margin % to (margin (ckf) Percentage Variance (%) gross sales (CKF))
Result will display like this 20.01%.
[http://help.sap.com/saphelp_nw70/helpdata/EN/e2/16f13a2f160f28e10000000a114084/content.htm]
Hope this helps.
Hi David, i am using this thread to answer Karthik's post.
best Regards -
Non cumulative key figure is not getting filled based on inflow and outflow
hi,
i have a non cumulative key figure which is having inflow and outflow.
i have these three info objects in dso.
as i know non *** key figure is calculated based on inflow and outflow.
i am getting values for inflow and outflow so non *** should be calculated based on this values.
<b>but the collumn is blank in the dso</b>
in that non *** keyfigure i have added two info objects in inflow and outflow.
is there any other setting i nedd to do?
please sugest me.
its urgentHi Venkat,
Have you followed the process right. First Filling the Initial Stocks and then Inflow and Out Flow and then Delta. If you follow the process correctly then you can able to view the Data in the Reporting Level.
For Initial Stocks the Marker Should be set. For Inflow and Outflow the Marker should not be set.
Hope This Helps,
Regards,
rik -
Added new key figure in the report
Experts,
I have added new key figure in the report .If i display this key figure value in the report it is populating correct value with ERROR(example 22.5 ERROR).The report is on the multiprovider .i have check the value for this in multiprovider it is populating correctly .There is no calculation in the report for this .While extracting in to report i am getting this. Help me to resolve this issue.
Thanks
MuraliHi,
I have already created a formula like NODIM(Key field).that only i am using .
and mapping I did in this way. I went to multiprovider and I have selected this key figure and right click and select (assign) then I have click on create proposal for all infoobjects option.
Please suggest any thing need to do.
I am sorry .I did not understand the lonterm solution suggested by you .what is UOM .Please tell me how to map.can you pls tell me clearly please
Thanks
Murali -
Virtual Key figure not getting populated
Hi All,
I have included a virtual key figure in a multiprovider on which the query is created and its underlying ODS.
This issue is the virtual key figure is not getting populated . I am not sure what I am missing
I did the following :
1) Tried Debugging - Put a break point and execute the query in RSRT.It did not go to the Exit. I also tried generating the query from RSRT.
I am using the BADI (RSR_OLAP_BADI) to populate the Vir Key Fig.
Please guide me.
Thanks,
HMHi All,
Now that I am able to get the logic to come up in debug. I am faced with another issue.
I am implementing avery simple logic . I added a integer type key figure to the ODS and I am tryin to assign value 1 to the the key figure in the code (I am assigning 1 just ot check if the value is passed to query or not. I do have acomplex logic tha i need to implement).
Here I am able ot see the value in the debug but in the qury the value is not populated.
N ot sure what might be going wrong.
code is
l_z_avg = 1.
<fs_zavglate> = l_z_avg .
Appreciate help.
Thanks,
HM -
To get rid of * in the total result of all key figures.
Hi all,
I have one query and in that I have three characteristics and one key figure. and corresponding to each characteristics my key figures values are added. But due to different units of measure in the grand total a star(*) is appearing and the thing is that I cant change the design meas do not want to change the design.I want to get rid of this . Plz help me out in this I need to solve this urgently.
query is like this:
characteristics keyfigure
p1 2010 100
200
300
p2 2010 200
200
400
p3 2010 100
100
200
grand total 900* units of measure are different.Hi,
The asterisk (*) value is maintained in the Mixed values tab of transaction RSCUSTV4. You can replace the asterisk with any text you want to display in the report.
If you select Mixed values checkbox below, the numeric value from mixed currencies/units will be displayed in the report.
But please remember that, any changes you make in Transaction RSCUSTV4 is a Global setting and will affect all the queries.
NODIM is the better option as it will affect only the required keyfigures in a query.
Regards,
Hari -
Adding a new key figure to Info Cube
Can I add a new key figure to an existing Info cube in which data is loaded?
Assume that In Info Cube we have the following.
Stu Id -- Characteristic
Maths , Physics , Chemistry -- Key figures
These are the info objects which are already available and transfer rules are already available for the same in the infosource.
Could any one let me know how to add one more new key figure (total ) , which is the sum of the three marks to the Info Cube and populate the data in to the same.
I have tried the following steps , but could not get the solution.
1). Create a new key figure info object (total).
2). Add the same to the communication and pull the same into transfer rules of the existing info source and activate the same.
3). Add the new key figure to the info cube.
4). Open transfer rules for the info cube and change the mode from NO updation to Addition for the particular key figure (total).
When I perform the 4th step it is giving a red symbol beside the key figure in update rules and I'm not able to activate the same.
Any help on how to add key figures to update rules and transfer rules is highly appreciated and points would be assigned.
Thanks1.add new Keyfigure to Infocube.
2.Go to Update rules> go to update type of that Keyfigure>selct formula in update method>create new formula>here you can add up your 3 keyfigures-->OK.
activate update rules and InfoProvider.Check all are active or not..
by using Export generate datasouce ,you populate data(historical data) to new keyfigure as well.Then you have to delete historical data requests.
or iyou can create formula in query designer as well as srinivas suggested.that would be better option. -
How to Get Value from a Variable to restrict a Key Figure ?
I am trying to make a query in Query designer, we are running BI7.
I have a user entry veriable on the Fiscal year period, the user will need to enter a period they want the report for, i.e. 07.2008 for July 2008 report and 04.2008 for April 2008 report.
Based on what the user entered as the starting period (in the variable entry), I have to then use that initial value and show the Year to date value (of sales etc) in the next column.
To Clarify, if user entered 07.2008 then all the data from 01.2008 to 07.2008 needs to be in the next column. if user entered 04.2008 then all the data from 01.2008 to 04.2008 should be in the next column.
So to summarise according to my understanding, I want to get the value from a variable and pass it onto another variable to restrict a key firgure (sales amount)...
Can someone please clarify what i need to do here?
Many thanks in advance, points will be awarded accordingly.hi,
please follow the below steps:
1. Create a new varialbe , this variable should be processed by customer exit.
2. In the column section, create a new column and drag the sales key figure, also drag fiscal year period and restrict with the new variable.
3. In the cmod tcode write a customer exit code to extract the value of the user entry and assign it your variable, you can refer to the below code.
WHEN '< New VAR name>'.
IF I_STEP = '2'. "AFTER THE POPUP
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = '<Fiscal Year Period VAR Name>'.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = LOC_VAR_RANGE-LOW(4).
L_S_RANGE-LOW+4(3) = '001'.
L_S_RANGE-HIGH = LOC_VAR_RANGE-LOW. "LOW E.G. 2001006
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'BT'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
ENDIF.
For ex- if the user enters 008/2008, this code will create as range assign 001/2008 - 008/2008 value to the variable.
hope it helps,
rgs,
Parth. -
Urgent: Error in uploading data in cube after adding new Key figure
Hi Guys,
I have added 1 key figure (DEC) to my existing cube. and proceeded as below:
1. Deleted all data from cube
2. activated the cube
3. set Constant 1 for this key figure
4. activated the transformation
5. reated a new DTP
But when i execute it, it gives me error. in updating to infocube ZSDBILL:
Error while updating to target ZSDBILL
Process Terminated.
all other steps in DTP are succesful like: extraction, error handling and transformation.
There is no details in long text of these errors.
Can anyone suggest whats the error stands for or what i am missing.Once logout and login back then again activate cube,transformation and run the DTP.
Hope it helps you -
Hi friends...
I have a scenerio , where I have loaded the data from 3 different data sources say A , B and C in to 2 different DSO s and in to 2 different Info Cubes. And I have built Multi Provider from this 2 Info cubes.
In the data source B , I have BELNR (Parked document number ).WRBTR (for Amount). In the report I have to show a field called Nr of Documents Parked and Value of Documents Parked. Same thing for Data Source C, for Blocked Documents. Now My question is there is no Key Figure in My Data Model to Count the Nr of Parked / Blocked Docs....So in the Reporting how can I show this ? Do I need to use Customer Exits ? Do I need to have CKF /RKF ? if so , from what Key figures ? or Can I get the Count from the Backend (Modelling itself by using a Keyfigure with any Code)?...not only this 2 , I have lot many custom things to do in my Model...If any one can get me some idea on this , remaining will be very easier for me as they all are similar things to do....
Please let me know if you have any questions or I need to elabarate it more to get an Idea on this....
Thanks in advanceTHANKS GUYS ,
I wrote the transformation routiene to count all the parked documents as
IMPORTING
request type rsrequest
datapackid type rsdatapid
SOURCE_FIELDS-/BIC/ZPARKBEF TYPE /BIC/OIZPARKBEF
EXPORTING
RESULT type tys_TG_1-RSTT_IPTDA
DATA TMP TYPE tys_TG_1-RSTT_IPTDA.
IF SOURCE_FIELDS-/BIC/ZPARKBEF = 'Y'.
TMP = TMP + 1.
ENDIF.
RESULT = TMP .
But when I see the Infocube data its showing only 0 for Parked Before value 'N' and 1 for Parked Before vale 'Y'. But I want to calculate total number of parked documents ..How can I do this?
Thanks -
Multiplying Cases by USD in Key Figure. How to get rid of CS in the result
Experts -
I have a formula where I am multiplying a quantity by an amount. Both have unit/currency attached to it.
For example : Quantity is 5 CS and Amount is $2.00
I have a formula Total = Quantity * Amount
Results are displaying like $ 10.00 CS. I need just $ 10.00 to display
How can I divide the formula by CS .. I have tried replacement path variable assigned value of 1 and unit of CS but that doesnt seem to work.. (unless Im using wrong settings)
Also adding a dummy key Figure = 1 CS for all records in backend objects and then using it to divide doesnt sound as the best solution
Can you please advice? Thanks in advance!Hi,
Try this
Total= Quantitity* NO DIM( Amount) or take a dummy keyfigure of amount with out curreency.
Regards,
Sai. -
Adding new key figures to DP planning area
I am using APO DP.
When adding new key figures to a planning area, is there any way of avoiding having to deinitialise and then re initialise the planning area?
Thanks for any advice on this...First of, let us know which version of DP are you using.
If you are using 7.0, all you need to do is right click on your planning area and select Change Keyfigure setting and you should be able to update the key figures there.
The below is from SAP help for SAP APO 7.0, you should be able to add the key figure without deinitializing the planning area.
Key Figure Settings
Here you can change the properties of the key figures of a planning area, if the planning area has already been initialized. You can also add or delete key figures. However, you can only delete key figures that are no longer used in planning books, data views, macros, or demand forecasts. You can find out in which objects a specific key figure is used with the where-used list.
Maybe you are looking for
-
How to create 2 lines header in Report painter
Hi. I am not good at Report painter. I want to create 2 lines header in Report painter just like SAP std report. When I create a new form, I only have one line header form but cannot add additional header line. I am looking at the 0SAPFS10-01 Trans.F
-
HT203433 ITunes not automatically downloading Episodes
Heres the short version: I bought Continuum Season 2 "Pass" for like 34.99 USD The 2nd Episode when it was available; since I got the email; upon turning on computer, launching Itunes; and signing into my acct; it didnt auto download that episode. E
-
We have a DVD-R sent to us for a small FCP project that refuses to play correctly in our older (but totally up to date with OS 10.5 and FCP Suite 2). Herky jerky jump then stop as if the machine cannot keep up with the data flow. Drag and drop the fi
-
Configure Ext. mail sending based on distribution channel automatically !
Hi, Is it possible to configure external mail sending based on distribution channel automatically whenever a sales order is created without adding output type in Extras-output u2013 header-Edit. I have created output type to send mail whenever a sale
-
Hi, I'm trying to deploy the OBIEE VM provided by Oracle http://www.oracle.com/technetwork/middleware/bi-foundation/obiee-samples-167534.html I have downloaded all 11 archives (and unzipped them with 7zip), as well as the ovf file. I also have instal