Sei sulla pagina 1di 6

Interview questions on BDC

1. Can we use Session method & Call transaction both in one BDC
You start your data load using Call Transaction and if any errors occur push all those errors in a session so that your data load takes place uninterrupted and you can processes your errors later 2. How do we handle errors in call transaction? We will use the BDCMSGCOLL structure in the call transaction syntax itself. Basically in this internal table all error records will be stored. If you pass this internal table to FORMAT_MESSAGES FM you will get complete error description. We can also use FM WRITE_MESSAGES to write the error records on screen. Data: gt_messtab TYPE STANDARD TABLE OF bdcmsgcoll, gt_error_tab TYPE STANDARD TABLE OF bdcmsgcoll. CALL TRANSACTION <TCODE> USING itab_bdcdata MODE 'N' UPDATE 'L' MESSAGES into gt_messtab. Loop at gt_messtab into gs_messtab where MSGTYP = 'E'. Append gs_messtab into gt_error_tab. Endloop. 3. What is different between Session and call transaction? Call Transaction method: The call transaction is compatible for small amount of data only. It is compatible for foreground process only. It is does not have a log file concept. In call transaction errors can be handled by using bdc_msgcoll structure. The data will process synchronous mode and updates also in synchronous. Session method: It is compatible for small amount of data as well as large amount data. It does not have a log file concept. The data will process asynchronous mode and updates in synchronous mode. The session method will execute only in back ground process only. Call Transaction method Classical or session method if yes please give me example and scenario where we use this?

In this method, the ABAP/4 program uses the call transaction <T-code > using <bdc_tab> mode <mode> update <update > method.

In this method, ABAP/4 program read the external data that is to be entered to the SAP system and stores the data in the batch input session. When the prgm has finished creating the session, we can run the session thro the TC SM35. This method involves FM like BDC_OPEN,BDC_INSERT,BDC_CLOSE Whereas in Batch Input Sessions, the ABAP program creates a session with all the transactional data, and this session can be viewed, scheduled and processed (using Transaction SM35) at a later time. The latter technique has a built-in error processing mechanism too. Asynchronous Processing Synchronous Database update. During processing, no transaction is started until the previous transaction has been written to the database. Detailed Log will be generated for all the sessions While executing it wont start from the first. It will start from the place where it ends with error. Not as fast as call transaction method

In Call Transaction, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling.

Synchronous Processing We can update the database both synchronously and asynchronously. We can specify the mode in the program. No batch input processing log While execution it starts from the first.

Faster than session method

4. What are the different modes in Call transaction? There are 3 modes in call transaction. 1. A - all screens 2. E - error screens 3. N - no screens There is one more obsolete mode called P which is like N but debugging is also possible in that.

The call transaction mode can take the following values: 'A' Display screen 'E' Display only if an error occurs 'N' do not display 'P' do not display; debugging possible If the MODE addition is omitted, then the processing mode is 'A'. If a screen is displayed in processing mode 'E' because the system reached the end of the BDC data, the system automatically switches to processing mode 'A'. If breakpoints are set in a transaction tcode called using the CALL TRANSACTION tcode USING itab variant, these are not actually reached in 'N' mode. The system tries to insert data in the Debugger screen; the call ends with SY-SUBRC = 1001 and the message "Batch input data is not available for screen SAPMSSY3 0131" (S 00 344). Conversely, in 'P' mode, transaction screens are processed in the background (as in 'N' mode) and debugging is possible. 5. Tell me fields in BDCDATA. 6. Tell me fields in BDCMSGCOLL. 7. How do you handle table maintenance in BDC? 8. Tell FM names, which you use in Session Method? 9. Tell mandatory parameters in FM BDC_OPEN_GROUP and BDC_INSERT? 10. What is the use of KEEP Parameter in FM BDC_OPEN_GROUP? 11. What is the use of HOLDDATE in FM BDC_OPEN_GROUP? 12. Can u upload 2 transactions data using Session Method? 13. Why BAPI perform better performance than BDC? 14. What is difference between BAPI and BDC in data uploading? 15. Tell some few advantages of BAPI rather than BDC? 16. In session and call transaction methods, which is faster method and why? 17. What is the difference between synchronous and asynchronous?
Hi, FILE HANDLING IN BDC Introduction Files on application server are sequential files. Files on presentation server / workstation are local files. A sequential file is also called a dataset. Handling of Sequential file Three steps are involved in sequential file handling

