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

Material Reservation BAPI

I'm trying to use the Bapi: BAPI_RESERVATION_CREATE1, but I'm getting the following error:

error '80004004' Operation aborted

When I use SE37 and fill the RESERVATIONHEADER and RESERVATIONITEMS data I can run the Bapi, but when I fill the same data using an ASP page it doesn't work... I get an error when I call the Bapi.

The ASP code follows bellow;

  Set oBAPI  = CreateObject("SAP.MaterialReservation.1")


  OBapi.DimAs "BapiCreateFromData1", "RESERVATIONHEADER", oResHeader
  oResHeader.Fields("RES_DATE").Value		= Now
  oResHeader.Fields("MOVE_TYPE").Value		= "001"
  oResHeader.Fields("COSTCENTER").Value		= "00001"
  OBapi.DimAs "BapiCreateFromData1", "RESERVATIONITEMS", oResItem
  oResItem.Fields("MATERIAL").Value     	= "XXXXXXXXX"
  oResItem.Fields("PLANT").Value     		= "XXXX"
  oResItem.Fields("ENTRY_QNT").Value		= 10
  oResItem.Fields("REQ_DATE").Value     	= Now
  ' Result
  OBapi.DimAs "BapiCreateFromData1", "RETURN", oReturn
  ' bapi Call
  oBAPI.BapiCreateFromData1 oResHeader, oResItem, , , oReturn

Does anybody know what might be the problem?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Feb 21, 2005 at 06:45 PM

    Hi Leonardo,

    perhaps you just shortened display, maybe it's a problem:

    oResItem.Fields("MATERIAL").Value     	= "XXXXXXXXX"

    Material number has 18 chars in database. When you enter value via SE37, there is an automatic conversion between display format (without leading zeros) and internal format -> test will work.

    If you enter external format via ASP-call, you will not find an article -> use 18 chars.

    Have a look at function module 'CONVERSION_EXIT_ALPHA_INPUT' for translation rules (make some tests...).



    Add a comment
    10|10000 characters needed characters exceeded

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.