2010 Mar 05 5:05 AM
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 ?
2010 Mar 05 5:09 AM
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
2010 Mar 05 5:09 AM
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.
2010 Mar 05 5:10 AM
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.
a®
2010 Mar 05 5:19 AM
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.
2010 Mar 05 5:41 AM
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.