OPEN PROCESS CLOSE Here processing of file can be READING a file or WRITING on to a file. OPEN FILE Before data can be processed, a file needs to be opened. After processing file is closed. Syntax: OPEN DATASET <file name> FOR {OUTPUT/INPUT/APPENDING} IN {TEXT/BINARY} MODE This statement returns SY_SUBRC as 0 for successful opening of file or 8, if unsuccessful. OUTPUT: Opens the file for writing. If the dataset already exists, this will place the cursor at the start of the dataset, the old contents get deleted at the end of the program or when the CLOSE DATASET is encountered. INPUT: Opens a file for READ and places the cursor at the beginning of the file. FOR APPENDING: Opens the file for writing and places the cursor at the end of file. If the file does not exist, it is generated. BINARY MODE: The READ or TRANSFER will be character wise. Each time n characters are READ or transferred. The next READ or TRANSFER will start from the next character position and not on the next line. IN TEXT MODE: The READ or TRANSFER will start at the beginning of a new line each time. If for READ, the destination is shorter than the source, it gets truncated. If destination is longer, then it is padded with spaces. Defaults: If nothing is mentioned, then defaults are FOR INPUT and in BINARY MODE. PROCESS FILE: Processing a file involves READing the file or Writing on to file TRANSFER. TRANSFER Statement Syntax: TRANSFER <field> TO <file name>. <Field> can also be a field string / work area / DDIC structure. Each transfer statement writes a statement to the dataset. In binary mode, it writes the length of the field to the dataset. In text mode, it writes one line to the dataset. If the file is not already open, TRANSFER tries to OPEN file FOR OUTPUT (IN BINARY MODE) or using the last OPEN DATASET statement for this file. IF FILE HANDLING, TRANSFER IS THE ONLY STATEMENT WHICH DOES NOT RETURN SY-SUBRC READ Statement Syntax: READ DATASET <file name> INTO <field>. <Field> can also be a field string / work area / DDIC structure.

Each READ will get one record from the dataset. In binary mode it reads the length of the field and in text mode it reads each line. CLOSE FILE: The program will close all sequential files, which are open at the end of the program. However, it is a good programming practice to explicitly close all the datasets that were opened. Syntax: CLOSE DATASET <file name>. SY-SUBRC will be set to 0 or 8 depending on whether the CLOSE is successful or not. DELETE FILE: A dataset can be deleted. Syntax: DELETE DATASET <file name>. SY-SUBRC will be set to 0 or 8 depending on whether the DELETE is successful or not. Handling of local files Introduction Files on presentation server / workstation are LOCAL FILES. Local files are processed using UPLOAD and DOWNLOAD functions. The local files are brought into ABAP/4 memory using these functions. Unlike dataset, all the records of the file are UPLOADED into an internal table in one shot. Similarly, all records are DOWNLOADED in one shot from an internal table to a local file. DOWNLOAD function: Important EXPORTING parameters for this function are: Filename = name of the local file to which the internal table is to be downloaded. Filetype = file type, default values are ASC, DAT, BIN Mode = Write mode, overwrite ( ) or append (A) Important IMPORTING parameters are: Filename = actual file name entered Tables to be passed to the function: Data_tab = the internal table that is to be downloaded. Similar function called WS_DOWNLOAD is used to download the information from internal table to local file. The only difference between DOWNLOAD and WS_DOWNLOAD is that, DOWNLOAD does not require the FILENAME and FILETYPE to be exported to the function; instead it will ask for the same at runtime. However, for WS_DOWNLOAD, these two parameters need to be passed. Processing Text file with multiple record types: To process such files, it is necessary to first read the record into a character field that is a minimum of the lengths of the different structure in the file. If H type record is 30 char long (including the record identifier) and D type is 40 long (including the record identifier), then this character field should be at least 40 char long.

Potrebbero piacerti anche