Automatically Fill Test Data in FM & BAPIs for SE37 – The Lazy Way

6
198
Lazy Programmers

We often come across many issues with the upload programs that we develop to facilitate mass upload. The most boring work that I feel is when I have to replicate the runtime data in SE37 BAPI fields to troubleshoot the issue. So here is a tip to avoid this manual work. J

Bill Gates loves Lazy Developers, as they always tend to find an Automatic, Quick and Easy way to get things done. This trick is from that one Lazy but Smart ABAPer. J

In this article, we will be learning a small but helpful trick of filling the BAPI fields while we debug the program.

Following are the steps that need to be followed:

  1. Set a break-point on Call Function Statement
  2. Execute the upload program
  3. Press F5
  4. Press Services Of The Tool button
  5. Press Save Parameters as Test Data
  6. Give test data name

Let us try with a simple example. We are having a material upload program using BAPI_MATERIAL_SAVEDATA. We have set the break-point and executed the transaction.

SE37 Test Data

Press F5 and click on Services of the Tool.

BAPI_MATERIAL_SAVEDATA

Also Read: Lazy and Smart ABAPers

Click on Save Parameters as Test Data (SE37) option.

ABAP Tricks

Give a name to the test data variant and click on continue button.

Tips and Tricks for SAP

Now let us check in SE37. Enter BAPI name and execute.

Lazy Developers

Open Test data directory.

Difference between BAPI and RFC

Select the variant created by us previously and see the tables filled with the values from upload program. J

BAPI test data

Bingo. I am sure, it is new for many of us. Such tricks and tips are the forte of SAPYard.com. Hope you liked this interesting revelation. The next time, you need to test a standalone FM/BAPI in SE37, you know how to populate the data automatically.

Do not forget to provide your feedback and leave comments for Prapti (the Author). She personally replies to each and every queries and doubt.

Do you have any tips, tricks, tutorial, concept, config, business case or anything related to SAP to share? Write articles at SAPYard and EARN up to 500 INR per article? Please contact us at mail@sapyard.com to know more.

If you GENUINELY like our articles then it would be a HUGE help if you shared, subscribed and liked us on facebook. It might seem insignificant, but it helps more than you might think.

Also, check our popular step by step tutorials on some of the important topics of SAP ABAP.

1. ABAP for SAP HANA Tutorials
2. ABAP Web Dynpro Tutorials
3. GOS Tutorial
4. OOPs ABAP Tutorial
5. HANA Tutorial
6. SAP Netweaver and OData Tutorial
7. SAP Adobe Form Tutorial
8. SAP Fiori Tutorial
9. SAPUI5 Tutorial
10. SAP Screen Personas Tutorials
11. SAP Workflow

6 COMMENTS

  1. How do I do this with a RFC FM that is being called directly from PI etc.? As of now, to prepare test data repository I have to load it manually from the PI to ECC XML file.

    • Hi Arnab,

      Thanks for reading.. In case of RFC call from PI or any external party, you can set a user breakpoint of the user ID used by external system to access the SAP system and then follow the same steps 🙂

      Regards,
      Prapti

LEAVE A REPLY

Please enter your comment!
Please enter your name here