Fm for removing leading zeors
Hi Friends,
I want to remove the leading Zeros from the check no and customer no which I am displaying in the layout.
Regards,
Venu
Simplest way would be to use: SHIFT command.
<b>SHIFT <var> LEFT DELETING LEADING '0'.</b>
Alternatively if you need FM: <b>CONVERSION_EXIT_ALPHA_OUTPUT</b>
Kind Regards
Eswar
Similar Messages
-
SAPSCRIPT - Symbol for removing leading spaces/zero's?
Hi,
How do you remove leading spaces/zeros in a variable that is sent from the print program?
Do you use symbols and if so, how (i've never worked with symbols, ever)?
Please help.
Thanks,
JohnI think the "Z" symbol will remove the zeros in the sapscript form. For example,......
/ &EKKO-EBELN(Z)&
Regards,
Rich Heilman -
Removing leading zeros for the quantity field
Hi all,
In my script form there is a quantity field, of 13 and 3 decimals , on the out put its taking that much space un neccesarily,and messing up.
how to make this adjustable in the provided space.
It always 3 digits and 2 decimal points in our case.
Please help me out,
Thanks,
PraveenHi,
For removing leading zeros
&V_VARIABLE(Z)&
Thanks,
Naren -
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 -
Removing Leading And trailing Zeros
Hi Guys ,
Can You help me out in UDF for removing leading and Trailing zeros
Ex : 0123.234000000
And it must satisfy below conditions .
1 ) If value as Null we need 0.0 in target
2) if the value is 0.0 we need 0.0 in target
Thanks in AdvanceOne more option:
Input will be "str" of type string.
Execution type: single value.
mapping:
Input -> mapwithdefault(0.0)->UDF->output
if( !str.equals("0.0"))
char[] chars = str.toCharArray();
for (int index=0; index < str.length();index++)
if (chars[index] != '0')
str =str.substring(index);
break;
int length,index1 ;
char[] chars1 = str.toCharArray();
length = str.length();
index1 = length -1;
for (int in1=index1-1; in1>0;in1--)
if (chars1[in1] != '0')
str=str.substring(0,in1+1);
break;
return str;
else
return "0.0";
http://wiki.sdn.sap.com/wiki/display/Java/RemoveLeadingandTrailingZerosfroma+String -
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. -
How to remove leading zeros for an item number within quickviewer
how to remove leading zeros for an item number within quickviewer. Pls help
ask your abap guy to do it. not portal guys business.
-
Removing leading zeros in a column
Hi,
I would like to remove leading zeros of a column in a table. My Questions :
1. Is it possible?
2. Where is it better to truncate, in RFC or Web Dynpro?.
3. If Possible, How can I do that.
I appreciate your input.
Thanks,
Sunita.Hi Sunita,
Please specify the datatype of the column that contains leading zeros, because if the data type of the column is integer then the leading zeros are automatically taken care.
If your RFC return you int and you are assigning it to a String then the leading zeros will appear.
For example, see the below simple ABAP Program. Just copy and execute it. You will see the difference.
data: a type mara-matnr,
str type string.
select single matnr from mara into a.
write a.
str = a.
write / str.
Hope it helps you.
Regards,
Maheswaran.B
Message was edited by: Maheswaran B -
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> -
Removing Leading Zeroes in Location value
HI Gurus,
I am having some trouble in releasing demand plan to SNP. On the demand planning side, we are using standard characteristic 9ALOCATION for storing location values. When I release demand plan (using Location characteristic - 9ALOCATION) to SNP, I get a message saying 'Location 00000000000000003000 does not exist'. But, I have location '3000' assigned to the active model in APO system.
I believe this issue is arising because, the system is storing leading zeroes in Location value '3000' on Demand Planning side. I know that there is customization setting (SPRO-> APO -> Master data -> Product -> specify output format) to prevent leading zeroes from being added to product number. But I don't see a similar setting for Location and moreover I am using 9ALOCATION and not 9ALOCNO.
So, how can I remove leading zeroes in the values of 9ALOCATION.
Any help/comments are appreciated.
Thanks,
Shiv.I found a solution to this problem. Unlike 9ALOCNO, Characteristic '9ALOCATION' has Alpha conversion routine. So this conversion routine fills up the leading zeros. I removed Alpha conversion routine from the 9ALOCATION in RSA1 and it works fine now.
-
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 -
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 Spaces in the field to be displayed
Hi,
Could you please tell me how to remove leading spaces in currency field in write statement?
the length of the field cannot be changed by writing fieldname(length).
is there any other method to do the same. the length should vary according to the amount in the field.
Ragards,
Krutikahi,
please use "SPLIT " or condense .
eg: SPLIT wa_bseg-hzuon at space into wa_bseg1-hzuon l_space.
to better understand refer this code:
IF it_mhnd IS NOT INITIAL.
SELECT hzuon bukrs gjahr augdt augbl
FROM Bseg
INTO TABLE it_bseg
FOR ALL ENTRIES IN it_mhnd
WHERE belnr = it_mhnd-belnr
AND bukrs = it_mhnd-bukrs
AND gjahr = it_mhnd-gjahr
AND umskz = 'E'.
endif.
data: l_space type char6.
loop at it_bseg into wa_bseg.
SPLIT wa_bseg-hzuon at space into wa_bseg1-hzuon l_space.
wa_bseg1-bukrs = wa_bseg-bukrs.
wa_bseg1-hzuon = wa_bseg-belnr.
wa_bseg1-hzuon = wa_bseg-gjahr.
wa_bseg1-hzuon = wa_bseg-umskz.
append wa_bseg1 to it_bseg1.
clear: l_space, wa_bseg1.
endloop.
IF it_bseg1 IS NOT INITIAL.
SELECT belnr bldat
FROM bsad into table it_bsad
FOR ALL ENTRIES IN it_bseg1
WHERE belnr = it_bseg1-hzuon
AND bukrs = it_bseg1-bukrs
AND augbl = it_bseg1-belnr.
endif.
regards
rahul
Edited by: RAHUL SHARMA on Jan 5, 2009 12:19 PM
Edited by: RAHUL SHARMA on Jan 5, 2009 12:20 PM -
Removing leading spaces in smartforms
When I print numbers in smartforms, they usually have a bunch of leading spaces, which messes up the formatting. E.g. a CURR 15 field containing 5000 will print as " 5.000,00".
I saw the formatting options in the BC470 manual but there are only options to remove leading zeros, or to replace leading spaces with a Filler. What I need is to remove the leading spaces. Anyone know how?
For the moment I'm copying all the numbers I want to print to string fields and using CONDENSE on those, but then I don't get the right number formatting, e.g. I get "5000.00" while I need "5.000,00".Hi
The format of amount field depends on the currency key, the smartforms should write the amount in right format if it can understand which currency is to be used.
The link between these field is done in the dictionary.
If the samrtform can't understand it you can move the amount in the char field using WRITE statament and print this field instead of original one:
WRITE <AMOUNT> CURRENCY <CURRENCY> TO CHAR_AMOUNT.
Max
Maybe you are looking for
-
Back To My Mac: Can access Mac, can't access Time Capsule
I have a Time Capsule and also a Macbook Air behind an ATT modem/router. I have enabled Back To My Mac on both. I also clicked Enable File Sharing and set a password. From a friend's house, I can log in to MobileMe and see both the Mac and the Time C
-
Best practice for implementing a scalable ecommerce solution
Hi, I'm new to SAP Business One, is there a white paper on the best practice of implementing a scalable ecommerce solution with SAP Business One using IIS/ASP.NET? What licensing and software(version)is need to implement a scalable ecommerce solution
-
Reg: Default value option - is it for value mapping????
Hi, Recently i had seen an option of mapping a default value or error out the message when value mapping (???) doesnt fetch the conversion. I'm confused if i'm referring to value mapping or any such functionalitywhich comes as a standard pack....cer
-
Display flickers lines and then dies black until device has hot temperature
Hi Discussion, I have a very strange problem since approx 2 weeks. My PBG4 is working fine and it is a very nice device, but until it reaches it's working temperature it is playing around with the display. There are lines (horizorental) flickering ar
-
TabNavigator Not Displaying Tabs
I have an app whose top-level container is a TabNavigator (PARENT). PARENT has one static tab (index 0) and a Repeater bound to an Array that dynamically creates the remaining tabs. Clicking a button on the first tab adds an item to the Array and upd