BDC – Batch Data Communication in SAP ABAP

BDC Program is used to upload data from flat file to SAP System

BDC

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:

 

  1. Execute XK01 provide the Vendor no G_USA.
  2. Account Group ‘004’ and press enter
  3. Provide the name let say SKUMARTECH search term SKTECH Country USA

Steps to develop the BDC Program:

  1. Analyse the transaction code: – Analysis of screen and field information.
  2. Prepare the file: Extract the data from NON-SAP to file.
  3. Upload the data from file to BDC program or Internal table.
  4. For each record in the internal table collect the screen and field details to automate the transaction.
  5. For each record in the internal table call the transaction.

Steps in Details:

  1. 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:

 

    1. Go to SHDB Transaction code – Click on new recording in application tool bar.
    2. Provide the recording name as ZSA_TEST
    3. Provide the Transaction code XK01.
    4. Press enter.
    5. 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.

 

  1. Prepare the file:

Usually functional people or business will provide you the file with sample data to test the BDC program in Development server.

 

  1. 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.

BDC

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:

      1. Program – Program name
      2. Dynpro  –  Screen Number
      3. Dynbegin – Starting Screen
      4. FNAM – Field Name
      5. 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

      1. Call Transaction Method
      2. 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

Scroll to Top