You are on page 1of 9

What is BDC?

Ans:- Batch Data Communication or BDC is a batch interfacing technique that SAP developed.  It is
mainly used for uploading data into the SAP R/3 system.   BDC works by simulating the user input from
transactional screen via an ABAP program.(or)

It is used to transfer Non-Sap data (legacy system) to SAP R/3 system. The data input data file will come
in the form of a flat file which the user save as file type txt file or prn file from the Microsoft Excel
program.  An Abaper will create a program to read the text file and upload into the SAP system.
Steps to develop BDC prog:-

1.Read flat file to internal table itab


2.from internal table data is not directly transfer to SAP R/3 system, instead it as to go through a screen
fields and screens i.e it as go through a particular transaction in a particular format called BDC batch
input structure is known as BDC Data structure.which stores both data and action. and it contains five
fields 1.Program (Module pool Program)
2.dynpro(screen number)
3.Dyn begin(screen field number)
4.fname( screen Field value)
5.fvalue(batch input methods to transfer)
3.There are two batch input methods to transfer Non-sap data to sap system

2. Which BDC you prefer?


Ans. 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.(This is more genric answer but you can add more on to this if you have worked on  BDC)

3. When u prefer LSMW?


Ans. When we need to update medium amount of data we use LSMW. LSMW is also used when the person
like functional consultant has less programming language.

Whta is call transcation methos?


Ans:-It is one of the Batch Input method use to transfer non-sap to sap system
Syntax:- Call Transaction <T-CODE> using IT_BDCDATA
Update ‘A’
Mode ‘A/E/N.’
Message into IT_MSG.

A-Displays all screen,E-it displays only error screen,N-Displays no screen by default mode ‘A’

Update A(Asynchronous):-During asynchronous update a BDC program send a record to update a work
process and will not wait for acknowledgement to came from update work process instead it kepp on
sending the records to update work process wil update data to the data base.

Update S(synchronous):-During synchronous update a BDC program sends a record to the update work
process and will wait for the acknowledgement to come from update work process then only it sends
the next record.by default update work process Asynchronous.
Message into IT_MSG:-This option is use to capture both sucess and failure message into an
internal table it_msg of structure BDCMSGCOLL.
MSGV1, MSGV2, MSGV3, MSGV4 are the field which contain parts of the message.
The structure BDCMSGCOLL also consists of msgid and msgnr -the message id and number..
You can use the FM <b>FORMAT_MESSAGE</b> to combine all these fields together to get
the complete message

You can store the values of variable in message.


msgno55 - & & & &
 so you can pass values of MSGV1,V2,V3,V4 values and you can construct total message like
'No record found ZTABLE'.

GUI_UPLOAD:- This function module is used to upload flat file data present on front end or desktop to
internal table itab.
Exporting parameters:-File name = Flat file name
File type = 'ASC' or 'BIN'
‘ASC’->Means flat file is text file ‘BIN’->Means flat file is a Binary file

GUI_DOWNLOAD:- This function module is use to download internal data to desktop

F4_FILENAME:-This F.M will display list of files and returns the selected file. It has importing parameters

FORMAT_MESSAGE:- This F.M will collect the complete message and return it.
ALSH_EXCEL_TO_INTERNAL_TABLE:-This F>M will upload the excel file and data to an internal table.

What is session method ?


It is one of theBatch Input method use to transfer non-sap dta to sap system
In session method sessions are created as files on application server.Unless &untill you process session
data is not transfered to sap r/3 system.To Process transaction Code SM35.

What are the function modules in Session Method?


BDC_OPEN_GROUP:-This function Module is used to create session (file) on Application server and
maintained in SM35
BDC_Insert:-This F.M is used to insert the data into sessions.
BDC_CLOSE_GROUP:-This F>M is close the session.

What is Recording?
Ans:-It is capture or record the sequence of steps for particular transcation based on which a system
create BDC Program
Tcode for recording -- SHDB.

How to process Session?


Tcode-SM35
->click on new tab button select session
->click on process Push button from application toolbar
->select Process/fore ground.
->click on process button

What is sequential files (or) Data sets?


The files Present on Application server are called as Sequential Files.

What is the difference between Call transaction and session method?


Ans: Call Transaction Session Method

