How to Supress Leading Zeros
Hi,
i am modifying standard rvorder0 form, from that i'm getting line item and material numbers as &vbdka-posnr& and &vbdka-matnr&. when i'm pringing these in my line items material number is printing 00000000000000049, its lenght is 18. but i need only 46 to print to accomdate line time width for other cols. how to do this for item number and material number in script. plss let me know its very urgent
Regards
Munna
hi
good
use the function module
CONVERSION_EXIT_ALPHA_OUTPUT converts any number with zeroes right into a simple integer
Example:
input = 00000000000123
output = 123
thanks
mrutyun^
Similar Messages
-
Reg:ALV, how to supress leading zeros
Hi,
Presently I am doing a report with ALV,
Here I am getiing the ouput properly,that is i am able to display emlpoyee number correctly but with leading zero's.
I want to suppress this leading zero's as per the requirement.
How to solve the problem.
Thanks in Advance
Irfan HussainHi,
This is my field catalog decleration.
Can just help me out with it.
Still the problem is persisiting.
DATA:RT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
LS_FCAT TYPE SLIS_FIELDCAT_ALV,
POS TYPE I VALUE 1.
CLEAR LS_FCAT.
POS = POS + 1.
LS_FCAT-COL_POS = POS.
LS_FCAT-FIELDNAME = 'PERNR'.
LS_FCAT-TABNAME = 'PA0001'.
LS_FCAT-REF_FIELDNAME = 'IT_PA0001-PERNR'.
LS_FCAT-REF_TABNAME = 'IT_PA0001'.
LS_FCAT-SELTEXT_M = 'Emp. Number'.
APPEND LS_FCAT TO RT_FCAT.
Regards,
Irfan Hussain -
How can we supress leading zeros?
how can we supress leading zeros?
use
<b>CONVERSION_EXIT_ALPHA_OUTPUT</b>
Conversion exit ALPHA, external->internal
ALPHA conversion is used especially with account numbers. During conversion from the external to the internal format, the system checks to see if input in the INPUT field is purely numeric, that is, if this input consists only of numbers, possibly with spaces before and after them. If this is the case, then the number string is inserted right- justified in the display field OUTPUT and all spaces to the left of the value are filled with zeroes ('0'). If the input is not purely numeric, it is inserted in the display field from left to right and all extra spaces are filled with blanks.
Example:
(Input field and output field are both eight characters in length)
1. '1234 ' --> '00001234'
2. 'ABCD ' --> 'ABCD '
3. ' 1234 ' --> '00001234'
Conversion from the internal to the external format (function module CONVERSION_EXIT_ALPHA_OUTPUT) is undertaken in exactly the opposite manner.
Usage:
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = v_input
importing
output = v_output
exceptions
others = 1.
regards,
srinivas
<b>*reward for useful answers*</b> -
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 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..... -
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.
-
How to delimit leading zero in vendor number in OO ABAP ALV without using conversion routine
Hi,
How to delimit leading zero in OO ABAP ALV without using conversion routine, because I have many fields like vendor, customer, material number etc..
How to address this leading zero.
I appreciate your quick response.
Regards,
Nalini S.Hi Nalini,
Delimiting leading zeros in fields has to be done via conversion routines, as suggested by Vadamalai you need to pass on the conversion routine name in you field catalog variable.
Now as to which object oriented approach are you using to have your table contents display in ALV as it matters -
Using FACTORY method of CL_SALV_TABLE class, or
Using SET_TABLE_FOR_FIRST_DISPLAY method of CL_GUI_ALV_GRID class.
Using FACTORY method of CL_SALV_TABLE will do your own work, no need to apply any conversion routines or set long/medium/short text for columns as we do in field catalogs!
Cheers,
Varun -
Hi,
How to suppress leading zeros in a character string.
Thank you.hi,
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = str1
IMPORTING
output = str1.
Example:
input = 00000000000123
output = 123
rgds
Anver -
My database has a field that has a total of 30 characters.
Depending on the data that was entered there could be a large number of leading zero's that is displayed within that field. How do you supress the leading zero's for that field when the number of leading zero's could fluctuate?
In addition to that, they are also using Bar Code Scanning on that same field. How can you suppress the Leading zero information on the same field once it has been converted to Bar Code?I dont think cstr(val(x)) will work if the value is "001000000000000000005147002589" as val(x) will convert it to a number and due to the number of digits, CR will convert it to scientific notation, at least CR XI converts.
One possible solution would be to loop through the digits and extract the data by eliminating the leading zeros. For example:
stringvar x := "001000000000000000005147002589";
// Example, you don't need this in your formula
numbervar i;
for i := 1 to length(x) do
if x<i> NOT EQUAL TO '0' then exit for
// use the not equal sign (greater than and less than symbols)
x[i to length(x)];
You can use this formula for both display and bar code purposes by replacing X with the db field.
Edited by: Sanjay Kodidine on Oct 21, 2009 4:50 AM -
How to retain leading zeros in module pool screen
Hi experts,
I have a ztable field of type NUMC4 being displayed on a module pool screen, the value in the field is '0001', but on the screen it displays value as '1' (without leading zeros), When I save the record, Even in the databse it stores as '1'.
But I have checked in debugging the field always contains '0001' in the program execution and I have also used 'CONVERSION_EXIT_ALPHA_INPUT' in the PBO but no use.
Pls suggest.
Thanks,
DeepakCheck the screen attributes for the field. There is an option to show leading zeroes.
edit.
And how did you see it was stored a 1 and not 0001? Using SE16N? Mind you: with SE16N conversion-exits are executed automatically thus showing 0001 as 1.
To make sure: double click on the record in SE16N and look if it's still 1 and not 0001. -
How to add leading zeros to a packed variable
Hi all,
I have a to add leading zeros for a packed field.
eg.
Data : brgew like mara-brgew.
brgew = '12.063'.
but I have to display the field as '0000000000012.063'.
How can we achieve this?
Regards.Execute the code .
REPORT zex13 .
Data : brgew like mara-brgew.
brgew = '12.063'.
data:val(18) type c,
in(13) type n ,
dec(6) type c.
data : a type i ,
b type i.
a = TRUNC( brgew ).
write:/ a .
in = a.
write:/ in.
dec = frac( brgew ).
write:/ dec.
concatenate in dec+2(4) into val separated by '.'.
write:/ val.
see if this works for u .
regards,
vijay -
How to display leading zeros in a report
Hi folks,
I am doing a HR report and the users are very much used to seeing a two digit numeric value as the pay scale since their legacy days.
In BW, I have the Pay Scale defined as a character (2) and it shows the values on the report as follows:
Pay Scale
0
1
2
3
11, etc.
But the users would like to see 00, 01, 02, 03, 11, etc.
Under the query properties, display tab, there are four separate options - display zeros, show zeros as, etc. I tried all the options but the pay scale still does not show the leading zeros. I remember seeing a SAP note a while back that talks about this. Does anybody know how to force the leading zeros on the BEx report.
Thanks.
AbdulTry removing the ALPHA Conversion from info object defintion.
-
How to remove leading Zeroes in all fields in Payload
Hi,
How can I remove the leading Zeroes in every Filed I have in whole Payload Structure.there are around 10000 fields that have to be removed the leading Zeroes.any good idea please.
<POSNR>000010</POSNR>
<MATNR>000002465640</MATNR>
<ARKTX>000012 KG D107</ARKTX>
<MATKL>00030010000</MATKL>
<WERKS>0000ORGC</WERKS>
<LGORT>0000GC55</LGORT>
<CHARG>000TEST</CHARG>
like this mutliple segments and multiple Fields.so I can take as whole payload with multiple fields should not have leading Zeroes.I can handle if they are 10 0r 20 fileds,but not like whole pay load/1000 fields right.
thank you,
PremHi
You can have an additional XSLT mapping, to your existing one..
use copy-of & apply-templates to copy the whole tree & make changes recursively.
below is a sample code , the marked line is where you need to try your logic of trimming Zeros. (this code does upper case)
add this below code in your interface mapping object, as XSLT mapping, which does the job (only try putting your logic)
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output method="xml"
indent="yes"
omit-xml-declaration="yes"/>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="upper-case(.)"/>
</xsl:template>
</xsl:stylesheet>
hope this fixes your issue
Regards
Vishnu -
How to remove leading zeroes of a coloumn in a table
can someone tell me how to remove the leading zeroes in a table's coloumn .... its a NUMC data type..
i tried with abap statement shift leading zeroes, but its not working for me.... the sorting is missing..
in properties is there any option to remove the leading zerores>
nirajaHi Niraja,
I am displaying a table with information from SFLIGHT. The CONNID field is of type NUMC and so it too used to contain the leading zeroes. I so deleted the leading zeroes in my WDDOINIT method before binding the internal table to the context node. The table now does not display the leading zeroes as earlier. Find my coding as shown below:
METHOD wddoinit .
DATA: lr_node TYPE REF TO if_wd_context_node,
wa_sflight TYPE ig_componentcontroller=>element_node,
lt_sflight TYPE ig_componentcontroller=>elements_node.
SELECT * FROM sflight INTO TABLE lt_sflight.
LOOP AT lt_sflight INTO wa_sflight.
SHIFT wa_sflight-connid LEFT DELETING LEADING '0'.
MODIFY lt_sflight FROM wa_sflight TRANSPORTING connid.
ENDLOOP.
lr_node = wd_context->get_child_node( name = ig_componentcontroller=>wdctx_node ).
lr_node->bind_table( new_items = lt_sflight ).
ENDMETHOD.
Regards,
Uday -
How to remove leading zero in a inputfield
I have a inputfield UI element which is bind to a NUM type context. When it display a number, it always come with leading zero, like '001'. Can anyone teach me how to remove the leading zero.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3a/2232666aeb45f4b759848a4caf9c8b/frameset.htm
Use the Display leading zeros formatting option in the context attribute properties.
The other option is to use a data dictionary domain for the field that has a built in field conversion exit. The ALPHA conversion exit is commonly used on NUMC fields like Sales Order number to suppress leading zeros. The WD runtime will automatically use the underlying DDIC Domain Field Conversion Exit. You don't need to do anything except use that DDic to define the context.
Maybe you are looking for
-
Displayport L420- DELL monitor
Dear, I have a L420 and connect it to a Dell U2711 monitor- the monitor itself function as hub for mouse, keyboard etc-. The Dell monitor is connected to my laptop through display port andUSB. For practical reasons I would like to put my computer at
-
Playing Multiple sound file simultanyoustly
Is there a Professional audio product that could fit my needs ? I want to have a soundcard that can play a lot of soundfile at the same time. Maybe 10 to 20 wave or mp3 at the same time. Shidewa
-
Problems with prepared statement in MYSQL.
I 've this code: String sql = "UPDATE dcr SET Fecha=?, Origen=?, Destino=?, Mensaje=?, Estado=? WHERE IDDCR=? AND IDUsuario=?"; PreparedStatement st = cn.prepareStatement(sql); SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); java.sql.Date
-
Why No Picture When Full Screen Button Is Pressed?
When I open up IPhoto all the thumbnails load OK. Yesterday I tried to show my grandson some of his younger pictures taken 3 years ago by hitting the Full Screen button. What we saw was a dotted frame with an exclamation mark inside. To my dismay man
-
Duplicate schema System.String in BizTalk.System
Hello, In BizTalk 2010 Administration Console, in BizTalk.System application, I have the schema System.String#string twice (Version=2.0.0.0 and Version=4.0.0.0). And I'm pretty sure that's what cause me this error in my orchestration : There was a fa