BDC


What is ‘BDC'?

The SAP system offers two primary methods (SESSION METHOD, CALL TRANSACTION METHOD) for transferring data from other Non-SAP systems to SAP system. These two methods are collectively called as 'BATCH INPUT' or 'Batch Data Communication' (BDC).

What do you mean by BDC (Batch Data Communications) programming?
Define BDC programming?
What is BDC programming?
Elaborate Batch Data Communication programming?

BDC programming is an automatic procedure for transferring large or external data into SAP system. 'Queue file' is the central component of the transfer, that receives the data through batch input programs and groups them to associate into 'sessions'

What is the BDC technique in ABAP programming?
Which BDC technique you prefer?

If we want to transfer large amount of data and when we need to use more than one transaction code, we prefer session method. For small or less amount of data and for single transaction, use call transaction.

What are the advantages in Batch Input?

Below are the major advantages of batch input -

  • Ensures Data integrity.
  • No manual interaction is required during Data transfer.

What are the steps in a BDC session?

There are mainly three steps in BDC session processing. Those are -

  • Identify the screens of the transaction that the program is going to process.
  • Write a program to build the BDC table that uses to submit the data to SAP.
  • Submit the BDC table to the system in the batch mode or as a single transaction by the CALL TRANSACTION command.

How to write a BDC - How do you go about it?

Steps for writing BDC -

  • /nSE38
  • Declare Tables, Data (for ITAB) and Data (for BDCITAB)
  • Call function ‘Upload’.
  • Write code for the First Screen, Radio Button, Filename, Change Button, Second Screen, Utilities (Create Entries), Third Screen and Save.
  • Call transaction ‘SE11’ using BDCITAB mode 'A'.
  • Save, Check Errors, Activate and Execute.

What are the types of BDC’s?
Do you know about the different types of BDC’s?

There are two types of BDC’s -

  1. Transaction Method
  2. Session Method

Advantages and Disadvantages of different types of BDC’s?

Transaction Method -

  • It is faster than session method.
  • While executing, it starts from starting.

Session Method -

  • It is slower than transaction method.
  • While executing, it does not start from starting.

Mention the different modules used in BDC?
What are the functional modules used in sequence in BDC?

These are the 3 functional modules that are used in a sequence to perform a data transfer successfully using BDC programming -

  • BDC_OPEN_GROUP - Parameters like Name of the client, sessions and username are specified in these functional modules.
  • BDC_INSERT - It is used to insert the data for one transaction into a session.
  • BDC_CLOSE_GROUP - This is used to close the batch input session.

What should be the approach for writing a BDC program?

Below are the steps to writing a BDC program -

  • Analyze the Data from the local file.
  • Analyze transaction.
  • Generate SAP structure like local file and BDCDATA.
  • Develop transfer program for transferring data from local file to internal table.
  • Create a sequential file.
  • Write a batch input program.
  • Process batch input data BDCDATA using call transaction/session method.

What is the alternative to batch input session?

Call transaction Method and Call dialog, Direct Input Method are alternatives to Batch Input session.

What do you do when the system crashes in the middle of a BDC batch session?

Check number of records already updated and delete them from input file and run BDC again.

What do you do with errors in BDC batch session?

Analyze, correct input file format and entries in internal table BDCDATA.

How can you handle errors in the BDC batch sessions?

First, we need to investigate the list of the incorrect sessions to do the processing new. Now, to correct the faulty session, we need to spot which value and which screen are causing the error. Minor or small errors may solve away in an interactive way; however, in the order resolve major errors, one may require modifying the batch input program. In those cases, it is required to modify the data file to set things right.

What is the structure of the BDC table?
Write the BDC table structure?

The BDCDATA table structure consists of the following fields -

FIELD TYPE LENGTH DESCRIPTION
PROGRAM CHAR 40 Online program name of transaction
DYNPRO NUMC 4 Screen number of transactions
DYNBEGIN CHAR 1 Indicator to specify the start of a new screen
FNAM CHAR 132 Field names of a screen to be filled with data
FVAL CHAR 132 Actual value to be filled into the specified screen field

How do you find the transaction number, program number and field names?

