YTD routine in update or transformation rules
I'm currently on BI 7.0. I have an ODS that contains a monthly balance key figure. When moving this data to an infocube, I'd like to create a YTD key figure based on that monthly balance. I have 0FISCYEAR, 0FISCPER, and 0FISCPER3 time characteristics in my ODS and infocube.
Can someone provide me an ABAP code sample that I could use in my transformation routine that could calculate the YTD value based on the monthly balance key figure?
Thanks,
K-D Vo
Hi K-D,
I always prefer the cumulative methods (especially data load ones) because of the reasons you just described.
And, IMHO, there is no possibility to control the human factor in case of periodic data.
SO, I would prefer requesting from the data provider employees to submit data on CUMULATIVE basis. In this case they would correct their past errors that would be reflected in the YTD data provided by them.
And I see a little controversy in yor explanation. -- As I see, your data is periodic, monthly basis. When the employees correct data in past, close periods, AND THE SYSTEM IS'NT FED BY THIS DATA, you have to provide all corrections to past periods in the current month load! (Don't beleive that you can change data in the past).
In other words, even leaving the situation with the monthly, periodic, data load, just request from employess to provide all of data (current and for past periods) in the CURRENT period only!
So, repeating:
1. Periodic load.
2. All changes/corrections of the prior periods in the current loaded data only. No changes in the past!
OR:
1. Cumulative load. All cumulatives are to be calculated by employees (including all their corrections).
Hope this helps.
Similar Messages
-
Start routine and update rules
Hi,
What is accessed first:-
Start Routines or Update Rules?
What is the use of global variables in start routine?
Please reply.
Thanks.Hi......
You have different types of Routines in BW .
1) Start Routine in Transfer Rules
2) Transfer Routine in Transfer Rules.
3)Start Routine in Update Rules
4)Update Routine in Update Rules.
The routines that you write in transfer rules are applicable to all the Data targets that get the data from that particular Infosource, when you are going to write some code in Transfer rules, you have to understand that you are going to manupilate the data that is going to get into BW .
If you are going to write in Update Rules , then that logic is going to apply only for that particular Data target .
Eg : Let suppose I have a Flat file that gets data from 3 countries, US, Canada and Mexico.
Now I have prepared the data source for the same . But I dont want to have the data of Mexico in to BW itself.
So I will write a Start routine at TR to eliminate the data of Mexico.
My Next step is I want the data of US into one ODS and Canada data in to another ODS.
For this I handle the dataflow at Start routine in Update rules, to eliminate Canada data for US ODS and Vice Versa.
Global variables in Start routine
You can have global variables, internal tables populated by the
startup routine. This data will be available to the field
routines. Create yourself a start routine, declare some
variables in the global section, and then create a field
routine. You will be able to use the globally declared objects
in the field routine
Please check below help link for routines in sap netweaver 2004s
http://help.sap.com/saphelp_sem60/helpdata/en/e3/732c42be6fde2ce10000000a1550b0/frameset.htm
How to guide "How to transformations routines".Please check the below link:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/dc1d9990-0201-0010-16aa-db3c4eb8b642
start routine in transfer rules
Look up to load master data
excluding
Start Routine in Transfer Rules
Sample code in Update Rule to restrict data selection?
Append Datapak - transfer start routine
Excluding Blank field in Infopackage Filter
Trans Routine ABAP help ..
transfer routine
Date key figure: Convert DATS format to DEC format
Date Conversion in Flat File
Transfer Routine ABAP
conversion exit
Date Conversion
Problem with conversion char to numc in transference rules
conversion routine..?
update routine
How to call a function in Update Rules to reverse a key figure sign
Need Sample Code for Update Rules
Date calculation
Difference between data in PSA and Data in Infocube
No RETURNCODE <> 0 allowed in update routines in transfer mode
the diffrerece between DEC and (yyyymmdd) 8 char in Time defination
Access master data in update rules
Date key figure: Convert DATS format to DEC format
start routine in update rules
Is it possible to read a third ODS in update rules between two ODS?
update rule coding while loading data from ODS to CUBE
Start Routine in Update Rules to populate additional fields from ODS
Coding in Update Rules accessing a Z-Table
Start routine
Hope this helps you..........
Regards,
Debjani.........
Edited by: Debjani Mukherjee on Oct 1, 2008 4:58 PM -
Routine for Update rule in cube
Hi Friends,
I have added a field to a cube, now i need to populate the same during the data is loading from the DSO to Cube. Inupdate rule since we will get only te key figures, is it possible to access the dimensions in the routine. Please help me in giving some coadings for the routine for update rule.
Thanks
PremHi,
one more suggestion..
create a end routine and update the key figures based on ur dimension values by useing resuly_package.
sample code:
[Transformation end routine|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/203eb778-461d-2c10-60b3-8a94ee91cbfc]
thnks. -
An issue regarding the routines in a transformation rule
Hi experts,
I have two fields in my transformation rule which i fill through characteristic routines. The second routine needs information provided by the first routine. For example:
First char. A
Sec. char. B
In the routine for B i am using the field A which has to be filled in this moment through the first routine for a certain assignment.
The problem is that i recognized that i get here the wrong assignment because in this moment in which the routine B is running the information provided by routine A is still not there. So i have analyzed and saw that the char. B has the position 25 in the transformation rule and the char. A has the position 27. Does it really mean that in the loading the char. B is filled at first and the char. A after that because of the order? Is that the problem why I don't still have information of char. A while i am filling char. B?
If yes has anyone a good idea how to handle it? The further problem is that we can not change the order because the cube is filled and we have to delete the data at first in order to do it and it is not possible at the moment.
I would really appreciate it.
Thank you in advance.
Kind regards,
AliHi,
AS we do not know what logic you are trying to write in field level routine so its pretty difficult to understand the scenario.
I can suggest you to write the same logic in END Routine based on your requirement.
Share your logic and code for more inputs.
Hope it helps.
Regards,
AL -
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 -
Deleting rows with missing values in field in start routine of update rule
Hello experts,
how can I delet rows with missing values in a specific field in the start routine of update rules?
I think ABAP code should look something like this:
delete ... from DATA_PACKAGE where Z_NO = ''.
thanks in advance for any suggestions!
hizaWrite:
delete data_package where field = value.
Hope it helps.
Regards -
Write ABAP routine in transformation rule
Dear all,
I am very new to ABAP. Currently I would like to transfer some data from cube A to cube B. The problem is
Cube A and B have different Unit of Mesure. The product standard cost is based on each Item's UOM. For example:
Cube A data:
ItemNo } UOM } Standard cost
ABC } P5 } 30
Cube B data:
ItemNo } UOM } Standard cost
ABC } EACH } 5 (30/5)
In transformation rule, I plan to use ABAP routine to calculate each record to new Stand cost if Cube A has different UOM than Cube B.
Can I call a program in this ABAP routine?
In ABAP routine, how can I delare other source table and fields?
Thanks for you help!The preferable method, if you're on BI 7 or later, is to create a filter in the DTP so that the records where 0CLR_DOC_NO is blank aren't even passed into the Transformation.
If not, then you can add the following code into the Start Routine of your Transformation.
DELETE
source_package
WHERE
clr_doc_no EQ ' '. -
Transport routine in update rule
Dear All,
I have new routine in update rule, after development test is ok,
I transported to quality environment, but return with error code: 8.
The new routine and changed update rule are in same request number.
I think maybe I must separate and transport the routine first,
before I transport the update rule.
Now, how transport this routine?
I also confused to find the routine generated number because there are a lot of routine
in this update rule.
I already triggered by update the routine again (to prompt request window),
transported the request and I have the same result.
Any help will be appreciated. Thanks.
Regards,
Steph.Hi ,
Pls check below threads , may be it helpful to you.
https://forums.sdn.sap.com/click.jspa?searchID=21044655&messageID=6432928
https://forums.sdn.sap.com/click.jspa?searchID=21044655&messageID=6427473
https://forums.sdn.sap.com/click.jspa?searchID=21044655&messageID=6855315
Thanks & Regards,
Ramnaresh .P. -
Diff between the Start routine and Update rules?
Hi Gurus
Diff between the Start routine and Update rules?
Thanks in advance
RajHi,
Routines are like conditions or business rules that could be applied to filter the data while entering the BW system or could be used to apply certain conditions on the info objects itself.Update rule level you manipulate your data and write your start routine.
There are 4 types of routines
1. Start routine- Could be used at two levels (transfer rule level and the Update rule level)
This Start routine written at the transfer rule level helps filter the necessary data coming from the source system.
For Example: If you decide to extract data that contain only quantity greater than 500 , then you could specify the Start rouitne to achieve this.
The Start routine at the Update rule level provides similar functionality but at this point it helps direct specific data to
different data targets. For Example: If there 3 data targets being fed from the Infosource, you may want to apply some condition to each data target, like send year 2000 data ti Data target1, 2001 to data target 2 and so on. This can be achieved by using Start routine at the Update rule level
2. Transfer Routine: This feature is available at the transfer rule levels
While performing the transfer rules operation, there are 4 features available to the developers to create business rules on top pf the Infoobjects.
1. You could do a one to one mappping of the Infoobject
2. Provide a constant value
3. Include a formula
4. Write an ABAP routine.
These 4 options refers to the transfer routine
3. Update Routine:
The limitations of just having 4 options in the transfer routine is overcome at the update rule level. There are various other
sophisticated features avaialable apart from the 4 options mentioned above. These business rules could be specified pertaining to each data target.
4. Conversion Routine: It provides functionality to do Currency and unit conversion.
Regards. -
Advice on abap routine in update rule
Hello Experts,
I have written a routine in update for replacing some 'not allowed characters' with space.
The abap code is correctly working as a standalone program as is giving the correct results.However,
when i write the same code in update routine, no change takes place in data, i.e. 'not allowed characters ' are still there in my data.
Please advice if there is any special change that is to be made while writing the code in update routine.
if STRLEN( CHECK_TEXT ) <> 0.
ALLOWED_SPECIAL_CHARACTERS = ' &()*+,-.:;<>=?!@$%~'.
ALLOWED_CHARACTERS = 'ABCDEFGHIJKLNMOPQRSTUVWXYZ_0123456789'.
TRANSLATE CHECK_TEXT TO UPPER CASE.
strl = strlen( CHECK_TEXT ).
IF CHECK_TEXT CN ALLOWED_CHARACTERS.
WHILE len1 LE strl.
IF CHECK_TEXT+len1(1) CN ALLOWED_CHARACTERS.
CHECK_TEXT+len1(1) = '.'.
ENDIF.
add 1 to len1.
ENDWHILE.
ENDIF.
Regards
PriyankaThanx a lot for a quick reply .
The main problem that we are facing is this simple code is working fine if it is executed as a report program but if no changes takes place when i move this same code to my update routine.
(1) According to you i should write this routine in the start routine instead of update rotuine ??
(2) how would function module help in my case...kindly elaborate a it.
Here is the complete update rotuine.
data:
len1 TYPE i value 0
R_TEXT(60),
CHECK_TEXT(60),
R_TEXT = COMM_STRUCTURE-/BIC/ZC_NTXT1.
if STRLEN( R_TEXT ) <> 0.
ALLOWED_SPECIAL_CHARACTERS = ' &()*+,-.:;<>=?!@$%~'.
CONCATENATE 'ABCDEFGHIJKLNMOPQRSTUVWXYZ_0123456789/'
ALLOWED_SPECIAL_CHARACTERS
INTO ALLOWED_CHARACTERS.
CHECK_TEXT = R_TEXT.
TRANSLATE CHECK_TEXT TO UPPER CASE.
strl = strlen( R_TEXT ).
IF CHECK_TEXT CN ALLOWED_CHARACTERS.
WHILE len1 LE strl.
subs2 = CHECK_TEXT+len1(1).
IF subs2 CN ALLOWED_CHARACTERS.
CHECK_TEXT+len1(1) = '.'.
ENDIF.
ENDWHILE.
endif.
ENDIF.
RESULT = CHECK_TEXT. -
Issue with migrated transformation rule after transport
Hello all,
We have migrated couple of update rules and transfer rules to transformation rules. All the transformation rules are active in development environment.
The issue is when we transport these transformation rules to QA, one of the fields of datapacket dimension "RECORD" becomes &R1& in the global structure of start routine and therefore, transport fails in QA. Along with this we had another issue that if we add any additional fields in the cube or ODS structure, the global structure in start routine doesn't change after transport in QA. Basically, it seems like it doesn't do anything when we do transport.
We tried couple of things by transporting entire flow inclding target and source objects, we also tried transporting only transformation with overwrite mode. But none of the things worked. We also have logged the message with SAP.
SAP suggested us to open the QA environment and perform the change manually. We did it and obviously we could activate the transformation rules. But when we tried to re-transport the transformation, it is keep failing with the error "Syntax Error". My assumption has after the transport, the field has become &R1& again.
Has anybody faced such issue? We are on Ehp1 SP7.
- DannyThanks Murali,
Yes as I mentioned SAP suggested us to open the box and do it manually, but once we are done with the manual changes, we tried transporting the same transformation rule again, which I guess going to be the case in case of any future enhancement. Transport failed and it says "Syntax Error".
The transformations we activated manually in the target system are active, but when we try to load the data, it throws the exception error.
Any clue ?? Is it working fine in your system after you did manual changes? Did all future transport go well ?
- Danny -
Converting Tx Routines and Update Routines in to Tranformation in 2004's
Hi,
I have to get all the data from the existing BW 3.5 system in to the BI 7.0 system.
While the conversion process if I choose to create the transformation instead and installing the update rules and tranfer rules and migrating those to the tranformations.
Here I have three similiar questions:
i. So, if I copy the transfer routines in to the Transformation, then do I have to change any ABAP Code? Is there any syntax changes that have to be take care off.
ii. If I copy the Update routines in to the Transformation, then do I have to change any ABAP Code? Is there any syntax changes that have to be take care off.
iii. If I copy the Start routines in to the Transformation, then do I have to change any ABAP Code? Is there any syntax changes that have to be take care off.
I appreciate your help. Thanks!1) TRAN_STRUCTURE to SOURCE_FIELDS
2) COMM_STRUCTURE to SOURCE_FIELDS
3) DATA_PACKAGE to SOURCE_PACKAGE
http://help.sap.com/saphelp_nw04s/helpdata/en/44/bd9b5be97c112ce10000000a11466f/content.htm -
2LIS_04_P_ARBL - Missing Transformation rule
Hello.
I'm currently implementing the 2LIS_04_P_ARBL datasource (7.0) and had a default generated transformation rule to 0PP_C03 Infocube. Now I have some characteristics that remained unassigned and I'm not sure which element to assign from the datasource. Anyone have configured them using assignment or routine?
0ACT_FIN_EK Actual Finish Exection Time Operation
0ACT_FIN_OK Actual Finish of Operation
0ACT_INPUTK Actual Start of Operation (Actual Finish of Predecessors)
0ACT_STARTK Actual Start Execution Time Operation
0EARLSCHDTK Earliest Target Start: Execute
0EARL_FINK Earliest Target Finish: Execute
0LATESTSTRK Latest Target Start: Execute
0LATEST_FIK Latest Target Finish: Execute
Any help would be appreciated. Thanks.
Regards,
JohnI took a look at the standard content for the Update Rule prior to my initial response, and the only routines in that are for Key Figures that weren't part of your list:
0NO_CORR_NR Number of Correctly Delivered Manufacturing Ord
0NO_EARL_NR Number of Manufacturing Orders Delivered Early
0NO_LATE_NR Number of Manufacturing Orders Delivered Late
0NO_LESS_NR Number of Manufacturing Orders with Insufficien
0NO_MUCH_NR Number of Manufacturing Orders with Exceeding Q
0PCORR_QTY Correctly Delivered Production Quantities
0PEARL_QTY Production Quantities Delivered Early
0PLATE_QTY Production Quantities Delivered Late
0PLESS_QTY Insufficient Production Quantity
0PMUCH_QTY Exceeding Production Quantity -
How to replicate 0LIV_DS01 2LIS_06_INV transformation rules?
Hi experts,
I have activated:
2LIS_06_INV 3.x infosource
0LIV_DS01 2LIS_06_INV 3.x update rules
Yet, I can't do nothing with it.
I don't get to activate business content:
2LIS_06_INV 3.x datasource, since it just exists as 7.0 datasource.
If i do transfer/update the infosource and update rules to 7.0, I loose all the routines and update rules that were in 0LIV_DS01 2LIS_06_INV.
I looked SDN, and seen many messages about this issue, yet for me inconclusive! How will I have data in 0LIV_DS01 for reporting? Any ideas?
Tanks in advance for your help.
André OliveiraNo there is not!
Yet, you can install the flow, and migrate to 7.0 version. There are routines that still give you error and you'll not be able to activate the transformation.
I ask for help to a programmer so that we can avoid the error and still activate the Datasource. It was tricky but at least now it is working (we had to change the code of system standard).
Try and proceed as I did:
1) Install business content;
2) migrate so you can establish the flow;
3) check routine errors.
Try to go around with the code or start a sap message reporting a product error, since that's exactly what is!
Best Regards,
André Oliveira -
ABAP (Routine) Error in BW Transformations
Hi Experts,
As i am new(Learner) to BW Please advise me on how can i achieve this and update me with Releavent Start Routine and Field Routine....please
My Requirment is
Employee is Compounded on Location.
On Weekly or Monthly basis (dependending on Employee Payroll run) Employee will be assigned with the Wage Type and Amount for that Wage Type and Payroll Date (When the payroll was run)
Data Currently i have/Data comming from Source System
Loc_ID--Emp_IDWage_IDPayroll_Date-Amount
-1--99900108.08.2008-----100.00
-1--99908808.08.2008-----560.00
-1--99934508.08.2008-----437.00
-1--99900108.07.2008-----654.00
-1--99908808.07.2008-----389.00
-1--99934508.07.2008-----893.00
-1--99926408.06.2008-----600.00
-1--99934508.08.2008-----365.00
(Employee may have Different Wage_ID and Amount for each payroll)
My requirment is to include a new key figure 'Previous_Amount' which will be populated previous Wage_ID Amount.
Loc_ID--Emp_IDWage_IDPayroll_Date-Amount---Previous_Amount
-1--99900108.08.2008---100.00-----654.00
-1--99908808.08.2008---560.00--
389.00
-1--99934508.08.2008---437.00--
893.00
-1--99900108.07.2008---654.00--
0
-1--99908808.07.2008---389.00--
0
-1--99934508.07.2008---893.00--
365.00
-1--99926408.06.2008-----600.00
-1--99934508.08.2008-----365.00
As i am a starter in BW i am struggling to write start routine in transformations (DSO-->CUBE) to transfer the data in DSO Active Table to a internal table and a field routine to update Previous_Amount field by sorting the internal table data and to pick employee's latest record less than the current payroll for that particular wage_id and populate that amout to Previous_Amount field.
Please make necessary corrections to the start routine by fixing where i went wrong and update me with the required field routine (which will read data from internal table used in start routine.
With the help of Vamsi i can able to write this code,But still the Previous Price is filled with 0
Please correct me where it went wrong
Start Routine
Global declaration
Types :
Begin of ITABtype,
ORG TYPE /BIC/OIZORG,
CYEMPNO TYPE /BIC/OIZCYEMPNO,
HED_ID TYPE /BIC/OIZHED_ID,
RHED_ID TYPE /BIC/OIZRHED_ID,
CHNG_DTE TYPE /BIC/OIZCHNG_DTE,
HED_AMT TYPE /BIC/OIZHED_AMT,
HED_PAMT TYPE /BIC/OIZHED_PAMT,
End of ITABtype.
Data : ITAB type standard table of ITABtype
with key
ORG
CYEMPNO
HED_ID
RHED_ID
CHNG_DTE
HED_AMT
HED_PAMT,
wa_itab like line of itab.
Data : ITAB1 type standard table of ITABtype
with key
ORG
CYEMPNO
HED_ID
RHED_ID
CHNG_DTE
HED_AMT
HED_PAMT,
wa_itab1 like line of itab1.
*Create an internal table with all the field types with u want to have
*in the output */
Data : wa_SOURCE_PACKAGE type tys_SC_1.
Data : tmp(2) type n value 1.
\ The above loop is to get all the values into the internal table*/
Loop at SOURCE_PACKAGE into wa_SOURCE_PACKAGE.
Move wa_SOURCE_PACKAGE-/BIC/ZORG to wa_itab-ORG.
Move wa_SOURCE_PACKAGE-/BIC/ZCYEMPNO to wa_itab-CYEMPNO.
Move wa_SOURCE_PACKAGE-/BIC/ZHED_ID to wa_itab-HED_ID.
Move wa_SOURCE_PACKAGE-/BIC/ZHED_ID/BIC/ZRHED_ID to wa_itab-RHED_ID.
Move wa_SOURCE_PACKAGE-/BIC/ZCHNG_DTE to wa_itab-CHNG_DTE.
Move wa_SOURCE_PACKAGE-/BIC/ZHED_AMT to wa_itab-HED_AMT.
*Move wa_SOURCE_PACKAGE-/BIC/ZHED_PAMT to wa_itab-HED_PAMT.
Append wa_itab to itab.
Endloop.
Sort itab by
ORG Ascending
CYEMPNO Ascending
HED_ID Ascending
RHED_ID Ascending
CHNG_DTE Descending.
Sort SOURCE_PACKAGE by
/BIC/ZORG Ascending
/BIC/ZCYEMPNO Ascending
/BIC/ZHED_ID Ascending
/BIC/ZHED_ID/BIC/ZRHED_ID Ascending
/BIC/ZCHNG_DTE Descending.
Loop at itab into wa_itab.
tmp = '1' .
Loop at SOURCE_PACKAGE into wa_SOURCE_PACKAGE from tmp.
If wa_itab-ORG = wa_SOURCE_PACKAGE-/BIC/ZORG.
wa_itab-CYEMPNO = wa_SOURCE_PACKAGE-/BIC/ZCYEMPNO.
wa_itab-HED_ID = wa_SOURCE_PACKAGE-/BIC/ZHED_ID.
wa_itab-RHED_ID = wa_SOURCE_PACKAGE-/BIC/ZHED_ID/BIC/ZRHED_ID.
wa_itab-CHNG_DTE = wa_SOURCE_PACKAGE-/BIC/ZCHNG_DTE.
wa_itab-HED_PAMT = wa_SOURCE_PACKAGE-/BIC/ZHED_AMT.
wa_itab-CHNG_DTE gt wa_SOURCE_PACKAGE-/BIC/ZCHNG_DTE.
tmp = tmp + 1.
Exit.
Endif.
Endloop.
Modify itab from wa_itab.
Endloop.
itab1[] = itab[].
Sort itab1 by
ORG Ascending
CYEMPNO Ascending
HED_ID Ascending
RHED_ID Ascending
CHNG_DTE Descending.
Delete adjacent duplicates from itab1 comparing
ORG
CYEMPNO
HED_ID
RHED_ID
CHNG_DTE.
Loop at itab1 into wa_itab1.
wa_itab-HED_PAMT = '0'.
Modify itab1 from wa_itab1.
Endloop.
Loop at itab into wa_itab.
Loop at itab1 into wa_itab1.
If wa_itab1-ORG = wa_itab-ORG.
wa_itab1-CYEMPNO = wa_itab-CYEMPNO.
wa_itab1-HED_ID = wa_itab-HED_ID.
wa_itab1-RHED_ID = wa_itab-RHED_ID.
wa_itab1-CHNG_DTE = wa_itab-CHNG_DTE.
wa_itab1-HED_PAMT = wa_itab-HED_PAMT.
Exit.
Endif.
Endloop.
Modify itab from wa_itab.
Endloop.
Field Routine
Read table ITAB into wa_itab
with key
ORG = SOURCE_FIELDS-/BIC/ZORG
CYEMPNO = SOURCE_FIELDS-/BIC/ZCYEMPNO
HED_ID = SOURCE_FIELDS-/BIC/ZHED_ID
RHED_ID = SOURCE_FIELDS-/BIC/ZHED_ID/BIC/ZRHED_ID
CHNG_DTE = SOURCE_FIELDS-/BIC/ZCHNG_DTE.
if sy-subrc = 0.
RESULT = wa_itab-HED_PAMT.
endif.
Please update me where it was wrong
Thanks in advanceHi again,
i don't have a BW system available now so the code is more as a how to and needs corrections but i hope you will figure out the logic.
declare an internal table and working area similar with the ods object.
data itab type table of ods_type.
data wa_itab type ods_type.
declare a working area for the source package.
data wa_source type type_source_package.
data l_tabix like sy-tabix.
select all active entries from ods .
if you figure out a performance issue here move this select into the loop and use where clauses or use for all entries in source_package
select * from ods_object into table itab .
sort source_package by payroll_date descending.
loop at source_package into wa_source.
l_tabix = sy-tabix.
read table itab into wa_itab with key Loc_ID = wa_source_package-loc_id
Emp_ID = wa_source_package-emp_id
wage_id = wa_source_package-Wage_ID.
wa_source-previous_amount = wa_itab-amount.
modify source_package from wa_source index l_tabix.
endloop.
This code should be in the start routine of the ods update.
Hope this helps
Kostas
Maybe you are looking for
-
Basic Search not working in 9iAS release 2
gurus, the basic search is not working in 9iAS Release 2. i created few items in the portal and searched for values in basic search ... it did not return any search results ... i checked the search settings and found the Drop Index button ... thus i
-
Oracle 10G Express Edition backup issues
After a backup job is run on our Oralce 10g Express Edition Server our system users can't access their web login page - http://127.0.0.1:8080/apex - To access their databse. What i need to know is this. I do a daily backup of the Oracle DB manually,
-
From customize report to customise transaction code
Hi, I want to pass data from basic list (from my customize report) , when I double click, I want to call my z transaction code field and the field type is P length 8 decimals 2.and the data which i want to pass is also same data type. hoe to do.. can
-
Internal Order error in settlement profile
Dear Experts I have created statistical internal orders for vehicles e.g u201CABC 1234u201D.It works fine but when I try to enter this order in settlement profile it says this order doesnu2019t exist. The system only reads the order number before the
-
En CS5 reporting incorrect file size
Hi all, I am creating a DVD9 program with 1 video timeline and 3 audio tracks. I exported out of Premiere AME(win 7 pro x64) the video timeline and main audio track(48k wav). I then exported audio only of the other two tracks mpeg audio. The exported