Today I want to teach you how to create a BDC program using SHDB, this recording tool will be useful for you if you want to create an upload program from a flat file into SAP tables.
In this tutorial, I want to record a transaction from QS21, it’s transaction to create MIC (Master inspection Characteristic) in QM module.
To start creating a BDC just follow these steps below.
1. Execute TCODE SHDB. Click On “New Recording”.
2. Now just name the recording as ZR_QS21, the tcode name is QS21 to create Master inspection Characteristic, of course you can enter any other tcode that you want to record, after that click on the “Start Recording” button.
3. Now you will be entering the recording mode to record transaction Qs21, as you can see on the picture below, you will be taken into this specified tcode.
4. Now just create the MIC as usual, because this is not a tutorial on how to create an MIC, then I will skip the creation process. After you’ve done creating the MIC, you will see this screen below.
BDC is a collection of screens to process the transaction, as you can see there are several screens used to create the MIC. Just double click on the each screen name to see the screen layout.
5. Don’t forget to click on the “SAVE” button to save the BDC.
6. Now to use the BDC in ABAP, we need to transfer this BDC into an ABAP Program.
7. Execute tcode SHDB again, and locate the BDC we’ve just created. ZR_QS21 and click on the “Program” icon on the tool bar.
8. Now enter the ABAP program name for this BDC, and then choose “Transfer from recording” from the Field Contents block. Click OK or enter to continue.
9. Type in the program title name and click on the “Source Code” button and press enter.
10. Now you can see the BDC code has been successfully transferred into you ABAP program.
Usually you will need to modify the program by adding a code to get the flat file and then convert it into an internal table and then you pass the internal table data using this BDC program code that will save it into SAP tables.