Skip to Content
Technical Articles
Author's profile photo Niyaz Ahamed

Creating test data directory(variants in SE37) by programming

Recently there was an issue in ECC while updating records to infotypes.  Third party sends data to PI and PI in return calls ECC via a  RFC enabled FM. I was not sure whether data received by ECC was right and I had to depend on PI to get the payload and simulate it in ECC.

In this blog, I am going to explain how to create test data directory programmatically so that you dont need to depend on other middlewares for your analysis.

1. Find the RFC user which will call your FM/BAPI. Usually maintained by basis in SM59

2. Request your security team to add parameter id FBGENDAT  as X in user master (Transaction SU01)

3. Execute report FBGENDAT.

4. Enter the name of the FM/BAPI which you wish to create test data directory and execute the report. The options used are self explanatory and is available in report. Option C is meant to debug using process(Transaction SM50)

5. In your FM/BAPI, write below lines of code. Certain SAP Standard FM/BAPI already have below code in them. Example BAPI_PO_CHANGE.



fbgenmac ‘<<YOUR_FM_NAME>>’.




Request your thirdparty or middle ware to send data to SAP.


1. Goto SE37, enter the FM/BAPI and press execute.

2. Click on test data directory button on the tool bar


You will observe that new enty will be present with date, time and user. You can use this to analyse your FM/BAPI.



Once your are done with your analysis, you can execute report FBGENDAT and delete the required entries. This will deactivate creation of test data directories for future requests.





How to Create a Test data to BAPI_PO_CREATE(1) and BAPI_PO_CHANGE – Supplier Relationship Management – SCN Wiki

517767 – Generate test data for function modules

539978 – Automatic generation of BAPI test data directory

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Joachim Rees
      Joachim Rees

      Thanks for making me aware of report FBGENDAT - might be usefull some day!