02-08-2008 7:35 PM
Hi experts,
I want to write a FM to check the amount value (data type KF/currency) if there is any $ sign before the amount. Say $15400.00, I would like to remove the $ sign from 15400.00. If it is -$145.00, delete dollar symbol and keep -145.00.
I have thousands of custom KF and have to implement it in BW. So I want this FM to call it from Transfer Rules start routine and will check one by one field only if it is a KF and remove $ sign if there are any. Please help.
Any help will be appretiated with points.
02-08-2008 7:41 PM
You don't need a function module, you need to read the ABAP help on "REPLACE".
REPLACE ALL OCCURENCES OF '$' IN bw_field WITH ''.
matt
02-08-2008 7:41 PM
You don't need a function module, you need to read the ABAP help on "REPLACE".
REPLACE ALL OCCURENCES OF '$' IN bw_field WITH ''.
matt
02-08-2008 7:45 PM
I don't want to write the code for thousand KFs and that's the reason decided to write a fm so that just I can call the FM from start routine and it will do the job for each KFs.
Thanks,
02-08-2008 8:02 PM
So, you want a generic function module that takes ALL the key figures, and strips out the $? Your problem will be how to identify which fields are key figures, and which are characteristics.
matt
02-08-2008 8:10 PM
I will call the FM once for each Transfer Rules in Start Routine, not against each KF routine. we are in BW 3.1, not BI 7.0.
Thanks.
02-08-2008 8:14 PM
OK, one call. But still, to have one fm to do this, is not trivial. How do you tell whether it is a key figure or not? I'm not at a BW system right now, but if I recall correctly, in the transfer routine you get field names - so you'll have to derive the infoobject from the field name.
The logic will be:
Get field names from structure (DD03L)
Derive InfoObject from field name.
If InfoObject is a key figure, strip out the $.
matt
Edited by: Matthew Billingham on Feb 8, 2008 9:17 PM
02-08-2008 8:23 PM
I will check all the fields if it's data type is CURR or FLTP, or data type is not CHAR, then check the value if there is any $ sign and remove it. That's it.
Yes - I think your logic is right. How can I write the code?
Edited by: Bhakta Das on Feb 8, 2008 9:24 PM
02-08-2008 8:24 PM
02-12-2008 9:13 PM