Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member200338
Active Contributor


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.

INCLUDE FBGENMAC.

SET EXTENDED CHECK OFF.

fbgenmac '<<YOUR_FM_NAME>>'.

SET EXTENDED CHECK ON.

 

 

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.

 

 

References:

 

How to Create a Test data to BAPI_PO_CREATE(1) and BAPI_PO_CHANGE - Supplier Relationship Management...

517767 - Generate test data for function modules

539978 - Automatic generation of BAPI test data directory

1 Comment