Validation on Material number

Hi , I am retrieving material numbers from a excel sheet into an internal table. Now I want to check this internal table against MARA table to see if the entered material numbers are valid or not. How to achieve this ? I mean what is the most efficient way.
Also , if I enter a value in a screen input field how can I check its validity with material number sin MARA
Thank you .

Hello Krish,
How you know which material number is wrong one unless if you use error log table.
See the below logic :
You can write simple logic :
Assume that your internal table is itab.
error log internal table
data : begin of itab1 occurs 0,
          matnr(18) type c,
          text(50) type c,
         end of itab1.
loop at itab.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = ITAB-MATNR
IMPORTING
OUTPUT = ITAB-MATNR
EXCEPTIONS
LENGTH_ERROR = 1
OTHERS = 2.
select single * from mara into mara
                                 where matnr = itab-matnr.
if sy-subrc ne 0.
itab1-matnr = itab-matnr.
itab1-text = 'Material does not exits'.
append itab1
clear itab1.
endif.
endloop.
Thanks
Seshu

Similar Messages

  • Validation of vendor material number in IDOC_INPUT_INVOIC_MRM

    Hi folks,
    Scenario: Inbound EDI vendor invoices received as IDOCs.
    I'm using Logistics Invoice Verification process code INVL to receive and post vendor invoices on to the ERP2004 release of R/3.
    I have purchasing info records setup with the vendor material number.
    When I process an inbound vendor invoice, I can put in a customer material number i.e. a material number existing in material master in E1EDP19-IDTNR with qualifier E1EDP19-QUALF = 001.  When I do this, R/3 checks that the material number is valid and refuses to post an invoice if the material number is invalid - this is good.
    This means that the EDI program parameters with the 'Check Material Number' enabled is working as expected.
    Now when I only have a vendor material number i.e. E1EDP19-QUALF = 002 an E1EDP19-IDTNR = vendor part number, R/3 posts the invoice even if the vendor part number is invalid - IDOC_INPUT_INVOIC_MRM does not seem to be validating the vendor part number.  The document posts whether I use a valid vendor part number or an invalid one - what am I missing?
    Satish

    I can answer by words of Axel Angeli - top level SAP R/3 consultant and R/3 cross-application development coach, the author of classic book "SAP R/3 Guide to EDI, ALE and Interfaces":
    "SAP R/3 delivers a serious of predefined EDI programs. Many project administrators see them as standards which should not be manipulated or modified. The truth is, that these IDoc processing functions are recommendations and example routines, which can be replaced by own routines in customizing."
    and
    "SAP R/3 is delivered with a series of predefined IDoc types and corresponding handler function modules.
    Some of the handler programs have been designed with user-exits where a developer can implement some data post-processing or add additional information to an IDoc.
    You must always see those programs as examples for IDoc handling. If the programs already do what you want, it is just fine. But you should never stick to those programs too long, if you need different data to be sent."
    So now you can feel free to customize
    Regards,
    Maxim.

  • New validation - don't inform material number when creating

    Hello!!!
    I'd need to create a validation in order to avoid informing the field 'SAP Material number' when creating a new entry in MDM Data Manager for specific material types (material type is a lookup field which has two values, let's say 1 and 2).
    For material type 1, we need to inform, when creating the entry, the material type 1, supplier name and supplier reference, but not the SAP material number, as it comes informed through an interface from SAP R/3.
    For material type 2, we only need to inform the SAP material number.
    Could you guide me on how to do this validation?
    Thank you,
    Carlos Santamaría.

    Hello,
    The data flow is as follows:
    There are two scenarios, one for Goods:
    1. Add new record into the Data Manager.
    2. Inform field 'Material type' (lookup field) Goods.
    3. Inform field 'Supplier name' (lookup field).
    4. Inform field 'Supplier reference' (text field).
    5. Field 'SAP material number' must be left EMPTY when creating the new record. Once it's created, there is an interface from SAP R/3 which updates through ABAP API the records, informing the SAP material number and other fields informed in SAP R/3.
    The validation should avoid that the user informs the material number when creating the new record.
    Second scenario is for Finished Goods:
    1. Add new record into the Data Manager.
    2. Inform field 'material type' (lookup field) Finished goods.
    3. Inform field 'SAP material number' (text field).
    4. Optionally it is possible to inform Supplier name and Supplier reference, but it's not always inform.
    There is already a validation rule that force the user to inform 'Supplier name and supplier reference for Goods, and for Finished goods it's mandatory to inform the SAP material number.
    There is another field which is 'Unique key' which is a calculated field and it's composed by SAP material number + Supplier number + Supplier reference.
    Our problem is to avoid that the user informs the SAP material number only for Goods. If the user does it, the interface will not work as it is designed.
    Thanks for your feedback.

  • To fill in the material number with item category u201CBu201D for Framework Order.

    The use of framework orders (also referred to as blanket purchase orders)  enables you to procure a variety of materials or services from a vendor up to a predefined maximum value (the value limit).
    Instead of a specific delivery date, you specify a validity period for the order.
    Goods receipts or the entry and acceptance of services performed are not necessary in the case of a framework PO and limit items.
    The invoices are posted directly with reference to the purchase order, provided that the specified value limit is not exceeded. When the value limit of the PO is reached, or the validity period is exceeded, the system issues a warning message. It is possible to book the invoices, but these are blocked for payment.
    During the phase of service performance, the cumulative u201Cactual" values (for the services actually performed) are continually updated in the underlying purchase. This enables you to monitor the progress of a procurement project on an ongoing basis. By comparing the "actual" value with the total value, you can always obtain an overview of the degree to which a budget for unplanned services or materials has been exhausted (i.e. see whether predefined limits have been reached or nearly reached).
    So with the Framework Order type (FO) and item category u201CBu201D you get the error that it is not allowed to fill in the material number with item category u201CBu201D.
    Please suggest me the possible solution to fill in the material number with item category u201CBu201D for Framework Order.
    Best Regards,
    Harisha

    The Framework order type is specialy defined for lesser value procurements (ex: stationeries, cleaning services ....) which are all not worthy to create Material Master at all.
    If you are very sure to fill the Material number, then proceed with some other document type.
    In what circumstances you want to put material number in FO order?
    Karthi.

  • How change plant, net price, OPu, and Material Number from ME32K

    Hi GURUs,
    May let me know how I should configure ME32K in order to allow users to change:
    - Material Number
    - Net Price
    - Order Purchasing Unit
    - Plant
    I have tried setting up field selections layout properly, even debug PBO, it is still greyed out for those fields.
    Please help.
    Thanks,
    Tony Yuwono

    there is no way to change the price in item overview in the contract.
    The reason is explained in OSS note 685117.
    ........The problem is that Scales and/or validity periods may exist for the conditions, because contracts have time dependant conditions, just like info records do.
    This is in contrast to e.g. Purchase orders which have Time independant conditions and so, NO scales nor validity periods.
    A Purchase order has A price! The price maybe determined based on a source; a contract or an info record. Depending on the order quantity and the date, the PO price is determined.
    The contract does not have A date, it might have several; indicated by the validity periods. Furthermore the price is dependant on eventual scales. Therefore it does not have A price either..........

  • Validation of material BOM quantity at the time of production order confirm

    Hi,
    I want validation on material BOM ,when i confirm production order.
    Actually when i am going to confirm my production order by tcode CO11, In this screen,i click on "Goods Movement" button. According to confirmed quantity , consumed materials will display. Here i can change material quantities. And here i want some validation. I there any user exit for this screen.

    Hi,
             Exit Name Description
    PCSD0001 Applications development R/3 BOMS
    PCSD0002 BOMs: Customer fields in item
    PCSD0003 BOMs: Customer fields in header
    PCSD0004 BOM comparison
    PCSD0005 BOMs: component check for material items
    PCSD0006 Mass changes user exit
    PCSD0007 Check changes in STKO
    PCSD0008 WBS BOM: Customer-specific explosion for creating
    PCSD0009 Order/WBS BOM, determine URL page
    PCSD0010 Order/WBS BOM, determine explosion date
    PCSD0011 Knowledge-based order BOM, parallel update
    PCSD0012 Customer - Mat. number/mat. number during material exchange
    PCSD0013 Customer-specific processing of an explosion for BOM browser
    PCSD0014 Knowledge-Based Order BOM: Status
    BADI's are
    WORKORDER_CONFIRM
    WORKORDER_UPDATE
    WORKORDER_GOODSMVT
    <b>Reward points</b>
    Regards

  • Making old material number mandatory for mm02

    hi,
       how to make  old material number(mara-bismt) mandatory for mm02 transaction.
    regards

    Hi,
    You can do the validation using enhancement "MGA00001", component "EXIT_SAPLMGMU_001".
    Regards
    Vinod

  • Barcode Same as Article code or Material Number

    Hi,
    I am working in IS-Retail solution. Requirement is, Bar code should be same as Article code.
    In Retail, Articles can be created as Single / Variant articles. I need the same functionality even for variant Articles.
    Can anyone help me to comeout from the issue.
    Thanks in Advance.
    Krishna Murthy M

    Dear Tej,
    I checked the transaction code as told. OMSL is not helpfull. I need to restrict the user to give the material number atleast 18 character....
    In OMS2 following description is available in MM:
    External Number Assignment Without Validation
    Use
    In the case of external number assignment, this indicator tells the system not to check the material number entered on the screen against the number range. In this case, the material number assigned must contain at least one letter, and not consist only of figures.
    If I check the system will not check the external number assigned with the number range in the system MMNR transaction code

  • Validation on serial number in goods issue

    hi all,
    i am facing one problem in MB1A transaction code for goods issue,
    in this transaction you will enter the plant details and costcenter.
    before saving the data you are giving material number and quantity ok,
    after that one window will come for the updation of serial number ok,
    i need the validation on the serial number field.
    like it has to check the asset master serial number.
    both the things are equal means posting should happen other wise it has to through the error.
    like this i want.
    any body pls sujest me whether i have to go for badi or any other exit.
    pls sujesting as early as possible.
    thanks and regards,
    sai

    Hi,
             You can use user exits EXIT_SAPLMBMB_001.
    This exit is called in update task when saving Material document.
    Also please check these user exits available (transaction SMOD).
    MBCF0002
    MBCF0005
    MBCF0006
    MBCF0007
    MBCF0009
    MBCF0010
    MBCF0011
    MB_CF001
    <b>Reward points</b>
    Regards

  • Serialization not possible for material number (SHPCON IDOC error )

    Hello,
       Can any one shed some light on following inbound PGI IDOC (SHPCON) Error from 3PL.
    "Serialization not possible for material number XYZ"
    Message no. IO205
    Diagnosis
      The serial number profile of the material does not allow serialization for the operation you have chosen.
    Procedure
    Maintain the serial number profile.
    Additional info
    1) Serial number profile is maintained in the material master
    2) Serial number populated in the idoc E1EDL11 is not used in any delivery or assigned  and it is valid serial number  and has equipment master record
    3) If i use the same serial number from the IDOC and post PGI manually via VL02N , I am able to post the PGI without any problems and I don;t get the above error
    4) IDOC has all the info required , Delivery number,Valid material # , qty,UOM and Line item number of the delivery .
    Thanks in advance for your help
    GJ

    Dear Jalwadi
    I got exact same problem. How did you solve it?

  • MC.9 - Material Number appears for period 06/2007 but not 07/2007

    Hi Experts,
    Have you encountered the situation whereby in MC.9(S039), the data of a certain Material Number appears for period 06/2007 but not 07/2007
    This material# has no stock & movements for 07/2007, but for another material# with the same conditions, there is no problem.
    Thanks & Regards
    Lawrence

    Hello Experts,
    i´m having the same issue at my system.
    Does anyone know why for a certain material report MC.9 shows balance at some Store Location although it doesn´t have any movements, while for other Store Location it isn´t showed any line, not even with zero values.
    I hope somebody can answer this issue.
    Thank you very much in advance.
    Regards,
    cecil

  • Check same material number is entered in the va02 for bulk_sales_order

    hi
    i am calling the transaction 'VA02' by passing the bulk_sales_order number which is already created containing the record, after that if i try to create the new item for same material can allow, but if i try to create for different material i need to display error like
    'invalid material number enter the same material number'. and before that i need to check sales order type is bluk_sales_order "XLB' used in my project...
    thanks with regards
    swamy
    Moderator Message : Duplicate post locked. Continue with [Need to validate the material number in the VA02|Re: Need to validate the material number in the VA02].
    Edited by: Vinod Kumar on May 19, 2011 10:25 AM

    VKOA error was there

  • While create inbound delviery Material number is not showing

    Hi All,
    I am trying to create inbound delivery with reference to Purchase Order.
    While using BBP_INB_DELIVERY_CREATE to create inbound deliveries, the material number is not showing up in the VL33N screen but Material Description is coming.
    As you have also faced same problem,can you please suggest how to resolve this issue?Your help will be highly appreciated.
    Thanks
    Santhu
    Edited by: santosh jajur on Sep 24, 2010 12:48 PM

    Hi,
    This function module doesn't pass Material number while creating the inbound delivery.  Instead you can use the function module GN_DELIVERY_CREATE along with NUMBER_GET_NEXT function module.
    See line number 631 to 656 of include LBBP_SIC_40F02 (Called from Line no 18 of BBP_INB_DELIVERY_CREATE) for more details.
    While using the function module BBP_INB_DELIVERY_CREATE, material number is not passed to the function module (GN_DELIVERY_CREATE) structure field XKOMDLGN-MATNR.
    Regards
    Vinod

  • BBP_INB_DELIVERY_CREATE-material number is not showing up in the VL33N

    Hi All,
    I am trying to create inbound delivery with reference to Purchase Order.
    While using BBP_INB_DELIVERY_CREATE to create inbound deliveries, the material number is not showing up in the VL33N screen but Material Description is coming.
    As you have also faced same problem,can you please suggest how to resolve this issue?Your help will be highly appreciated.
    Thanks
    Priyanka

    Hi,
    This function module doesn't pass Material number while creating the inbound delivery.  Instead you can use the function module GN_DELIVERY_CREATE along with NUMBER_GET_NEXT function module.
    See line number 631 to 656 of include LBBP_SIC_40F02 (Called from Line no 18 of BBP_INB_DELIVERY_CREATE) for more details.
    While using the function module BBP_INB_DELIVERY_CREATE, material number is not passed to the function module (GN_DELIVERY_CREATE) structure field XKOMDLGN-MATNR.
    Regards
    Vinod

  • Material number is blank in FBL3N for doc type SA

    Hi,
    If posting is coming from SD or MM module, the material number is reflected in FBL3N for GL acct "Material price variance".  But when the posting is coming from FI, the material field is blank. 
    But in another company code, when  postings are from FI, the material field is correctly populated.  
    I have already checked and verified that BSEG-MATNR was defined as a special field.  I have also ran RFPOSXEXTEND and BALVBUFDEL but the material field from FI posting is still blank.
    The FI posting involves filling up the material or product number in the profitability segment amongst other fields and then system will do a derivation.
    Can someone point me to the right direction on how to get the material field populated by an FI posting?
    Thanks and regards,
    Thess

    Hi,
    The material field should appear in FBL3N for all types of postings, provided it got populated.  Can you please check, whether material field  is getting populated in BSEG table for that document # ?  If the material is not getting derived, then it won't appear in the report.
    Best Regards,
    Madhu

Maybe you are looking for