Welcome to yet another post on ABAP interview questions. Here I have complied a list of interview questions on Smartforms in SAP. This list is quite comprehensive. Hope you find it useful. Cheers !!
Smartform is SAP's print form technology and is an alternative to SAP-Scripts. Whenever you activate a Smartform , a function module is generated for that Smartform. The program that calls this function module is called the Driver Program for Smartform. The T.code for Smartforms is SMARTFORMS.
Unlike SAP-Scripts, Smartforms are client independent.
Here we go:
*An SAP R/3 system has 2 clients 800 & 810. You create an SAP Script Z_Script and a Smartform Z_Smartform in client 800. Will both Z_Script and Z_Smartform be available in client 810 as well?
Client 200 will have just the Smartform Z_Smartform and not the SAP Script Z_Script.
SAP-Script is client dependent whereas SMARTFORM is client independent. Many people don't understand what this is all about. The above answer should suffice. However, if you still do not understand this, find an SAP system where you have 2 clients. Create a dummy Smartform / script in one client and check whether they exist in the other client.
*You have created a Smartform in DEV environment. Then you migrated the Smartform to PROD environment. Will the name of the function module be same in DEV and PROD?
Once you transport the Smartform from DEV to PROD environment, a new function module name for the Smartform in generated in the PROD environment. For a particular Smartform , generated function module names are different in different systems.One can get the name of the function module for Smartform by passing the Smartform name to FM SSF_FUNCTION_MODULE_NAME.
Hence in the driver program for Smartform, it is common practice to use FM SSF_FUNCTION_MODULE_NAME and then calling the Smartform Function Module.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_SMARTFORM'
IMPORTING
fm_name = lv_fm_name
CALL FUNCTION lv_fm_name
*How do you convert a Smartform Output to PDF output?
There is a tricky solution here.But let's keep that for the last. Let us first discuss the conventional way of getting a PDF output for Smartform. For that you need to keep in mind the following two function modules and their importing/exporting parameters:
CONVERT_OTF
CONVERT_OTF_2_PDF
In the Driver program, import the parameter 'job_output_info' from the Smartform FM and utilize that info in 'OTF' parameter of the two aforementioned function modules.
Here is one more and probably the easiest way to see PDF output for a Smartform.
Type PDF! in the command prompt and hit enter :).
To see the Smartform Print Preview output as list output,
Type SLIS in the command prompt and hit enter.
*How do you achieve Bar Code printing in Smartforms?
Step1: Use SE73 i.e. SAP-Script Font Maintenance and create a Bar code say ZDEMO.
Step 2: For Smartform, create a character format C1 and use the recently created Barcode ZDEMO.
It can be finally used to print Barcode as:
How do you add a Watermark Or a Background Image for Smartforms ?
If you go to the properties of a page in Smartform, you will find a tab for Background Image.
Specify the source of the image you need here and it can be used as background image / Watermark in Smartforms.
Graphics can be maintained using T.code SE78.
How will you print on both sided of a Smartform?
At the Page level in Smartforms, you can find something called as Print Mode.
Set the Print mode to duplex to print on both sides of the Smartform.
What is the difference in a Table and a Template in Smartform?A Template has fixed number of Rows and Columns whereas a Table can have variable rows and columns i.e. you can have a internal table with contents associated to a Table element but not to a Template.
You should use a template when the tabular output is fixed!
How do you achieve Page Protection in Smartform ?While one can use the PROTECT ..... ENDPROTECT command for SAP-Scripts, for Smartforms the Page-Protection checkbox can be used to ensure page protection:
Note: You have Page-protection property only for Text Elements in the Main Window.
Can you move a Smartform from one SAP system to another without using transports ?
Yes, this can be achieved using the Upload/Download feature for Smartforms.
One can download the Smartform from one system and save it as an XML file.
Once that is done, the XML file can be used to upload the Smartform in another system.
Can you have a Smartform without a main window?
Yes, you can create a Smartform without a Main Window. But there is no need to do anything of such sort.
Whenever you create a Smartform, a main window is created by default. I can't think of a situation , where you will have a situation in which it is mandatory for you to remove the Main Window. But still I have seen this question in ABAP interviews. So I have put it here.
How do you find the name of the Function Module for a Smartform?
When is this function module created?
The function module for Smartform is created when the Smartform is activated.
You can find the name of the Function Module for a Smartform by going to
Environment --> Function Module Name.
What is a Copies Window?
What is a Final Window?
Final Window is called after all the other windows are called in a Smartform.
How do you pass data to Smartforms from the driver program?
How do you Debug Smartforms ?
How would you go about printing a logo in a Smartform?
How do you print address number in Smartforms ?
How do you print Symbols and Icons in Smartforms?
What are Basic Nodes and Auxiliary Nodes ?
What is the use of Folder in Smartforms ?
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.
Example: A Legacy system that is to be replaced by SAP has say 1000 Customers , 2000 vendors and 3000 materials. All this data needs to be transferred to SAP . In such cases , We can use BDC.
If the old system is replaced by SAP, such a transfer is called Conversion.
If the old system runs along with SAP, in that case the transfer is called an Interface.
The two methods for BDC are:
- Session Method
- Call TRANSACTION Method
- CALL DIALOG (Outdated)
ABAP interview questions on BDC:
Important:
Question 1:What 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.
|
Important:
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 BCD_OKCODE for Page down that can be used for scrolling down in table control.
Important:
Question3: 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.
Question 5: 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.
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.
Sample Screenshot:
|
BDCDATA table structure |
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 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'.
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
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.
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 11: What are the different modes of processing batch input sessions?
The three modes are:
Foreground
Display Errors Only
Background
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.
Question 13: What is the transaction for Recording BDC ?
The Tcode is SHDB.
Question 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 .
Question 15: 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