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: 

Select statement fetches UnConverted value

premal_mistry2
Active Participant
0 Kudos
3,502

Hi,

I have a select statement on MARA. The problem is that for some records (matnr) it fetches the unconverted value i.e. if the matnr is 10000031 it returns 000000000010000031 in the internal table.

Any Idea ?

5 REPLIES 5

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,075

Yes,

Because the domain MATNR has conversion exit MATN1 associated with it. If you want to remove the leading zeroes you have to use the corres. output FM CONVERSION_EXIT_MATN1_OUTPUT.

BR,

Suhas

Edited by: Suhas Saha on Mar 5, 2010 10:42 AM

vinod_vemuru2
Active Contributor
0 Kudos
1,075

Hi,

This is because MATNR field has conversion exit. You can use the FMs CONVERSION_EXIT_MATN1_INPUT for adding the leading zeros and CONVERSION_EXIT_MATN1_OUTPUTfor removing the zeros.

Thanks,

Vinod.

former_member194669
Active Contributor
0 Kudos
1,075

If you check field MARA_MATNR in the domain there will be conversion exit associated with this domain. so if don't want the padded zero, you need to use function module CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'

within the loop of the internal table or u can also use PACK syntax.

0 Kudos
1,075

thanks guyz fro the quick reply..

i know about this conversion exit. But the issue over here is that MARA contains duplicate entries for material 10000031 ... i don't know how ... but it is there . One with Maint. Status as KELBVG and other with KLBG.

So my select statement returns two rows one with 000000000010000031 and other with 10000031.

Any idea.

0 Kudos
1,075

Hi,

I don't think it is duplicate entry. You should consider whole 18 characters for the comparison. I suspect if one is from external number range and other is from internal number range.

Why don't you try to create a material with internal number range(Don't enter material number. System will assign the number) and another with external number range (Enter the material number same as the one you have created for internal without leading zeros while creating it).

You can take help from your MM consultant to identify the material types allowed for external and internal number ranges.

Hope this helps...

Thanks,

Vinod.