Application Development and Automation 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: 
Read only

Removing preceding Zeros

Former Member
0 Likes
1,305

Dear All .

Mat . 0000000980

I wnat to remove preceeding zeros

I want It to be displayed as

mat . 980 .

What I should do .

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

Regards,

Santosh

9 REPLIES 9
Read only

Former Member
0 Likes
1,111

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

Read only

Former Member
0 Likes
1,111

Hi,

Use the FM CONVERSION_EXIT_ALPHA_OUTPUT

Cheers

VJ

Read only

0 Likes
1,111

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

Regards,

Santosh

Read only

Former Member
0 Likes
1,111

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

Read only

Former Member
0 Likes
1,111

Hi,

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

write: material no-zero.

Regards

vijay

Read only

Former Member
0 Likes
1,111

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

Read only

Former Member
0 Likes
1,111

Use CONVERSION_EXIT_ALPHA_OUTPUT.

Also you can use pack and unpack keyword.

See F1 for pack and unpack.

Regards,

Sangeeta.

Read only

0 Likes
1,111

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

Read only

Former Member
0 Likes
1,111

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.