2007 Mar 29 6:59 AM
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
deepak
2007 Mar 29 7:00 AM
Hi Deepak,
To remove leading zeros and leading blanks
Please use FM
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
Hope this resolves your query.
Reward all the helpful answers.
Regards
2007 Mar 29 7:00 AM
Hi Deepak,
To remove leading zeros and leading blanks
Please use FM
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
Hope this resolves your query.
Reward all the helpful answers.
Regards
2007 Mar 29 7:01 AM
use CONVERSION_EXIT_ALPHA_OUTPUT
or shift itab-matnr left deleting leading '0'.
regards
shiba dutta
2007 Mar 29 7:02 AM
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = wf_version
IMPORTING
output = wf_version.
Example:
input = 00000000000123
output = 123
2007 Mar 29 7:02 AM
Hi,
Use <b>shift it_vbap-matnr left deleting leading '0'</b>.
or you can move that to an integer variable .
Regards,
Sandhya
2007 Mar 29 7:03 AM
2007 Mar 29 7:03 AM
Hi..
just take another variable of type integer and move this to that.
data:
w_n1(5) type n,
W_N TYPE I.
w_n1 = 56.
write: w_n1.
w_n = w_n1.
write w_n.
Message was edited by:
Rammohan Nagam
Message was edited by:
Rammohan Nagam
2007 Mar 29 7:04 AM
Certain symbol values are printed with leading zeros. If you want to suppress these, use the Z option.
Syntax
&symbol(Z)&
suppose u have a vriable V_AMOUNT.
V_AMOUNT = 00000001234.40.
IF u write the &V_AMOUNT& THEN IT PRINTS 00000001234.40
IF u write the &V_AMOUNT(Z)& THEN IT PRINTS 1234.40
I hope every thisg is clear
Please Close this thread.. when u r problem is solved. Reward all Helpful answers
is it &V_VAR(C)&--> condence
&V_VAR(Z)&-->do not printLeading zeros
u can use these in Scripts and Smartforms
Message was edited by:
sunil kumar
2007 Mar 29 7:04 AM
Hi Deepak,
Use syntax..
<b>SHIFT <VARABLE> LEFT DELETING LEADING '0'.</b>
<b>
Reward Points for Helpful Answer</b>.
Regards,
Tejas
2007 Mar 29 7:29 AM
You 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.....
2007 Mar 29 7:51 AM
Hi Deepak
Just GOTO PATTERN and use CONVERSION_EXIT_ALPHA_OUTPUT u r done.
Regards,
Ram
2007 Jun 13 12:09 PM
I think if the variable is integer kind then we can remove the leading zero by using
Int var = Integer.parseint(integer);
2007 Jun 13 12:14 PM
You can also do :
Shift Variable LEFT deleting leading zeroes..
Thanks .
Praveen .