Formula in transformation file to remove trailing zeroes,BPC 7.5 NW
Hi Experts,
I have implemented automation of master data from BW info object to BPC dimension.
I have few issues with the transformation file. employee percentage in BW is of type number and has lenght of 17.
In BW 0EMPLPCT holds the value as 100,000 , 75,000 but when i send to BPC dimension the values are sent as 100,00000
Emp percentage is maintained as below in the transformation file.
EMP_PC=0EMPLPCT
However i wanted to remove the zeroes in BPC , i wanted to see the numbers as 100, 75, 50 and so on.
Is there any way i can handle this in transofrmation file. Please let me know as this is really urgent. Thanks much.
Regards,
Sanjeev
Hi,
The properties in BPC are stored as string. So, you will have to convert it to string while loading. Secondly, it will be really difficult to use this percentage value in any script logic; since it is stored as string.
Similar Messages
-
I want to remove Trailing zeros from a charecter value
Hello ,
i want to remove trailing zeros for a prticular value.Following is my code :
DATA: V_FLOAT TYPE F VALUE '4.8240000000000000E+03',
V_CHAR(25) ,
P10_4(10) TYPE P DECIMALS 4.
CALL FUNCTION 'CEVA_CONVERT_FLOAT_TO_CHAR'
EXPORTING
FLOAT_IMP = V_FLOAT
FORMAT_IMP = P10_4
ROUND_IMP = ' '
IMPORTING
CHAR_EXP = V_CHAR.
SHIFT V_CHAR RIGHT DELETING TRAILING '0'.
WRITE : V_CHAR ."NO-ZERO.
<u><b>Output:</b></u>
if we pass the value '1.3000000000000000E+01' it should be 13.0
ex2: '1.3400000000000000E+01' it should be 13.4
ex3:'4.8240000000000000E+03' it should be 4824
is there any way to get the solution without functional module. If so Please tell me with code.hi
u can do it in number of ways.
Use TCODE SU3
Select default tab and select radio button 123467.89 in decimal notation and save it.
or u can try :
if you want to do this through ABAP program.
1. to delete trailing spaces.
SHIFT <V_VARIABLE> RIGHT DELETING TRAILING '0'.
to delete leading zeroes,
SHIFT <VARIABLE_NAME> LEFT DELETING LEADING '0'.
only for one abap program, u can use set country command
for all programs :
sap menu>system->go to user profil->own data>default --> and choose ur format.
hope this helps u.
Regards,
Prasanth
Reward all hepful replies -
How to remove trailing zeros from a fraction part.
How to remove trailing zeros from fraction part, need standard API rather then some java code.
user8726363 wrote:
How to remove trailing zeros from fraction part, need standard API rather then some java code.I'm pretty sure we have all gathered that English is not your first language, but your question is not a good question in any language.
Back up. Take a deep breath.
Now - what's your problem ?
Please illustrate with results, and the code (just the class/method; not your entire application) that is causing them.
Winston -
How to remove trailing zeros 20353675.0000000
All numeric decimal columns all are showing trailing zeros, how to remove them while processing within the query transform.
20353675.0000000
Thanks a lot for the helpful infoYou can use the trunc function to remove the decimal places.
Syntax: trunc( number, [ decimal_places ] )
<number> is the number to truncate.
<decimal_places> is the number of decimal places to truncate to. This value must be an integer. If this parameter is omitted, the trunc function will truncate the number to 0 decimal places.
Eg: trunc(125.815) would return 125
trunc(125.815,0) would return 125
trunc(125.815,1) would return 125.8
trunc(125.815,2) would return 125.81
trunc(125.815,-1) would return 120 -
How to remove trailing zeros using EngineeringFormatInfo?
HI,
I found a measurement studio formatter for SI notation.
For details, see the NI document.
Here, I want to know how to remove any trailing zeros. I could not find any information about this.
For example,
code : string result = string.Format(EngineeringFormatInfo.Default, {0:s5}, double value)
if value = 1.2345678E-3, result is 1.23457E-3. It is ok.
if value = 1.2E-3, result is 1.20000E-3. But I want to get "1.23m".
In labview, I usually use "%#.5p" format string.diluculo wrote:
HI,
I found a measurement studio formatter for SI notation.
For details, see the NI document.
Here, I want to know how to remove any trailing zeros. I could not find any information about this.
For example,
code : string result = string.Format(EngineeringFormatInfo.Default, {0:s5}, double value)
if value = 1.2345678E-3, result is 1.23457E-3. It is ok.
if value = 1.2E-3, result is 1.20000E-3. But I want to get "1.23m".
In labview, I usually use "%#.5p" format string.
I don't understand how you are getting 1.23457E-3 ? And claiming that is okay.
If you are using the format string that you claim you are using, then you should be getting 1.23457m.
It sounds like you are using string result = string.Format(EngineeringFormatInfo.Default, {0:E5}, value) -
Remove trailing zeroes in quantity field.
Hi all,
I am having quantity field in ALV grid display : VBAP-KWMENG. Iam getting quantity value as 1,000.My requirement is to get quantity value as 1.(without ',' and zeroes).
Suggest me a suitable solution.
Thanks all.Other way is check for the below code ..
DATA:
lv_decimal TYPE f DECIMALS 3,
lv_string TYPE string.
lv_decimal = '22.010'.
WRITE lv_decimal TO lv_string.
SHIFT lv_string RIGHT DELETING TRAILING '0'.
* also delete trailing '.', if possible
SHIFT lv_string RIGHT DELETING TRAILING'.'.
CONDENSE lv_string NO-GAPS.
* now no trailing zeros are in the decimal stored in LV_STRING -
BPC: Conditional Formulas in Transformation Files, Possible?
Hi All,
I have an issue where I have a standard conversion file for the Account dimension, however for certain accounts the account is also dependent on the Entity ID. Rather than writing several conversion files to maintain for each entity I am wondering if the following is possible:
Is it possible to write some sort of conditional formatting in the transformation file such as:
If (stringAccount)= "XXX" then (stringAccount) + (stringEntity) and go pick up conversion file A, else (stringAccount) and pick up conversion file B
Conversion File A would have Entity/Account combo as the External account, and the Internal account would be the account for that specific Entity. (I actually have this stored as a property on each entity but currently its assumed that some sort of dynamic EVPRO/property defintion will not function in a conversion file.)
Conversion File B would be my standard conversion file.
I am thinking that I this might be possible but need assitance in the syntax for the transformation file.
Any help is greatly appreciated!
Brian Tyson
Edited by: Brian Tyson on Aug 12, 2008 9:48 AMI think I have figured out how I am going to do this, my co-worker suggested the solution is more simple than I was making it out to be:
my transformation file will be:
Account= Accountstring + Entitystring
then int he conversion file i will have the following:
1001* 1001
1002* 1002
1003EntityA 1013
1003EntityB 1023
1003EntityC 1033
1004* 1004
Only thing is that I will have to hardcode, rather than using the property... -
How to remove trailing zeros from a decimal (type) value?
Hi Everyone,
I would like to 'drop' some trailing zeros from a decimal value, e.g.: 50.000000, and I am wondering how to go about this?
The value is definitely of decimal type, and in this instance I know that I want to eliminate exactly six (6) zeros.
Any help here will be greatly appreciated.
Kind Regards,
DavidTry the below:
This is sort of a display issue, you may do it at Application side, which would be efficient.
Declare @s Decimal(10,6)='50.0000000'
Select Cast(@s as decimal(10,0)) -
GREP expression to remove trailing zeros?
Hi,
I have to find and change multiple entries of trailing zeros. Please find sample below to understand type entries need to be change.
1.00 -> 1
0.01200 -> 0.12
4.50 -> 4.5
0.0040 -> 0.004
Please help me how can i use grep to find and change in CS6
Thanks in Advance.
SanjayPeter,
Right! In 3 steps (text in black)
1/ Exclusion if no decimal part:
Find: ,?(?<![\.\d])(\d+)(?![\.\d])
Replace: color X
2/ Treatment:
Find: (?<=[\.\d])\.?0+(?=\s)
Search Format: color black
Replace: nothing
3/ Treatment:
Search Format: color X
Replace Format: color black
Seems to work. To be validated! -
Hi,
I want to write a program to remove any unnecessary zeros of a non whole number.
ex. 1.00100 should be converted to 1.001.
Pattern pattern = Pattern.compile("0+$");
Console console = System.console();
String word = console.readLine("%nEnter number - ");
Matcher matcher = pattern.matcher(word);
if (word.indexOf('.') > -1)
System.out.println("Number after - " + matcher.replaceAll(""));
else
System.out.println("Number after - " + word);
}It seems to work fine. But the pattern "0*$" also seem to work. I tested this program with both patterns for few numbers and it works.
What is the best pattern which will provide most accurate results to accomplish my task.
Do you see any problems of using any of the mentioned patterns or is there an another way to do it?
Thanks,
Chamal.String[] values =
"1.00100", "100","000"
for (String value : values)
System.out.println(value.replaceFirst("(?<=\\.\\d{0,30}?)0*$", "")); -
BPC 7.5 NW - IF stament in Formule for Transformation File ?
Hi, i try load data from 0PROFIT_CTR to BPC reading PDF "How To Import Master Data and Hierarchies into BPC 7.5 from SAP NW BW".
Then use this assing:
*MAPPING
ID=ID
RESPONSABLE=0RESP_USER
BPC=*IF(ID(2:2)=*STR(I) then *STR(I);*IF(ID(2:2)=*STR(D) AND ID(4:4)=*STR(Z) then *STR();*STR(D)))
PAIS=*IF(ID(1:1)=*STR(C) then *STR(CHILE);*STR(PERU))
In Validate get Error for Field BPC : The number in parentheses is incorrect, check your formula
*IF(ID(2:2)=*STR(I) then *STR(I);*IF(ID(2:2)=*STR(D) AND ID(4:4)=*STR(Z) then *STR();*STR(D)))
This line working good :
PAIS=*IF(ID(1:1)=*STR(C) then *STR(CHILE);*STR(PERU))
Examples value for 0PROFIT_CTR is :
CD1Z0101
CD101C01
PI1CA001
CI1CA001
I look sintaxis and is good number in parentheses.
Any idea the problem ?I test this :
BPC=*IF(ID(2:2)=*STR(D) AND ID(4:4)=*STR(Z) then *STR();*STR(D))
And GET error :
*IF formula is not valid, check your formula
Maybe problem is in "AND" stament ?
This is part the previous code posted :
BPC=*IF(ID(2:2)=*STR(I) then *STR(I);*IF(ID(2:2)=*STR(D) AND ID(4:4)=*STR(Z) then *STR();*STR(D)))
But here get error :
The number in parentheses is incorrect, check your formula
Any idea how use "AND" stament or correct sintaxis in this line :
BPC=*IF(ID(2:2)=*STR(I) then *STR(I);*IF(ID(2:2)=*STR(D) AND ID(4:4)=*STR(Z) then *STR();*STR(D)))
Thank you. -
Why does Pages REMOVE trailing zeroes in a table? I type 467.6750 and tab to the next cell, and Pages DELETES that ending zero.
Where can I change that?
Many thanks.clint,
My guess is that Pages "corrects" the trailing zero because it deems it unnecessary. You can fix it by selecting your table, then clicking on the Table inspector > Format > Cell Format > Text. Assuming you're not using your table to create formulas, treating the numbers as text shouldn't be a problem.
-Dennis -
How to delete trailing zeros from a quantity field to display in ALV?
Hi there,
i am retrieving the field LGMNG from LIPS table, which is of type QUAN(13). All LGMNG values there are stored as
1,000
20,000
50,000 etc.
But i want my values to be displayed as
1
20
50 etc.
i have tried the " shift v_variable right deleting trailing '0'" but it does not work.
also, if the value of LIPS_LGMNG = 0,000, i need those columns in ALV empty(that is no zeros or comma displayed)
can anyone please help?
Thanks a lot,
Meehi,
use this it will solve your problem, just write down this on your Fieldcatalog.
WA_FIELDCATALOG-FIELDNAME = 'VALUE7'.
WA_FIELDCATALOG-SELTEXT_L = 'Contribution EE(due)'.
WA_FIELDCATALOG-DATATYPE = 'INT2'. " it will remove trailing zero
WA_FIELDCATALOG-DECIMALS_OUT = 0.
APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
CLEAR WA_FIELDCATALOG. -
Simple transformation dropping trailing zero.
Hi experts.
I am having a problem with my transformation file, and I was hoping someone could help me.
I have created a simple transformation file, with a variable using the type of "DMBTR" which Does have 2 decimal points.
IF I have data - the two decimal points print.
EG if the amount is 100.57.. I get the 100.57 to print which is what I need and expect.
BUT.
IF the amount is 100.50 I am getting 100.5 Is is dropping the final zero amount, and therefore is failing in the validation.
HOW can I FORCE the two decimal points to print?
I have even tried it where I declare it as a variable of type "I" with 2 decimal points, and it still does not work.
I can not figure out how to use the Number format option with a Value-ref print line.
If someone could help me with that.. I could try that to see if it worked.
thank you.
eg: of the way the data is declared:
<tt:type name="GRTOT14" type="I" length="13" decimals="2"/>
OR
<tt:type name="GRTOT16" type="ddic:DMBTR"/>
<tt:type name="GRTOT17" type="ddic:DMBTR"/>
eg: of the way I am using it where I am getting only one decimal place if the 2nd decimal place is ZERO
<tot_grnt_sbsdy_amt tt:value-ref=".GRTOT14"/>
<tot_insu_prcd_amt tt:value-ref=".GRTOT16"/>
<tot_opay_rcap_amt tt:value-ref=".GRTOT17"/>
PLEASE HELP.
thank you.From what I understand about XML (could be more), the canonical representation of decimal values does not allow a fixed number of decimal places.
SAP documentation:
http://help.sap.com/saphelp_nw04/helpdata/en/52/491a40251e2402e10000000a1550b0/frameset.htm
from there, this XML documentation is referenced:
http://www.w3.org/TR/xmlschema-2/#decimal
important bit:
Leading and trailing zeroes are prohibited subject to the following: there must be at least one digit to the right and to the left of the decimal point which may be a zero.
You already discarded my workaround: using a character or string type field and fill it to your liking prior to serialisation.
Thomas -
Remove Leading zeros for Material in Transformation
Hi Experts,
I'm using DTP first time. I don't have much exp on DTP & Transformations.
I'm creating infocube with some objects. I want to remove leading zeros for zmaterial.
In 3.x writen update routines as fallows:
data: zmat(18) type c.
zmat = COMM_STRUCTURE-/BIC/ZMAT.
shift zmat left deleting leading '0'.
result value of the routine
RESULT = zmat.
I'm confusing in Transfermation where to write this routines.
I'm writing in Transformation as fallows:
data: zmat(18) type c.
zmat = SOURCE_FIELDS-/BIC/ZMAT.
shift zmat left deleting leading '0'.
RESULT = zmat.
But it's getting remove zero's.
Anybody suggest on this.
SiriDear Sir,
No confusion at all.
Just double click on the Target Infoobjct i,e Material object in Transformation, you will see a wizard popping up.
There you will see a option called "RULE TYPE" and the default value will be "Direct Assignment". In the same check box click on the drop down icon and select "Routine".
The moment you select the routine option, it will open up ABAP workspace where in you can write your routine and get the desired result.
Hope it helps.
Maybe you are looking for
-
On i-pad, when I try to enable itunes match, it says, "you are not currently subscribed to iTunes Match. Use iTunes on your computer to subscribe." I am subscribed though! Then it says no to my request and, "item not available in the U.S. store." My
-
Buy Book doesn't work in iPhoto 6
I have completed a Photo Book. However, pressing Buy Book does nothing at all. I have bought Apple iPhoto books before without any problems. One-click ordering is enabled for my account in the Apple Store (heard this as one possible solution) and I h
-
General Query to identify parent columns and child columns in a table
Does anyone know a general query that can be run to identify the child records associated with the parent column within a single table.....and between other tables? Am I correct in assuming the parent column is the 'primary key'? Thanks.....I'm a new
-
Retirive list of customer number who recivies the ASN.
hi, i would like to know a list of customer who are receiving IN bound ASN . please let me know how to do it.
-
Hi All I am having all sorts of trouble trying to view window media videos from my university. I have downloaded Flip4Mac WMV player pro and I still can't watch the video. It is rather urgent as I need to do it for an exam at the end of this week.