Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Removing preceding Zeros

Former Member
0 Kudos

Dear All .

Mat . 0000000980

I wnat to remove preceeding zeros

I want It to be displayed as

mat . 980 .

What I should do .

9 REPLIES 9

Former Member
0 Kudos

hi Raghu

Use this

call function 'CONVERSION_EXIT_ALPHA_OUTPUT'

exporting

input = it_sales-matnr

importing

output = it_sales-matnr.

Regards,

Suruchi

Dont forget to award points

Former Member
0 Kudos

Hi,

Use the FM CONVERSION_EXIT_ALPHA_OUTPUT

Cheers

VJ

0 Kudos

use FM <b>'CONVERSION_EXIT_ALPHA_OUTPUT'</b>

Regards,

Santosh

Former Member
0 Kudos

HI,

Use the below code. hope it solves your problem.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING

INPUT = itab-matnr

IMPORTING

OUTPUT = itab_matnr.

regs

Rakesh

former_member188685
Active Contributor
0 Kudos

Hi,

data: material(10).
material = '0000000980'.

write: material no-zero.

Regards

vijay

former_member188685
Active Contributor
0 Kudos

Hi Raghavendra,

data: material(10),
      test(10).
material = '0000000980'.

<b>write: material to test no-zero.</b>
write test.

now test is holding a value with out leading zeroes.

the bold one will work.

Regards

vijay

Former Member
0 Kudos

Use CONVERSION_EXIT_ALPHA_OUTPUT.

Also you can use pack and unpack keyword.

See F1 for pack and unpack.

Regards,

Sangeeta.

0 Kudos

hi,

try this.

if you have the matnr in inetnal table

LOOP AT itab.

SHIFT itab-matnr LEFT DELETING LEADING '0'.

MODIFY itab.

ENDLOOP.

otherwise

SHIFT matnr LEFT DELETING LEADING '0'

Message was edited by: Ronie James

Former Member
0 Kudos

Hi Raghavendra,

1. I don't think anything

is specifically required to be done for this.

(This is SAP default behaviour)

2. I suppose your field is Material Number.

(of for that matter , any other field,

which has a data element)

3. If the FIELD is defined as TABLE-FIELD,

(reference to the data element)

then sap will automatcially do the conversion.

4. Just copy paste in new program,

to get the taste of it.

report abc.

data : begin of itab occurs 0,

matnr like mara-matnr,

end of itab.

*----


select * from mara

into corresponding fields of table itab.

*----


loop at itab.

write 😕 itab-matnr.

endloop.

regards,

amit m.