Simple update rule question
Hi Gurus, you gave me the right answer, but please help me with this, i see below update rule, it does not tell me the logic or program how it populate the group cost
tell me where i can find the programs for update rule in system by looking below code or from ur knowledge. its very imp for me to understand how the group cost get the value but there is no code it just say result = ws_zgrp_cost which is not the answer please help
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: ... DATA: /BIC/AZCOPC_O200.
DATA: WS_ZLGL_COST(16) decimals 2 TYPE P,
WS_ZGRP_COST(16) decimals 2 TYPE P.
DATA: ZPRICE_AVG LIKE /BIC/AZCOPC_O100-PRICE_AVG.
DATA: ZPRICE_STD LIKE /BIC/AZCOPC_O100-PRICE_STD.
DATA: ZPRICE_VAL LIKE /BIC/AZCOPC_O100-PRICE_VAL.
DATA: ZPRICE_VAL1 LIKE /BIC/AZCOPC_O100-PRICE_VAL.
DATA: ZPRICE_VAL2 LIKE /BIC/AZCOPC_O100-PRICE_VAL.
CLEAR WS_ZLGL_COST.
CLEAR WS_ZGRP_COST.
DATA: i_/BIC/AZCOPC_O140 like /BIC/AZCOPC_O140.
$$ end of global - insert your declaration only before this line -
FORM compute_data_field
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
USING COMM_STRUCTURE LIKE /BIC/CS0CO_PC_ACT_05
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BIC/AZCOPC_O100-/BIC/ZGRP_COST
RETURNCODE LIKE SY-SUBRC "Do not use!
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line -
fill the internal table "MONITOR", to make monitor entries
result value of the routine
RESULT = ws_zgrp_cost.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.
Hi Sonia,
Definitely, the value for that field is not calculated at this UR level. If there is a start routine, it might have been calculated/derived there. If it is pdated for all records in the start routine it does not make sense to have a UR just to assign this as it is already assigned in the start routine. Please check you start routine. Hope this helps.
Thanks and Regards
Subray Hegde
Similar Messages
-
An update rule question - Filter out categories within an update rule
Hi All,
I am trying to filter out some categories within the update rule and I appreciate any help with points.
Here is the scenario:
My category field is Z_CAT and I want to delete all the categories except 'A' 'B' and 'C'.
I tried couple routines but non of them worked fine so far.
Regards,
MikeHI Mike,
One is that is suggested by my friends
Instead of a Hardcore filter based on your requirement In the DTP you can filter the data .
In the DTP ,Se;ect that object in the Filter and select the Criteria as Not Equal to A B and C and then Extract the data.
The advantage is that even if u want to filter or add one category say "D" the it is posiible at the DTP level whereas at the Routnie level u have to make changes and collect them i a request and then u have to transport it.
So decide based on ur requirement.
Rgds
SVU123
Edited by: svu123 on Mar 25, 2009 7:19 PM -
I ought to know the answer to this - but find I don't!
Why does my *Bar Ruler* show subdivisions/increments of 3's ( +1, 1.3, 2, 2.3+ ) even which I'm using a time signature of 4/4?
Have I inadvertently changed a default setting somewhere?
Any explanations gratefully received.
TIA!seeren,
Of course!
Thanks; you've helped. All making sense now.
I guess it was all too easy to think as computer people when '0' is the first in any series -
Can I use the Debugger to debug why a line in UPDATE RULE gives no values?
Hi,
in a simple Update Rule, I had the routine below:
RESULT = SOURCE_FIELDS-QTY.
"( The goal was to calculate the field MyCclQTY in the cube; Routine was between ODS and Cube ):
The cube output gave a BLANK while QTY has 300; although I expected to see 300 for MyCclQTY:
e.g. of Cube Output:
QTY---MyCclQTY
300------BLANK
In the attempt to see what is going on, I used the Debugger for the first time.
In the update routine for MyCclQTY, I added the line break-point as follows as a booklet I am reviewing, directs:
Break-Point.
RESULT = SOURCE_FIELDS-QTY.
Now when I switched to the debugging mode, I run Single Step.
I was not too sure what to do here other than, continuously clicking on Single Step.
When it got to the line:
== > catch cx_sy_move_cast_error.
A message appeared at the bottom of the screen
u201CException from the class CX_SY_MOVE_CAST_ERROR was caught u201C appeared at bottom of screen.
1. Any hints on this message?
2. On the screen in the booklet that I am review, there was a split screen with the one on the right side showing values but I could not get that on my screen. Any hints on that?
Thanks.Hi........
You can try to catch this exception :
Dynamic Proxies in ABAP Part 2: RTTI Retrieval
Regards,
Debjani.......... -
Simple creation of Update Rule from BW Data Source
Hi guys,
Pertaining standard SAP Business Content extractors
I am referring to <b>InfoCube : 0PA_C01(Headcount and Personnel Actions)</b>
I am attempting to<u> create </u>an <b>Update Rule</b> from <b>Info Source : 0HR_PA_PA_1(Headcount)</b>
This <b>Info Source : 0HR_PA_PA_1(Headcount)</b> is connected to <b>BW Data Source</b>(Not R/3!) 0HR_PA_PA_1
I have created an Info Package for this Info Source and managed to get 15 records{In Contrast to my 68800 Records from Info Source : 0HR_PA_0(Employee)}
So, when I create an Update Rule to Connect <b>Info Cube: 0PA_C01(Headcount and Personnel Actions)</b> to <b>Info Source to Info Source : 0HR_PA_PA_1(Headcount)</b>, I get the following error
ERROR : <b>IC=0PA_C01 IS=0HR_PA_PA_1 error when checking the update rules</b>
Could you please also advice, why do I only get 15 records for Data Source 0HR_PA_PA_1 ?
P/S : I am on BW 3.5Hey Rohini,
This <b>Data Source: 0HR_PA_PA_1(Headcount)</b> is tricky to me because it`s a BW Data Source.
Exact Error Message is as follows :-
"<b>Error Message : RSAU461
IC=0PA_C01 IS=0HR_PA_PA_1 error when checking the update rules</b> "
My Exact Problem is that I don`t see any values for the following fields in my Info Cube : 0PA_C01(Headcount and Personnel Actions)
Country;
Country Code;
Gender;
Nationality;
Language;
Postal Code;
Region;
Position;
Job;
Payroll Area;
Payroll Group;
Pay Scale's;
Pay Grade's
This is because, this information is supplied by InfoSource : 0HR_PA_PA_1
But I don`t have an Update Rule for this InfoSource in my InfoCube : 0PA_C01
So, that's why I am attempting to create this additional Update Rule
<i> And also, could someone enlighten me why would SAP not include such a standard Update Rule when they have already idenfied those needed fields in a Cube ? This is suppose to be a STANDARD workable Business Content right ?</i>
P/S: I have applied Note : 336229 -
Inserting code in final steps of Update Rule transformation
Hi,
I am extracting data into a cube from an ODS and doing some aggregation in the process. E.g 3 records in the ODS might become 1 in the cube.
This is fine for some things like Quantity, but not ideal for things like unit price. One work around is for the ODS to have a counter.
e.g
MATERIAL QUANITITY UNIT_PRICE COUNTER
1234 13 $1.50 1
1234 21 $1.50 1
1234 45 $1.50 1
This comes across into a cube like
MATERIAL QUANITITY UNIT_PRICE COUNTER
1234 79 $4.50 3
- unit price can then be calculated by dividing unit price by counter - however it needs to be done within the query.
I thought perhaps we could perform this calculation when populating the cube, if the items were firstly collected within an interim table before being passed to the return_table.
i.e
1. Define key figure using ABAP routine and return table.
2. Append INTERIM_TABLE within update rules for each read of the ODS
3. Once all ODS records have been read and inserted at an aggregate level within INTERIM_TABLE, loop through INTERIM_TABLE, perform calculation and append RETURN_TABLE.
My question is: Is there a simple way to determine that all ODS items have been read (like an "at last" statement) and if so, where can this code be inserted? Can it be simply placed in the update rules routine if I have the appropriate logic to determine that all items have been read?
Thanks
AdrianHi Adrian,
Why cant you use Addition, minimum or maximum in update rules...?? Here you can use Maximum option for Unit Price.
http://help.sap.com/saphelp_nw04/helpdata/en/3f/0e503c3c0d563de10000000a114084/content.htm
Hope it Helps
Srini -
Data package's data coolection in one internal table of Update rule in bw
Hello Gurus,
I have a requirement in bw which demands to create update routine, in which I need to find the vendor for the material, which doesn't have vendor by some business rule but, here in this case data is divided into different datapackages so here in this case material data is splited over different datapackages.
One material can have n no of records with differnt plants.
My only question is like can we collect all datapackage data in one internal table.
Ex: if there are total 5 datapckages, so in update rule can we collect all these datapackages records?
Please suggest your opinion.
Thanks in advance,
Snehal.
Moderator message: please have a look in the BW forums.
Edited by: Thomas Zloch on Jan 11, 2011 1:49 PMhi,
i think your problem is need of a work area...
Using "FOR ALL ENTRIES IN lt_zhrp" You must use " check lt_zhrp is not initial "
DATA: lt_zhrp TYPE STANDARD TABLE OF zhrp,
lt_zhrt TYPE STANDARD TABLE OF zhrt.
*new
data: wa_zhrp type lt_zhrp.
SELECT tabnr
FROM zhrp
INTO CORRESPONDING FIELDS OF TABLE lt_zhrp
WHERE objid = lv_posid.
LOOP AT lt_zhrp INTO wa_zhrp.
SELECT low
FROM zhrt
INTO CORRESPONDING FIELDS OF TABLE lt_zhrt
WHERE tabnr = wa_zhrp-tabnr " lt_zhrp-tabnr
AND attrib = 'NET_VALUE'.
ENDLOOP.
Edited by: Miguel Antunes on Apr 28, 2010 4:22 PM -
"Error when activating update rule" after changing ODS key
Hi Gurus,
I have problem when transporting in productive system an existing ODS & the update rule linked. The message is : "Error when activating update rule".
This is when i move one field from the key to a simple field of the ODS.
Before transporting requests, i deleted data in the ODS by right-click on ODS --> Request tab --> select the request --> click on delete....
I don't understand because i did the same in Qual environment and everything is OK : transport request & ODS loading...
Please help.....Hello,
Please try to check/perform the following steps:
1- You must ensure for the update rule have mapping between infosources
and ODS/CUBEs correct, this means that also these objects need
to be of the same version in the source system of the transport as in
target system.
2- Please ensure all infoobjects in the cube are active.Please
reactivate all the objects again in source system.
3- Ensure all infoobjects are found in the communication structure.
4- Please try to collect the update rule via BW transport connection
with the grouping option "only necessary objects" and then transport
those objects again.
Could you please reactivate the infocube and its update rules again
and then create a new transport for this infocube and transport it
again.
Best regards,
Paula Csete -
How do I tell if a particular update rule is used
I have inherited a sales reporting application in BW 3.5. It has update rules from 2LIS_13_VDITM to 4 level 1 ODS. There are update rules from those 4 level 1 ODS to Level 2 ODS and cubes. So far so good. However there are also update rules from 2LIS_13_VDITM to the L2 ODS and to the cubes direct.
My belief is that these update rules are never used. This is based on the production infopackage settings which do NOT have these objects ticked as data targets. However i would like to know for sure that these update rules have never been used.
Question: Is there a way to tell this eg.
a) is there a table linking infosource to destination with a date last used,
b) or a table linking infopackage to destinations showing when a particular destination was last changed,
c) or some other mechanism?Hi,
Chk the L2 ODS which have update rules from 2LIS_13_VDITM if it has data loaded in it in production.
If its loaded means it is used.
You can also chk whether the InfoPackage which loads this data is used in any process chain, and then chk if that chain is scheduled in production.
Regards,
Mansi -
Update rules Activation Problem
Hi,
Iam getting the error while transporting the update rules to production,saying error mesage,
Start of the after-import method for object type R3TR UPDR (Activation Mode)
Update rules 4AR6MO7P6M428KB2RPA65E9EX read in version M
Error when activating update rule 4AR6MO7P6M428KB2RPA65E9EX
Activation of the update rules for ZCG_O15 ZBW_CRTDN
IC=ZCG_O15 IS=ZBW_CRTDN error when checking the update rules.
from Dev to QA successfully transported and data hasbeen loaded with out any issues,
I didnot changed any thing in ODS,I Just created the new infosource with only two characteristics and created the update rules direct updating,with out any routines.
I activated the update rules in Dev couple of times and transported to PD,but every time it is giving same error,there was no issues upto QA,
Please suggest anybody how to resolve this issue.
Thanks
BI USERHi
Thanks for your replies,
Iam checking from transport request error log,iam getting error message as I mentioned in my question,
iam not getting detail information on error log,Update rules are available in PD system but in inactive state,
I did the Update rules check it is giving message 'no erreors found in update rules'.
I collected all dependent objects from transport collecter,still same error,I tried from Program
RSAU_UPDR_REACTIVATE_ALL,but my PD system is in not modifiable state.
Thanks -
Error while maintaining the Update Rules for the Infostructure
Hi,
I have added 2 new characteristics for the existing infostructure S9xx and executed the same. While maintaining the Update Rules for the same, system is giving the error message 1. "Field 'PARVW' unknown" and 2. Error generating program RMCX0011.
Please guide me in resolving the issue.
Thanks & Regards,
Kumar.Hi,
This is with reference to my earlier question that an error is occuring while maintaining the update rules for the existing Infostructure.
Solution provider for this will be rewarded with good points.
Regards,
Kumar. -
Cannot Create Update Rule from Infosource to Cube
Hello;
I am a beginner to BI and am learning. This may be a very basic question, but I got stuck.
In the create update rule screen, I get an error message that says
Data Source (whatever the name is) not maintained. (check your entries)
Could some one help as to where I went wrong?
Thx,
Sushma
SuGoto your InfoSource and open DataSource Structure and transfer structure. Check if the structure is correct, make the necessary changes if required and activate it. Then create update rules providing correct infosource name. Until you create /activate your transfer structure, you won't be able to create update rules.
Reward point if helps.
Regards,
Ashok
Message was edited by:
ashok saha -
Copy Update Rule from Business Content
Hi All,
Currently I have activated some standard BI Content E.g. InfoCube 0FIAR_C03, DSO 0FIAR_O03, InfoSource 0FI_AR_4 and all the corresponding update rules.
Now I have copied both InfoCube and DSO into another customized version E.g. ZAR_C03 and ZAR_O03. I managed to copy the same update rule from InfoSource 0FI_AR_4 to ZAR_O03 using the template but I don't have the option of copying the same update rule from ZAR_O03 to ZAR_C03 using the same update rule of 0FIAR_O03 to 0FIAR_C03.
I know I have the choice to manually re-create all the details but is there any other workaround?
Please read through carefully my question. I have seen some forum asking to load data from 0FIAR_O03 to then ZAR_O03 then so forth.
Purpose of doing the above method is because I want to remain the business content as what it is and just to copy it to Z version for customization.
Thanks
David YeeHi All,
Is there any other second opinion related to this issue before I close the question?
Thanks
David Yee -
Hi, my problem may be simple to solve, but I dont know too much ABAP so need some help.
I want to populate Cost Center in my cube by mapping it to Responsible Cost Center (attribute of Order Number).
How can I do that?
Thanks,
FrankHi Frank,
Insert Cost Center in Communication Structure and then in Start Routine of Update Rules insert this code (substitute definition with the IO code, cut off '0'):
data: begin of t_costcent occurs 0,
costcenter like /BI0/Pcostcenter-costcenter,
responsible like /BI0/Pcostcenter-responsible,
end of t_costcent.
select * into corresponding fields of table t_costcent
from /BI0/Pcostcenter where objvers = 'A'.
loop at DATA_PACKAGE.
read table t_costcent with key
responsible = DATA_PACKAGE-responsible
if sy-subrc = 0.
DATA_PACKAGE-costcenter = t_costcent-costcenter.
modify DATA_PACKAGE.
endif.
endloop.
Ciao.
Riccardo. -
ABAP assistance - start routine logic in update rule
I have used an existing update rule and have based my logic around the same. The purpose of the rule is to look up customer master data and get a subset of customer numbers from the transaction records so that the values for customer number from the transactional data will not be updated if it does not match with existing master data customer numbers.
The loads are full and we drop the data before we load.
I have listed the logic below (the number at the front is to be considered as the line number) and a list of open questions that I have thereafter:
Start routine logic:
1 DATA: l_index LIKE sy-tabix.
2 DATA: BEGIN OF ls_customer,
3 customer TYPE /BI0/OICUSTOMER,
4 objver TYPE RSOBJVERS,
5 END OF ls_customer,
6 lt_customer LIKE TABLE OF ls_customer.
7 REFRESH: lt_customer.
8 LOOP AT DATA_PACKAGE.
all customers from data package
9 ls_customer-custno = DATA_PACKAGE-custid.
10 ls_customer-objver = 'A'
11 APPEND ls_customer TO lt_customer.
12 ENDLOOP.
12 SORT lt_customer.
13 DELETE ADJACENT DUPLICATES FROM lt_customer.
14 IF NOT lt_customer[] IS INITIAL.
15 SELECT /BI0/OICUSTOMER RSOBJVERS
16 FROM /BI0/PCUSTOMER
17 INTO CORRESPONDING FIELDS OF TABLE lt_customer
18 FOR ALL ENTRIES IN lt_customer
19 WHERE ls_customer-custno = DATA_PACKAGE-custid
20 AND ls_customer-objver = 'A'
21 SORT lt_customer BY customer ASCENDING
22 ENDIF.
Questions
Line
1 - what is the purpose of this line? What is it that is being declared
2 - in some code I have seen this line with OCCURS 0 at the end what does this mean with and without the term?
4 - I am using the Data Element name is this correct or should I use the field name?
3 - 5 here I declare an internal structure/table is that correct?
6 - here I declare a work area based on the internal table is that correct?
7 - What would happen if I avoided using the REFRESH statement?
8 - 12 - Is this syntactically correct, I am trying to get a set of data which is the customer numbers which match the master data customers and the master data record is án active version and than appendíng to the work area?
13 - My understanding is this will reduce the number of records in the work area is this correct and needed?
14 - 22 I am trying to identify my required set of data but feel I am repeating myself, could someone advise?
Finally what logic would I actually need to write in the key figure object, could I use something like:
Result = lt_customer.
Thanks
Edited by: Niten Shah on Jun 30, 2008 8:06 PM1. This line is not required
2. OCCURS 0 is the OLD way of defining an internal table with that structure. As it is, it just defines a flat structure.
3. Data element is usually best
3-5 Yes
6. No. Here you are declaring a table of the type of the flat structure. Just as the ABAP says!
7. Nothing. But by putting this in, you ensure that you know the state of the table (empty) before you start looping through the data package
8-12. You can tell if it is syntactically correct by pressing Ctrl-F2 when in the editor. Looks ok.
13. Ensures your list of customers contains no duplicated. The code up to this point is building a list of all the unique customers in the data package.
14-22. Goes to the database and brings back ONLY those customers which are found in the master data. Looks ok.
This is a start routine (that's why you've got a data package). You don't use result. You should update the datapackage. But this you haven't done. Double click on the table name /BIC/PCUSTOMER to get the correct field names.
So you have to loop through the data package again, and check if the customer in the datapackage is lt_customer. If it is, fine, otherwise you blank it and report an error, or set an error message or whatever.
I wouldn't do it like this. I'd do something like this:
STATICS: st_customer TYPE HASHED TABLE OF TYPE /bi0/oicustomer
WITH UNIQUE KEY TABLE_LINE.
* st_customer retains its value between calls, so only populate if empty
* In one run of the infopackage, this will mean you do only one read of
* the master data, so very efficient.
IF st_customer IS INITIAL.
SELECT customer FROM /BI0/PCUSTOMER
INTO TABLE st_customer
WHERE objvers EQ 'A'. " Only active values
ENDIF.
* Go through data package
LOOP AT DATA_PACKAGE.
* Check whether the customer exists.
READ TABLE st_customer TRANSPORTING NO FIELDS
WITH TABLE KEY table_line = DATA_PACKAGE-custid.
CHECK sy-subrc IS NOT INITIAL.
* If you get here, the customer isn't valid. So I'm just setting it blank
CLEAR DATA_PACKAGE-custid.
MODIFY DATA_PACKAGE. " Updates the datapackage record
ENDLOOP.
Even this is not fully optimised, but it's not bad.
I strongly suggest that you get yourself sent on the basic ABAP programming course if you're going to do a lot of this. Otherwise, read the ABAP documentation in the help.sap.com, and, from the editor, get the cursor on each ABAP keyword and press F1 to read the ABAP help.
matt
Maybe you are looking for
-
I'm 67 yrs. old.I live in the U.K. I want to use my credit in i-tunes to find the Yoga Studio app. for my MacBook Air laptop.All I can find are apps. for i-phones,i-pads and i-pods.Can anyone help please.
-
Used black ink cartridge in use
I own a HP Laserjet M2727 MFP series 5.2 . A message appears " Used black ink cartridge in use". I have ink in the cartridge because i can print from the flat bed no problem. What does this message mean and how can i fix it? Thx.
-
Bootable Backup- created and works BUT....
I've got a full bootable backup on my external lacie firewire drive. My PB G4 15" can boot from it, happily. (tiger, not leopard) My question is what other macs could boot off the drive? e.g. MacMini, Macbook, Macbook pro (intel)? or is the bootable
-
Problem viewing applet in a browser
Hi guys, i'm facing a basic problem in viewing an applet in a browser say IE or netscape. beside adding the applet tag to the html file that i want to browse ;is there any other operation to perform on browsers or the Applet in order to view it ? i w
-
Increase width for Excel and CSV reports
HI , I am having problem with data in Excel and CSV reports , since the data is large and the width of the column is fixed its is displaying ###### , can u suggest me how to make the wodth of the columns variable depending upon the data passed. I wan