BDC Program is used to upload data from flat file to SAP System
BDC program is used to automate the existing transaction code. Each transaction can create only one record at a time. If we want to create the thousands of records, one way is to execute the same transaction thousands of times. Another way is to automate the existing transactions code by developing BDC program.
List of Some Transactions codes frequently used in SAP.
MM01 |
Create Material |
ME51N |
Create Purchase Requisition |
ME21 |
Create Purchase Order |
MB01 |
Create Material Document |
VA01 |
Create Sales Order |
VL01 |
Create Delivery |
VF01 |
Create Billing |
FB01 |
Create Accounting Documents |
FI01 |
Create Bank |
KS01 |
Create Cost Center |
KE51 |
Create Profit Center |
Steps to create vendor:
- Execute XK01 provide the Vendor no G_USA.
- Account Group ‘004’ and press enter
- Provide the name let say SKUMARTECH search term SKTECH Country USA
Steps to develop the BDC Program:
- Analyse the transaction code: – Analysis of screen and field information.
- Prepare the file: Extract the data from NON-SAP to file.
- Upload the data from file to BDC program or Internal table.
- For each record in the internal table collect the screen and field details to automate the transaction.
- For each record in the internal table call the transaction.
Steps in Details:
- Analyse the screen and field information is to identify the technical information of each screen and filed. If we want to identify the technical information, then execute the transaction code. Place the cursor on input field click on F1, Click on Technical information identifying the technical details.
It is very difficult to identify the technical information of entire transaction code. So to simplify this we will go for SHDB Transaction code.
SHDB: is the transaction code to collect the technical information for whole transaction or it records each field.
Steps to do recording:
-
- Go to SHDB Transaction code – Click on new recording in application tool bar.
- Provide the recording name as ZSA_TEST
- Provide the Transaction code XK01.
- Press enter.
- Provide the value on each field which you want to record and click on save.
Whenever user click on save button then the recording is stop. BDC_CODE is the last entry for any screen.
- Prepare the file:
Usually functional people or business will provide you the file with sample data to test the BDC program in Development server.
- Upload the data from file to BDC program or Internal Table: ALSM_EXCEL_TO_INTERNAL_TABLE or any other function module as per requirements.
Sample code to upload file.
4. For each record in the internal table, collect the screen and field details to automate the transaction.
Collect the screen and field details is nothing but fill in internal table which contains the following fields:
-
-
- Program – Program name
- Dynpro – Screen Number
- Dynbegin – Starting Screen
- FNAM – Field Name
- FVAL – Field Value
-
In Data Dictionary we have one structure i.e. BDCDATA which contains the above fields so we simply declare our internal table by referring BDC Data Structure.
5. For Each record in the Internal Table Call the Transaction
-
-
- Call Transaction Method
- Session Method
-
Syntax for Call Transaction Method:
Call Transaction <XK01> using <BDCDATA> Internal Table Mode A/N/E
A – All Screen
N – No Screen
E – Error Screen