Friday, May 8, 2015

SAP ABAP : BDC

http://sap-interview-questions-and-answers.blogspot.in/2012/07/sap-webdynpro-abap-interview-questions.html

What is BDC and why do we use BDC ?
BDC ( Batch Data Communication ) also known as batch input is a technique by which large volumes of data can be transferred from Non Sap or Legacy systems to SAP systems.

The two methods for BDC are:
  • Session Method
  • Call TRANSACTION Method
hat is the difference between Call Transaction Method and the Session method ?

Session Method
Call Transaction
Session method id generally used when the data volume is huge.
Call transaction method is when the data volume is   low
Session method is slow as compared to Call transaction.
Call Transaction method is relatively faster than Session method.
SAP Database is updated when you process the sessions. You need to process the sessions separately via SM35.
SAP Database is updated during the execution of the batch input program.
Errors are automatically handled during the processing of the batch input session.
Errors should be handled in the batch input program.
Question 2: 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 BDC_OKCODE for Page down that can be used for scrolling down in table control.

Question 3: 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 uploads.
BDCs would be preferred for large volumes of data upload since background processing option is available.
For processing errors, the Return Parameters for BAPI should be used.This parameter returns exception messages or success messages to the calling program.
Errors can be processed in SM35 for session method and in the batch input program for Call Transaction method.

Question 4: How do you process errors in Call Transaction method ?

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.

RSBDCSUB : to Schedule BDC.

Question 6: 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.



Question 7: 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 contains the field in which cursor will be.

EExample code:
pperform bdc_field       using 'BDC_CURSOR'
                                                'PROJ-PSPID'.
pperform bdc_field       using 'BDC_OKCODE'
                                                '=BU'.

Question 8: 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

General Information about a session is stored in table APQI.
Transaction data for a session is stored in table APQD.

Question 9: 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.

Question 10: How do you process errors in Session method ?
You can go to Transaction SM35 , Choose the session name and click on Process.

Question 12: 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.

uestion 14: 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 .






No comments:

Post a Comment