Go to SE38, then choose the menu path like shown below -
Transaction number, program number – System -> status
Field names - F1 Technical help

What are the processing modes for Batch Input?

The three modes for processing batch input session are -

  • Background
  • Display Errors Only
  • Foreground

What are the available OK Codes that can be utilized during batch input processing?

/n – Terminates current batch input transaction and marks as incorrect.
/bdel – Delete current batch input transaction from session.
/bend – Terminate batch input processing and mark session as incorrect.
/bda – Change display mode to process the session on screen instead of displaying only errors.
/bde – Change display mode to display only errors instead of processing the session on the screen.

What is the effect of the BDC_CURSOR field name in the BDC table?

The cursor can be positioned by setting the cursor on the field name and enter the corresponding field value.

Why you choose Call transaction and/or session method?

Call transaction is used to update the database using a single transaction in asynchronous mode. Call transaction used to update the data that is relatively small. If the call transaction used to update the large amount of data, there might be a problem of getting TIME_OUT.

The session method is used to perform huge database updates using more than one transaction and executes for a long time. Session method used to update the data that is relatively huge.

How you trap errors in call Transaction?

The errors occurred during the database updation using call transaction are trapped using a structure bdcmsgcall. If the error occurred in the above process, structure bdcmsgcall field msgtyp becomes ‘e’.

The error records are formatted calling format_message function to convert them into the desired format and stored in an internal table for listing all the error in the single shot.

What are different types of update modes?

BDC have two types of updating modes –

  • Synchronous
  • Asynchronous

What is main difference between session method and LSMW?

In the context of session method, the updating method is “Batch Input”. We required to code a program to complete the operation.

In the context of LSMW method, the updating methods is “Batch Input/Direction Input” from an IDOC, BAPI structure. No source code is required, the complete operation is performed in 16 steps.

Differences between LSMW and BDC?

  • LSMW is for standard sap application. BDC is for customized applications.
  • Mapping is taken care by SAP in LSMW whereas we need to specify the mapping explicitly in BDC.
  • LSMW offers different techniques like Direct input, Batch input recording, BAPI, IDOC for migrating data. BDC uses recording and have two methods to implement - Call Transaction Method, Session Method.
  • LSMW is a Non-SAP to SAP communication tool, while BDC is an SAP to SAP communication utility.
  • LSMW used by Functional consultants. BDC is used by technical consultants.
  • In LSMW, coding is not flexible. BDC coding is flexible for customize applications.
  • In LSMW, recording performed through LSMW only. However, in BDC recording performed through transaction SHDB.
  • LSMW is preferable method as it uses the standard programs for data upload. In BDC if screen design changes tomorrow, program will not work and need to do the recording again to make it work.
  • LSMW is recommended for large amount of data.

What is main difference between CATT and LSMW?

LSMW is legacy system migration work bench is basically used for migrating data from legacy system to SAP system.

CATT allows a developer to create test data, group and automate reusable test runs for repetitive business transactions.

When you prefer LSMW in SAP?
Which BDC you prefer for data migration?

To update medium amount of data, we use LSMW. LSMW is also used by the person like functional consultant who has less programming requirement.

How do you do BDC for a table control?

We need to use the BDC_OKCODE '=P+' while doing the BDC for table control.

It is the BCD_OKCODE for Page down that can be used for scrolling down in table control.

After running a BDC program in background, next day morning when you see the results, few records are not updated (error records). What will you do then?

We need to investigate incorrect session, analyze the error screen, reprocess the session after correcting the data.

You are given functional specs for a BDC program and you need to decide whether to write a method call transaction or a session. How u will decide?

Based on the amount of data (number of records to update), we can decide what method to use. For example - If data is less the 5000, we can use call transaction. If data is more than 5000 records, we can use session method.

What is the last entry in all BDC tables?

In all BDC tables, the field name BDC_OKCODE and a field value of ‘/11’ is the last entry used to save BDC table.

What is the transaction for Recording BDC?

Transaction Code for recording is SHDB.

What are the different modes of processing batch input sessions?

The three modes for processing batch input session -

  • Foreground
  • Display Errors Only
  • Background

