Skip to Content
Technical Articles
Author's profile photo Raj Sinha

BAPI Simulation & Finding BAPI

Introduction:

In this blog post, you will learn how to Find BAPI & Simulate BAPI. Like many of the time, we need to create or upload data in mass. And for that, we use LSMW or BDC to upload entries to system. But in some case, we need BAPI to upload data.

Simulated BAPI help`s technical person (ABAP) to code it in less time. And as Functional we must have an idea of how to find BAPI & simulate BAPI. For that, I have shared the easiest way how to work out along with the screenshot.

Overview:

First of all, you need to know which BAPI will full fill your requirement. In this blog post, I have simulated BAPI for Production Order Creation (CO01).

To find a BAPI use Tcode: BAPI (BAPI Explorer)

For Prod. Order Creation we have BAPI_PRODORD_CREATE

Now, to simulate BAPI you can double click on BAPI_PRODORD_CREATE and then press F8.

 

Or open Tcode: SE37 (Functional Builder: Initial Screen)

Copy the BAPI under Functional Module & Press function F8 or

After executing you`ll get the screen Test Functional Module: Initial Screen.

You can take the help of Documentation provided for BAPI by SAP. In some of cases, you won`t get documentation for BAPI due to non-availability of the document in language EN.

 

Note: Documentation helps you in simulating BAPI with correct and required data to input.

Under Import Parameter; Double Click on ORDERDATA.

Click on    Single Entry (Shift+F7).

Fill the below entries;

  • MATERIAL: (Material Code)
  • PLANT: (Plant)
  • ORDER_TYPE: (Order type)
  • BASIC_START_DATE: (Order Start Date)
  • BASIC_END_DATE: (Order End Date)
  • QUANTITY: (Order Quantity)
  • PROD_VERSION: (Production Version)

Note: Basic Start Date & Basic End Date is to be filled according to the scheduling type you are using.

i.e. if scheduling type is;

  • Backwards then fill only Basic_End_Date.
  • Forwards then fill only Basic_Start_Date.
  • Only Capacity requirement then fill both Start & End Date.
  • Current Date then leave date as blank

You can also use the other parameter like SCRAP_QUANTITY, ORDER_PRIORITY, etc.

After filling these entries come back to the main screen or press Function-F3(Back).

Now execute the BAPI you will get an Order Number under Export parameters.

In my test run, I got an ORDER_NUMBER: 1***401

If any of the ORDERDATA entries is wrong then the system will return error under RETURN Parameters.

As for the error message, I have made wrong entries in field PROD_VERSION. Below is the screenshot for the same.

RETURN: E61 567Version PV11 does not exist for material SFGPRFGRM101T in plant 1010.

After filling correct entries to BAPI execute it and save the test case for your technical person (ABAPER).

Also, you can cross-check the generated production order number in COOIS or CO03.

Click on Save & give a name to it !!

NOTE: “This BAPI performs Implicit Update task i.e. On the generation of ORDER_NUMBER under Export Parameter this BAPI update the entries into the database. Also, In some cases, we need to perform the update task explicitly. Will be sharing the same with some other BAPI”.

————————————————————————————————————————————-

Thanks for going through the detailed document. Do revert back if you have more queries or feedbacks/ inputs so that I can update the document.

For any help on BAPI`s & FM related to PP, QM & MM leave a comment.

Best Regards,

Raj Sinha.

Assigned Tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sandra Rossi
      Sandra Rossi

      I'm not sure what you mean by using the words Simulate and Test, but it may mislead people who could think it means that the database tables won't be updated.

      If those BAPIs do the updates only via an update task, then yes the updates will not be performed (except things like number ranges) because they are only triggered if BAPI_TRANSACTION_COMMIT is executed after executing the BAPI. It could be useful then to explain how to create a "call sequence" in SE37 (or to link to existing articles).

      But if those BAPIs do the updates without an update task, then the updates are definitely committed to the database (the BAPI you are testing is an example).

      Another thing is that some released "BAPI" function modules are not shown in the transaction BAPI because the concept of BAPI is larger than just the function modules, they can be related to a business object type (transaction code SWO1).

       

      Author's profile photo Michelle Crapo
      Michelle Crapo

      Totally agree with you.  Call sequence - this is a nice WIKI.

      So much other fun things you have to know about them too.  Wrapping code around the BAPI can be a nice option or a needed option for an RFC.

      Author's profile photo Raj Sinha
      Raj Sinha
      Blog Post Author

      Hello Sandra,

      My purpose for sharing this blog was to share how the BAPI gets simulated so I mentioned the word Simulation.

      And I do know some of the BAPI's commit the data into respective tables.

      Thanks for your mentioning about the implicit update functionality of the BAPI. I'll update my document with a Note in it with the same.

      Best Regards,

      Raj Sinha

       

      Author's profile photo Michelle Crapo
      Michelle Crapo

      Nice addition.  Step by step is always appreciated.

      I also look for BAPIs - by going to SE80, function module BAPI*ORDER* or something similar.  Another great search is look at your SAP package on your original program.   Then display that package and look at the BAPIs.  (Also you can find function modules, that sometimes you can use.)

      Ask 10 different developers, and you'll get 10 different answers.  My point is for the search - if I don't find it one way I look for it a different way.

      BTW - most developers can find the BAPI/Function module.  Usually you don't have to specify it.  😉

       

      Author's profile photo Raj Sinha
      Raj Sinha
      Blog Post Author

      Hello Michelle,

      I was actually preparing a few documents for my own reference and thought of sharing one of them with as many details as possible.

      Please notify if any additions/ changes necessary.

      It’s a privilege to have advice/feedback from experts like you. ?

      Best Regards,

      Raj Sinha

      Author's profile photo Michelle Crapo
      Michelle Crapo

      None needed for your documentation or the Blog.   BTW - sharing your documentation is an excellent reason to blog.  I just did a search, and there is a lot out there.  Trying to get everything in one place is hard.  This will be nice for people who haven't found the BAPI transaction - and the how to is so nice when you are learning.

      Just letting you know sometimes it's just easier for me to find a BAPI in a different way.  I'll add mine and perhaps many others will as well.  Sometimes the comments are an excellent way for people to learn.  And trying to do a "quick" google search - I decided just to make my own screen shots.

      The link for working with packages is in the above link I added.  I had completely forgotten about that.

      So if I wanted to find a BAPI for updating purchase records - one of the ways:

      The quickest I use and then with the PO Detail I'll decide to put more into it to search:

      SE80->function module

      Look at the program package:  (Before this technical detail - program)

      So I have the package ME, I open it in SE80, and search for BAPI - that's one way to do it.

       

       

      Author's profile photo Raj Sinha
      Raj Sinha
      Blog Post Author

      Thanks, Michelle for sharing the valuable information to this post. 🙂

      Best Regards

      Raj Sinha

      Author's profile photo Prabhat Tiwari
      Prabhat Tiwari

      Thanks,

      Raj Sinha for sharing your precious information.

       

      Regards,

      Prabhat Tiwari

      Author's profile photo Raj Sinha
      Raj Sinha
      Blog Post Author

      Really Appreciated.

      Best Regards,

      Raj Sinha