Skip to Content
author's profile photo Former Member
Former Member

BAPI for material creation which returns the new material number

Hi,

I need a single BAPI or a remote enabled function module to create a material which would return the new Material number generated.

Regards,

Tanveer S.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 10:12 AM

    Not sure, but BAPI_MATERIAL_SAVEDATA: Used to create/Change a material data, may be useful.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 10:59 AM

    Hello Tanveer,

    U could use this BAPI <b>BAPI_MATERIAL_SAVEDATA</b>

    Please the RETURN PARAMETER & Message table from BAPI.

    It will have the MATNR which is created.

    If useful reward.

    Vasanth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 13, 2008 at 02:36 PM

    Hi

    if this scenario should occur:

    run BAPI_MATERIAL_GETINTNUMBER and get next material number

    run BAPI_MATERIAL_SAVEDATA and get an error when creating.

    Is there a way to rollback the internal number range?!

    ROLLBACK WORK doesn't seem to work and, if the BI_SAVEDATA returns with the error, the next try will have the material number X+1, although X was never used.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      unfortunally this is just the way SAP works with number ranges ALLWAYS. First get a new number than try booking. If any error occurs ROLLBACK WORK but never reset number ranges. So this behaviour is common at most applications.

      If this bothers you too much - at material master you may use EXIT_SAPLMG02_001 and/or EXIT_SAPLMG02_002.

      kind regards,

      HP

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.