What are the problems in processing batch input sessions? How is batch input process different from processing online?

The below are two major drawbacks of processing batch input sessions -

  • Sessions cannot run in parallel.
  • The processing is slow.

How do you save data in BDC tables?

The data in BDC tables is saved by using the field name ‘BDC_OKCODE’ and field value of ‘/11’.

Does the CALL TRANSACTION method allow multiple transactions to be processed by SAP?

No. The CALL TRANSACTION method process only single transaction.

Does the BDC_INSERT function allow multiple transactions to be processed by SAP?

Yes.

What is the syntax for ‘CALL TRANSACTION'?

CALL TRANSACTION trans [ using bdctab MODE mode ]. Three possible entries are there for MODE -

  • A - show all screens
  • E - show only screens with errors
  • N - show no screens

Can we use call transaction and session method in the same program? explain?
Can we write the code both call transaction and session method in single program?

Yes, we can call "call transaction" and "session method" in same program. Generally, we use call transaction for updating and session method for logging errors in the same program.

What are the different types of mode (run Code) in Call Transaction Method?

There are three modes in Call Transaction -

  • A – Displays All Screen
  • E – Display Errors
  • N – Background Processing

What is the difference between Leave Transaction and Call Transaction?

In contrast to LEAVE TRANSACTION, the CALL TRANSACTION statement causes the system to start a new SAP LUW. This second SAP LUW runs parallel to the SAP LUW for the calling transaction.

Can you set up background processing using CALL TRANSACTION?

Yes, using “No Screen Mode” in 'CALL TRANSACTION'.

Which mode of ‘CALL TRANSACTION’ method allows background processing?

N is the only mode that allows background processing in CALL TRANSACTION.

Is it possible to use ‘CALL TRANSACTION’ without a BDC table?

Yes, it is possible to use 'CALL TRANSACTION' without a BDC table. In such case, the current program is suspended, the specified transaction is brought up and user must enter the data into the screens.

What are the function modules called from BDC program to submit the transactions for processing?
Which Function Modules are used in ‘Classical Batch Input’?

These are the 3 functional modules that are used in a sequence to perform a data transfer successfully using BDC programming -

  • BDC_OPEN_GROUP - Parameters like Name of the client, sessions and username are specified in these functional modules.
  • BDC_INSERT - It is used to insert the data for one transaction into a session.
  • BDC_CLOSE_GROUP - This is used to close the batch input session.

How many sessions will be opened using BDC_OPEN_GROUP?

Only one session can be created.

What is Synchronous Database update?

No transaction is stored until the previous transaction has been written to the Database during the processing. This is called Synchronous Database update.

What are the types of Batch Input?

  • Classical Batch Input
  • Call Transaction
  • Call Dialog

What is BDC_OKCODE?

The BDC_OKCODE is a command field identified in batch input. This name is constant and always identifies the command field.

How can we execute a function in a BDC session?

We can execute a function in a transaction by entering the function code or function key number in the command field of an SAP session.

  • A function key number must be prefixed with the / (slash) character.
  • A function code must be prefixed with the = character.
Example -
BDCDATA-FNAM = 'BDC_OKCODE'
BDCDATA-FVAL = '=IC'

How can we position the cursor on a field?

BDCDATA-FNAM = ‘BDC_CURSOR’

Who are Dialog users and who are Background users?

Dialog users are normal interactive users in the SAP system. Background users handles the master records that are specially defined to provide authorizations for background processing jobs.

What is the use of BDC_INSERT?

A transaction can be added to a Batch Input Session by using this function.

What are the update modes in CALL TRANSACTION?

  • S - Synchronous
  • A - Asynchronous
  • L - Local

What does the message parameter indicate?

The message parameter specifies that all system messages issued during a CALL TRANSACTION are written into the internal table. The internal table must have the structure of BDCMSGCOLL.

What is Direct Input?

To enhance the batch input procedure, the SAP system offers the direct input technique for transferring large amount of data. This technique does not create sessions but stores the data directly. The direct input programs should be executed in the background only. To maintain and start these programs, use program RBMVSHOW or the transaction BMVO.