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 Hussain
Hi,
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
Similar Messages
-
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
Munnahi
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^ -
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 -
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.
-
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 -
Hi Gurus
I am developing ALV Report.
For my Header I have to display Material Number.
It is displaying with Leading Zeros.
I want to supress those Zeros.
Please send me the sample code urgently.
Regards,
Kumarwhen you are storing the material no in your int table take it in a character variable
and use
SHIFT cmatnr left deleting leading '0'.
now itab-matnr = cmatnr.
append or modify your inttable.
or
loop at itab.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = itab-matnr
IMPORTING
OUTPUT = itab-matnr
modify itab.
endloop.
regards
shiba dutta -
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 characteristic in CT04
The business is requesting that we change a class characteristic so that it adds leading zeros. Currently the characteristic is set as numeric with length of 6, no decimals. Is there any way via template or otherwise to force this characteristic to store leading zeros, as recorded against the characteristic?
Hi David,
1. If you are mentioning about the "Characteristics"This is Standard Field name.
2. You will not be able to influence the same,
3. Also i doubt if you are talking about the Characteristic Value - Since only in the Char Value we will be able to define the length, etc.
4. In case of Charvalues if you want leading zeros then create it as character , where you can store with leading zero
Reg,
Dsk -
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
Maybe you are looking for
-
Extended class variable corruption...why?
hello guys, I've beed struggling on this issue for more than 2 hours and, together with a friend, we weren't able to figure it out. I have a class named HandlerMod that extends DefaultHandler (this one org.xml.sax.helpers.DefaultHandler) and in this
-
OSX 10.7.4 login items resetting
My macbook pro occasionally resets its login items, about once every month. Its getting more and more iritating so I'm hoping someone can suggest something. I'm running OSX 10.7.4. Thanks,
-
Trying to Attach Files to an Oracle Database Engine
My client performed a complete backup of their Oracle folder (Windows). They simply used Windows Explorer by dragging and dropping the folder on to an external drive. Now that I have the files, I need to know how to "attach" them to my local Oracle d
-
Nearest Monday from a given date - how do I do this?
Hello: We have a requirement to find the nearest Monday from a given date. Can anyone help me with this query? Thanks!
-
Worked until today. Sony HD SR12 not detected anymore.
All of a sudden my cam is not being seen. I can import photos from it but that's all.