1.It is used to upload small amount of data 1.It is used to upload very large amount of data
b because can be put in background with the help of
R RSBDCSUC

What is the difference between Call Transaction Method and the Session method ?

Session Method Call Transaction


Session method id generally used when the data Call transaction method is when the data volume
volume is huge. is   low
Session method is slow as compared to Call Call Transaction method is relatively faster than
transaction. Session method.
SAP Database is updated when you process the SAP Database is updated during the execution of
sessions. You need to process the sessions the batch input program.
separately via SM35.
Errors are automatically handled during the Errors should be handled in the batch input
processing of the batch input session. program.

 How do you do BDC for a table control?


With other things as usual, there is a special trick that you have to use while doing BDC for table control.
You need to use the BDC OKCODE '=P+'.
Its the BCD_OKCODE for Page down that can be used for scrolling down in table control.

 Is there any method apart from BDC for data upload to SAP?
Apart from BDC and LSMW, you can use BAPIs to upload data into SAP.
BAPIs should be preferred over BDCs, because they process data faster than BDC.
A BAPI is faster since it updates Database "directly". Whereas BDC calls transaction and goes through
the whole screen sequence as any user would do.
BAPI BDC
BAPI is faster than BDC. BDC is relatively slower than BAPI.
BAPI directly updates database. BDC goes through all the screens as a normal
user would do and hence it is slower.
No such processing options are available in BAPI. Background and Foreground processing options
are available for BDC.
BAPI would generally used for small data BDCs would be preferred for large volumes of
uploads. data upload since background processing option
is available.
For processing errors, the Return Parameters for Errors can be processed in SM35 for session
BAPI should be used.This parameter returns method and in the batch input program for Call
exception messages or success messages to the Transaction method.
calling program.

 How do you process errors in Call Transaction method ?


Ans:-Let's have a look at the syntax for CALL TRANSACTION method.
Sample code:
DATA: BEGIN OF G_T_MESSTAB OCCURS 0.
INCLUDE STRUCTURE BDCMSGCOLL.
DATA: END OF G_T_MESSTAB.

CALL TRANSACTION 'MB11'


    USING G_T_BDCDATA
          MODE 'E'
          UPDATE 'S'
          MESSAGES INTO G_T_MESSTAB.

All the error messages will be trapped inside G_T_MESSTAB.

What is the use of program RSBDCSUB?


There are two ways to process the BDC sessions:
1) Go to SM35 ---> Choose session ---> hit process. 
     Now See Question no. 10.
2) Use program RSBDCSUB.
     RSBDCSUB schedules the session to be processed in background.

Let's take an example to understand this.

The sessions are created at one point of time and processed at other point of time and this may create a
problem: For example: a BDC program creates a session for updating 1500 customers in SAP. However ,
before this session is processed via SM35 , a user inserts 100 customers in the system manually. In this
case , the session will have at least 100 errors when the session is processed from SM35.

One way to avoid this is to use the program "RSBDCSUB" in the batch input program itself so that the
session is processed as soon as it is created. 
RSBDCSUB schedules the session to be processed in background.

 What is the structure of the BDC table?

The BDCDATA consists of the following fields:


  PROGRAM [CHAR 40] - Online program name.
  DYNPRO [NUMC 4] - Screen number.
  DYNBEGIN [CHAR 1] - Flag to indicate the start of a new screen.
  FNAM [CHAR 132] - Field name of a screen field to be filled with data.
  FVAL [CHAR 132] - The actual value to be filled into the specified screen field.

Sample Screenshot:

BDCDATA table structure

 What is the difference between BDC_OKCODE and BDC_CURSOR?


BDC_OKCODE: is used for storing commands during the recording. like '/00' is the command for 'ENTER'
Key.
BDC_CURSOR: contains the cursor position. it contians the field in which cursor will be.

Example code:
perform bdc_field       using 'BDC_CURSOR'
                                                'PROJ-PSPID'.
perform bdc_field       using 'BDC_OKCODE'
                                                '=BU'.
What are the 3 methods that we use in sequence in a Batch input session method ?

1) BDC_OPEN_GROUP for opening the Batch Input Session


2) BDC_INSERT for inserting the transactional data into SAP
3) BDC_CLOSE_GROUP for closing the Batch Input Session

