on 2005 Sep 22 7:01 AM
Hi All ,
I Moving data from Cube to ODS . Let me explain abt the records in the cube .
There are 6 key figures in the cube as well as dimensions, UNIQKEY TRANSACTION is One Dimension and ARTICLE is another dimension which is having an Navigational attribute called CORE ELEMENT.
I am showing the data with those two dimension and the key figures which are to be used in the routine.
Charc----
Key Figures
UNIQKEY-ARTICLE-Coreelement--
billqty
-
in base unit
A00N----1006330--1--
10.5
A00M -
1006320----2--
2.5
A00P-----1006330--1--
10.5
A00P-----1006320--2--
2.5
A00Q-----1006320--2--
2.5
A00Q-----1006340--3--
10.5
Now Lets see what the core element numbers mean,
core element 1 means -- fuel .
Core elemnet other 1 -- food .
I need to move these data into ODS Which will have an extra field called No of items in the transaction --ITEMS.For this i need to write a routine .
The Logic is ...
1.if Materail is of type 1(Means if the core element - 1)
I need to Populate the No of items in tnx = 1 .--ITEMS.
2.If Material is of type(Means if the core element)2or 3 I need to populate the billing quantity to the no of transcations.--ITEMS
3. If the Uniqkey tanscation contains two line items as suppose that you have 20 litres of fuel and 2 cans of coke, then No of Items in the transaction should be 3 and Billing Quantity in BUoM 22
billing quantity in BUoM = 20 litres for the first line item and 2 for the second line item...
then as the first line item is fuel, field No OF Items in the Transcation should be 1 (replacing the 20) + 2 = 3
so the final result in the ODS should be billing quantity in BUoM = 22 and The Items in the Transcation= 3
So the ODS Data should look like this.
UNIQKEY--
ITEMS
-
in base unit
A00N--
1
A00M--
2.5
A00P--
3.5
A00Q--
12.5
NOTE : IN the ODS only the UNIQKEY IS THE KEY FIELD and the rest are DATA FIELDS.
I Posted this one before also. But didnt get proper responses.
I am Pasting the piece of code which I have written . This code will work for the first two records in the cube , But it is failing for the UNIQKEY Transcation having Line items.
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: /BI0/PMATERIAL.
DATA: TITEMS LIKE /BIC/AZPOCODS00-/BIC/ZTITEMS,
CORE_ELEMENT like /BI0/PMATERIAL-RPA_WGH1.
$$ 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/CS8ZPOCTUS04
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BIC/AZPOCODS00-/BIC/ZTITEMS
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
check not COMM_STRUCTURE-material is initial.
select SINGLE RPA_WGH1
INTO CORE_ELEMENT
from /BI0/PMATERIAL
where
material = COMM_STRUCTURE-material
and OBJVERS <>'D'.
IF CORE_ELEMENT EQ '1'.
TITEMS = '1'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = titems
IMPORTING
OUTPUT = titems
.
ELSE.
TITEMS = COMM_STRUCTURE-BILL_QTY.
ENDIF.
result value of the routine
RESULT = TITEMS..
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
PLease give me ideas on how to acheive this . As I am not Aware of ABAP very well.. PLease try to give me the code. I hope one of you may got the same requirement before.
Its very urgent and I need to deliver it today itself.
Thanks in advance , you can mail me to nagarjuna_bw@yahoo.co.in. If anybody intersted to discuss this Issue they can reach at +91 9845922955.
Hi ,
While I am moving the data from cube to ods . I need to create the update rules with cube -- 8cube . WHen i am doing this the billqty is a key figure in cube so that is not a problem but the ITEMS is not there in the cube ,SO for that I need to write a routine to populate that one.
Its strange but the user what to analyse with the UNIQKEY transaction. And these objects will be added as navigational attributes to the Characteristic. as it acts as another dimension.
He wants to laod these from ODS to Master data -Characteristic.
to say for each transcation hpw many items are getting sold.
Message was edited by: Nagarjuna Reddy
ONce again thanks for the qucik replies
Message was edited by: Nagarjuna Reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you need this IO as a char (that is rather strange), why don't you create it as KF?
Best regards,
Eugene
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Already I created the Infoobject. These infoobjects are added to an master datainfoobject as attributes and that is getting data from PC files. .
CUBE --- > ODS --- > Master data Object,
Apart from this Masterdata will be loaded through PC files alsol
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you create a new IO (KF) and put it as ITEMS into ODS?
Best regards,
Eugene
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
Thanks for the Qucik Reply ...But I want to tell you one thing . for the Bill Qty we have the infoobject . but for the ITEMS we dont have. ( the data fields are taken from cube template ) and the remaining ITEMS is from object catalog.
So for billing qty we can give addition , and for the ITEMS we have only two opitons 1. over write 2. no update.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you are not dealing with delta ODS, then can try the following:
For ITEMS & billqty in ODS set Update type to "Addition" in "Data field calculatioin" tab. And apply the logic you provided in the routine.
Best regards,
Eugene
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ignore it please.
Message was edited by: Ajay Das
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
73 | |
10 | |
9 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.