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

FM

Former Member
0 Likes
683

Is there any FM to check for material no's validation?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
652

Hi,

What kind of validation do you need?

If you need to find out if material exists in database, then you can use MARA_SINGLE_READ function.

Regards,

Himanshu

4 REPLIES 4
Read only

Former Member
0 Likes
652

hiiii

use following code that will solve your problem.It will give you error message also.

CALL FUNCTION 'BAPI_MATERIAL_EXISTENCECHECK'
      EXPORTING
        material            = w_matnr
*   MATERIAL_EVG        = MATERIAL_EVG
     IMPORTING
*   DELETION_FLAG       = DELETION_FLAG
       return              = w_return.

  IF w_return-type CA 'EA'.
    ROLLBACK WORK.
    MESSAGE ID '26' TYPE 'E' NUMBER '000'
            WITH w_return-message.
    WRITE:
           / 'Invalid Material' COLOR 5.

  ELSE.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
*     EXPORTING
*       WAIT          = w_WAIT
*     IMPORTING
*       RETURN        = RETURN.
   .
    SKIP.
    WRITE:
           / 'Valid Material' COLOR 4,
           / 'Material Number:', w_matnr.

<removed_by_moderator>

thx

twinkal

Edited by: Julius Bussche on Jun 24, 2008 7:00 PM

Read only

Former Member
0 Likes
653

Hi,

What kind of validation do you need?

If you need to find out if material exists in database, then you can use MARA_SINGLE_READ function.

Regards,

Himanshu

Read only

Former Member
0 Likes
652

Hi ,

Check out the Function module


PRICAT_MATERIAL_NUMBER_CHECK

&************<removed_by_moderator>*****************&

Edited by: Julius Bussche on Jun 24, 2008 6:58 PM

Read only

JanStallkamp
Advisor
Advisor
0 Likes
652

Hi.

Please use a proper subject for your postings. According to our rules of engagement I will lock this thread.

Best regards,

Jan Stallkamp