If there are n records , the BDC_INSERT method should be called n times.


BDC_OPEN_GROUP and BDC_CLOSE_GROUP are called only once.

General Information about a session is stored in table APQI.


Transaction data for a session is stored in table APQD.

 What is your approach for writing a BDC program?

Identify the Tcode and do the recording in SHDB to populate the BDCDATA.

Once the recording is done , one can Transfer it to the Batch input program.

In the batch Input program , The transactional data is read from the file to an internal table.
Then one can loop over the transactional data in the internal table and start uploading the data in SAP
either by CALL TRANSACTION method or by creating sessions through the batch input program.

 How do you process errors in Session method ?


You can go to Transaction SM35 , Choose the session name and click on Process.

 What are the different modes of processing batch input sessions?  


Ans:-The three modes are:
 Foreground
 Display Errors Only
 Background

 What is the difference between Synchronous and Asynchronous Update ?


In Synchronous update , the database is updated before the next transaction is taken for processing in a
batch input.
In Asynchronous update , the system doesn't wait for updating the database before the next transaction
is taken for processing in a batch input.

 What is the transaction for Recording BDC ?


The Tcode is SHDB.

 How do you read files from the Application server ?


You can use the commands:
OPEN DATASET ---> opens the file(dataset) either in read /write mode.
READ DATASET ---> Read the file
CLOSE DATASET ---> Close the dataset once the date has been read .

 How do you read files from the presentation server ?


You can use the Function Modules :
GUI_UPLOAD --> To read data from file into an internal table
GUI_DOWNLOAD --> To write data from internal table to a file on presentation server

Can we write the code both call transaction and session method in single program?
Ans. Yes it is possible to write call transaction and session in one program.
Which BDC you prefer?
Ans. 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.
(This is more genric answer but you can add more on to this if you have worked on  BDC)
When u prefer LSMW?
Ans. When we need to update medium amount of data we use LSMW. LSMW is also used when the
person like functional consultant has less programming language.
How can we handle table control in BDC?
Ans.We can handle table control using line index
Line index indicates which line of Table control is to be use for BDC transaction
Ex -
perform bdc_field using ‘RC29K-AUSKZ(01)’
Indicates 1st line of table control is going to be used for transaction which is Line index of Table Control
If i want to execute a BDC program only in background not in foreground is there any option for this?
Ans.The sm37 transaction can be used for running a program in the background. Also in the session
method while processing the session you can specify the processing type as background or foreground.

How Can We upload a text file having Delimiters in to Legacy System


Ans.For up loading text file we use the pre-defined FM gui_upload. in that FM we have the parameter
has_field_seperator for that we assign the default delimiter ‘x’.
HAS_FIELD_SEPERATOR ‘X’
‘X’ can provide the Whatever delimiter we used in flat file for separation.

which of these methods can be best used in background


process?

What is direct input method?

How LSMW is advantageous than normal BDC?

what are the steps in lsmw?

IN LSMW can you use BAPI, ?

Can you call a bdc from a report program?

what is the difference between synchronus &


asynchronus methods?

call transaction uses synchronus or synchronus method?

session method uses synchronus or synchronus method?

What is bapi?

how bapi is different from call transaction/session?


what r the advantages of bapi?

for uploading master data(ex:customer data) into sap,


which methods you prefer? call
transaction/session/lsmw/bapi? why?

tell any 2 standard bapi function modules used for


uploading sales order data?

bdc table controle ?


yes i worked on this
ok then how can we pass the data into internal table?

What is RFC(Remote Function Call)?


Ans:-RFC is an SAP interface protocol. Based on CPI-C, it considerably simplifies the programming of
communication processes between systems.
RFCs enable you to call and execute predefined functions in a remote system - or even in the same
system. .RFCs manage the communication process, parameter transfer and error handling.

What is BAPI? BAPI stands for Business API(Application Program Interface).


Ans:-  BAPI are RFC enabled function modules. the difference between RFc and BAPI are business
objects. You create business objects and those are then registered in your BOR (Business Object
Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP)
such as VB or JAVA. in this case u only specify the business object and its method from external system
in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic
functions and can be used for most SAP business object types. These BAPIs should be implemented the
same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal
with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference
to an individual BAPI.

You might also like