Remove leading zeros using MDX function
Hello,
BO XI R3.1 SP2 FP2.5, SAP BW 7.0
This seems simple, but I cannot find a solution.
How do I remove leading zeros from a character field in a OLAP universe. Is there any MDX function?
I tried
<EXPRESSION>
Value([0MATERIAL].[LEVEL01].[[20MATERIAL]].[Value])
</EXPRESSION>
<EXPRESSION>
StrToValue([0MATERIAL].[LEVEL01].[[20MATERIAL]].[Value])
</EXPRESSION>
I can remove the leading zeros in Webi, but we require it for ad-hoc reporting? Is there a way to do this in the universe?
Thanks,
Nikhil
Hi,
SAP BW MDX only allows calcuated expressions that return numeric values: this is one if the main SAP MDX limitations.
By the way there is the abilitiy to return string only for those expressions:
[Dimension].currentmember.name
[Dimension].currentmember.uniquename
So you can do this:
<EXPRESSION>
(right([0MATERIAL].currentmember.name, 4))
</EXPRESSION>
<EXPRESSION>
(right([0MATERIAL].currentmember.uniquename, 4))
</EXPRESSION>
<EXPRESSION>
(left([0MATERIAL].currentmember.name, 3))
</EXPRESSION>
<EXPRESSION>
(left([0MATERIAL].currentmember.uniquename, 3))
</EXPRESSION>
Otherwise you can use WebI formulas as described in the thread.
Regards
Didier
Similar Messages
-
Function mudule to remove leading zeros of curreny and decimal type field
Hi Expers,
can any body suggest me the function mudule to remove leading zeros of curreny and decimal type fields.
plz do reply as early as possible.
Thanks .....
sunil.Hi,
Use this FM CNIF_CONVERT_CURRENCY2EXT
Import parameters Value
I_CURRENCY USD
I_AMOUNT 00000001233
I_DECIMALS 2
Export parameters Value
E_AMOUNT 1.233,0000
Regards
Shiva -
Function module to remove leading zeros
hi,
is der any functional module to remove leading zeros
thanks and regards
Nikesh kumarHi,
You can use the <b>FM CONVERSION_EXIT_ALPHA_OUTPUT</b> and if you want to do in program do as below :
shift <fieldname> left deleting leading '0'.
Thanks,
Sriram Ponna. -
User define function-remove leading zeros
Hi All,
i want java coding for mapping function rule "remove leading zeros" early.
kindly give me response as early as possible.
regards
PeeraHi Mahaboob
Write UDF to parse data .
String dataVal="0230";
int parseVal = Integer.parseInt(dataVal);
System.out.println("parseVal is "+parseVal);
result.addValue(parseVal); or return parseVal;
Have a look at this thread...
Re: User-defined function in multiple Message Mappings
http://help.sap.com/saphelp_erp2005/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/22/e127f28b572243b4324879c6bf05a0/frameset.htm
Thanks !!! -
To remove leading zeroes and take directly from IDOC(Segment field) to file
Hi SapAll.
i have got a simple requirement in a idoc to file Interface.
here in a sender Idoc there will be one segment with one field,the requirement is to remove leading zeroes and take directly the data from this field and map to one of the field in reciever file structure.
i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
it would be preferable if any body can give me the solution without user defined functions.
regards.
Varma.from your first post:
i had used the formatnumber (under arithmatic functions)in PI 3.0 but now when iam using it in PI7.1 it was raising some jave exception error.
use the same formatting that you used in 3.0 .... try with just a # in the FormatNum function.
Regards,
Abhishek. -
XmltoQuery removing leading zero
Hi,
I have a function that takes in a raw xml and covert to query. The problem is any leading zeroes are gone. For example, 000123 will become 123. Is there any way or function in CF that will stop from removing leading zeroes?
Thanks,Oh, sorry. It's not the XML to Query problem but it's the cfquery problem. When I cfdump the data, it shows 000123, but when I use <cfquery> to insert the data into a dabase, it strips the leading zeroes and in the db table it shows only 123. Is there a function or something to prevent this?
<cfoutput query="get_xml_data">
<cfquery name="test" datasource="db">
INSERT INTO table (id, name)
VALUES (#get_xml_data.id#, #get_xml_data.name#)
</cfquery>
</cfoutput> -
Remove leading zeros in report
Hi all,
I do a clasical reoporting. Data in the internal table numeric types. But when writing in the report, is appearing as 000056 etc. I want to remove this leading zeros in the report output. Any helps?
Regards,
Mic.Hi Michael,
u can use the function module for removing leading zeros
CONVERSION_EXIT_ALPHA_INPUT (adding zeros)
CONVERSION_EXIT_ALPHA_OUTPUT (removing zeros)
Regards
Nagesh -
How to remove leading zero from Material Number
Hello Everyone,
I need to figure it out how to remove leading zero from material number. Cureently extractor is sending material number as 100663. But when comes into BI i am getting as "000000000000100663" and similariy in report it is appearing as "000000000000100663". Now my client wants me to exclude preceeding zero for a material in all the reports.
Is there any setting in query desinger to handle this issure or in the backend.
Need your inputs.
Thanks,
Lasya.Hi
you can use the function Module
CONVERSION_EXIT_ALPHA_OUTPUT in the start routine
to test this go to SE37 --- give the CONVERSION_EXIT_ALPHA_OUTPUT -
>display -
> F8
in the input give 000000456
and execute
the out put will be 456
for getting Zeros you can use
CONVERSION_EXIT_ALPHA_INPUT--- to remove leading zeros
Santosh
Edited by: Santhosh Nagaraj on Oct 29, 2009 10:52 PM
Edited by: Santhosh Nagaraj on Oct 29, 2009 10:54 PM -
hi,
how to remove leading zeros. can anyone suggestHi ,
U can either use this function module also
CONVERSION_EXIT_ALPHA_OUTPUT
or
SHIFT <yourField> LEFT DELETING LEADING '0'
or
try NO-ZERO option of WRITE statement
or
Another way is to create another variable of type I and assign the value into it
example:
DATA: L_NUMC(08) TYPE N.
DATA: L_INT TYPE I.
L_NUMC = '00000018'.
L_INT = L_NUMC.
Result will be = 18.
Hope this helps
Regards,
Prasanth
Reward all the helpful answers -
How to remove Leading zeros from MATNR "at Database Level"
Hi,
When we create a material in MM01 , we can either create material as Internal Material No. or External Material No. (By Explicitly entering a material No.)
Our requirement is that: When we create an Internal Material , there should NOT be any Leading Zeros in MATNR.
and for External Material No. , Leading Zeros Should be there. (In Database)
1) Now , we can create the No. Range for material in such a way that it will allow only AlphaNumeric entries for Internal Material , and Only Numeric Entries for External Material No.
This should slove the Purpose.
But According to the Client's requirement , Material No can be Numeric OR Alphanumeric for Internal As well as External Material No.
2) We can Add or Remove leading zeros from MATNR at application level. i.e. we can find some BADI / Enhancement where we will Use the Conversion FM (CONVERSION_EXIT_MATN1_OUTPUT or CONVERSION_EXIT_ALPHA_OUTPUT) and remove Leading Zeros from MATNR. But these changes will NOT reflect at Database Level , Because in MATNR Domain , there is a conversion Routine , That will Add Leading Zeros in MATNR While saving in the Database.
3) While Displaying the Material In SE11 , we can also set the "Display Format" as With leading Zeros OR Without Leading Zeros.
But we dont want to Just "Display" material with OR Without Leading Zeros. we want to actually create materials in that way.
What can we do , so that at Database Level our changes are Reflected.
Thanks and Regards,
Anand Gore
Edited by: anandgore on May 18, 2011 3:47 PMThat will Add Leading Zeros in MATNR While saving in the Database.
That is because you have it configured that way. You can configure the storage as you desire. The default is the behavior you are describing. You, or your functional analyst, need to review the documentation on the MM config settings for material master number storage.
Never use CONVERSION_EXIT_ALPHA_OUTPUT for material conversion. Also keep in mind that the MATN1 functions have their own BADI for extended formatting... -
How to remove leading zeros from variable
hi,
how to remove leading zeros from variable like it_vbap-matnr.
value in it_vbap-matnr is 000000000000000358
i want to remove leading zeros so that it become 358
regards
deepakYou can use Function Module <b>'CONVERSION_EXIT_MATN1_OUTPUT'</b>
This Function Module will eliminate leading Zeros.
For each MATNR Value read form DB Table,u can eliminate Leading zeros and then modify ur Internal table.
I think u will not get leading Zeros into utr Internal table when u read from VBAP.
Bcoz MATNR in VBAP itself have Conversion routine.
If u r getting leading zeros,U can use following Logic.
tables:
vbap.
data:
t_vbap like standard table of vbap.
select matnr
from vbap
into corresponding fields of table t_vbap.
loop at t_vbap into vbap.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
EXPORTING
INPUT = vbap-matnr
IMPORTING
OUTPUT = vbap-matnr
modify t_vbap from vbap transporting matnr.
endloop.
Hope this will work..... -
Removing leading zeros from a string value
Hi All,
i have a Requirement like , i need remove leading zeros from a string value,
like , 00Raj00Shekar==>Raj00shekar,
how can i do this ?
if it is only with the custom functions ,where can add the fuction in Jdeveloper and SOA Middle ware?
Thanks in Advance,
RajHi Raj,
you can use below function to get the desired output in xsl.
<xsl:value-of select='translate(oraext:left-trim(translate(<inpString>,"0"," "))," ","0")'/>
HTH,
Regards,
Vikas Manchanda -
Removing Leading zeros from query output.
Hello Experts,
Is it possible to remove leading zeros from the query output for a particular column?
I have a characteristics 'Reference Document' which has values like '000001386'. The users just need '1386' to be displayed and have asked us to remove the leading zeros.
Is there something that can be done for this at a query level? I can't modify the underlying InfoProvider because this requirement is just for one set of users, the other users need the document nmber in the original format.
Thanks
ArvindHi,
you can use ALPHA conversion option in the definition of that particular characteristic.
Try this code in a routine.,in query designer;
data a(9) value '000001386'.
SHIFT a LEFT DELETING LEADING '0'.
write:/ a.
Output will be : 1386
Or use this method also
data a(9) value '000001386'.
Call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
Exporting
input = a
Importing
output = a.
write a.
output:
1386
Regards
CSM Reddy -
Conversion routine to remove leading zeros from nonnumeric values.
Hi,
Can anybody tell me any conversion routine while can remove leading zeros from a character value.
Eg :
input : asdfe
output : 0000asdfe and vice versa
I tried with Alpha conversion routine but that is useful only with numeric values.
Please help.
Regards,
Deepti Jain.Hi,
See the following program, and the same logic you can apply in Transfer Rules/Transformations. Take ABAPer help.
REPORT ZALPHA_INPUT.
DATA: ZI(18) TYPE C,
ZO(12) TYPE C.
DATA: ZS(12) TYPE C,
ZR(18) TYPE C.
ZI = '000000099999889925'.
ZS = '099999889925'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = ZI
IMPORTING
OUTPUT = ZO.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = ZS
IMPORTING
OUTPUT = ZR .
Write:/ ZI.
Write:/ ZO.
Write:/ ZS.
Write:/ ZR.
Thanks
Reddy -
Hi all,
Iam having a requirement where in a enduser enters the vendor number and after pressing enter key it should display the vendor num along with vendor name concatenated in the same field. But the end user is provided the facility that he may not enter the exact vendor number ( I mean if vendor number is for example 0000055, the enduser may enter simply 55). The system should convert it with leading zeroes internally. And in display it should display removing leading zeroes.
like input: 55 output : 55 Vendor_Name
my approach
iam using conversion_exit_alpha_input for adding leading zeroes before select query ( to fetch the vendor name for vendor number the user supplies)
before displaying the output after concatenation,
iam using conversion_exit_alpha_output.
after execution,
it is asking the exact vendor number . But in the output, it is giving the vendor number along with vendor name by removing leading zeroes ( as expected).
how to make the system accept the number without leading zeroes. please suggest me.
tthanking you in advance
regards
BikashHi Bikash,
Since you have to display the Vendor number concatenated along with the Vendor Name, why do you need to use the Alpha Exit Function Module. As you have the Vendor number without the zeros in the input field, you can store it in a temporary variable and then once the Vendor name is available you can concatenate it along with the number in the same field.
If you need a code snippet, you can provide the Technical details of the fields of input. We can use the implicit ABAP type casting feature to get the Vendor Number without any leading zeros.
Hope this helps.
Thanks,
Samantak.
Maybe you are looking for
-
Grid Download to Excel truncates leading zeros
We are on tools 8.51. The download feature for a Grid now removes the leading zeros when the grid is downloaded to excel. Has anyone found a way to fix this issue ? Thanks in advance
-
My ipad mini is having a seziure
i try to go onto facebook and scroll down through my feed and then all of a sudden the screen starts jittering up and down. This is like an ipad seziure is it because my screen is cracked, illuminatti or just a bug that needs to be fixed? please help
-
JScrollPane freezes when updating JTable in viewport
I have the same problem that is described in this bug: http://developer.java.sun.com/developer/bugParade/bugs/4495213.html I don't understand the workaround. Is that the developer's class (BasicTableUI.java)? Anyone else experiencing this problem? Ho
-
Sound quality is extremely poor out of iPhone head jack.
I have tried every EQ setting the phone has and the sound quality is no way even close to my old Dell MP3 player. It is so bad I am keeping my Dell JukeBox and not using the phone. Why is it so bad? Doesn't Apple have a clue?
-
2.4GHz vs 2.7GHz MacBook Pro Retina?
What is the performance difference? The 2.4 only comes with 256GB of flash memory and the 2.7 doubles it and the RAM too. It's about £420 difference. I was thinking if I get the 2.4 I could buy an external SSD if I run out which I'm sure I will..