Ads

Module Pool Programming Interview Questions and Answers in SAP ABAP

Module Pool Programming(Dialog Programming)  Interview Questions and Answers in SAP ABAP

As an ABAP Consultant, you should be strong in Module pool programming techniques as well as when you face the real-time or fresher interview, Questions, and answers to test your talent to select for the interview. For that purpose, I am sharing my interview experiences in which I faced the most of the times on these topics that are at exit command, events difference between set screen and call screen difference between call screen and set screen in module pool,chain-end chain in module pool.


What is the transaction code for the screen painter?

SE51.

What is the transaction code for Menu painter?

SE41.

What is the transaction code for the screen painter?

SE93.


What are the main components of dialog programs?

Screens
Module pools
Subroutines
Menus
Transactions


What is Screen flow Logic?

The screen flow logic is like an ABAP program in that it serves as a container for processing blocks. There are four event blocks, each of which is introduced with the screen keyword PROCESS:

PROCESS BEFORE OUTPUT.
 ...
PROCESS AFTER INPUT.
 ...
PROCESS ON HELP-REQUEST.
 ...
PROCESS ON VALUE-REQUEST.


What are the important screen key-words using in the event Blocks?


Within the event blocks, you can use the following screen-keywords:
Keyword
Description
MODULE
Calls a dialog module in an ABAP program
FIELD
Specifies the point at which the contents of a screen field should be transported
ON
Used in conjunction with FIELD
VALUES
Used in conjunction with FIELD
CHAIN
Starts a processing chain.
END CHAIN
Ends a processing chain.
CALL
Calls a subscreen.
LOOP
Starts processing a screen table
ENDLOOP
Ends processing a screen table.


What are screen attributes?

  • Program
  • Screen number
  • Screen type
  • Next screen
  • Cursor position
  • Screen group
  • Holding data

What are the screen elements?

Text fields
Display elements, which cannot be changed either by the user or by the ABAP program.
Input/output fields and templates
Used to display data from the ABAP program or for entering data on the screen. Linked to screen fields.
Dropdown list boxes
Special input/output fields that allow users to choose one entry from a fixed list of possible entries.
Checkbox elements
Special input/output fields that the user can either select (value ‘X’) or deselect (value SPACE). Checkbox elements can be linked with function codes.
Radio button elements
Special input/output fields are combined into groups. Within a radio button group, only a single button can be selected at any one time. When the user selects one button, all of the others are automatically deselected. Radio button elements can be linked with function codes.
Pushbuttons
Elements on the screen that triggers the PAI event of the screen flow logic when chosen by the user. There is a function code attached to each pushbutton, which is passed to the ABAP program when it is chosen.
Frame
Pure display elements that group together elements on the screen, such as radio button groups.
Subscreens
The area on the screen in which you can place another screen.
Table controls
Tabular input/output fields.
Tabstrip controls
Areas on the screen in which you can switch between various pages.
Custom Controls
Areas on the screen in which you can display controls. Controls are software components of the presentation server.
Status icons
Display elements, indicating the status of the application program.
OK field
Every screen has a twenty-character OK_CODE field (also known as the function code field) that is not displayed directly on the screen. User actions that trigger the PAI event also place the corresponding function code into this field, from where it is passed to the ABAP program. You can also use the command field in the standard toolbar to enter the OK field. To be able to use the OK field, you need to assign a name to it.


What are Tab strip controls?

A tab strip control is a screen object consisting of two or more pages. Each tab page consists of a tab title and a page area. If the area occupied by the tab strip control is too narrow to display all of the tab titles, a scrollbar appears, allowing you to reach the titles that are not displayed. There is also a pushbutton that allows you to display a list of all tab titles.

When you create a tabstrip control, you must:

Define the tab area on a screen and the tab titles.
Assign a subscreen area to each tab title.
Program the screen flow logic.
Program the ABAP processing logic

PROCESS BEFORE OUTPUT.
            
...
            
CALL SUBSCREEN: area1 INCLUDING [prog1] dynp1,
            
area2 INCLUDING [prog2] dynp2,
            
area3 INCLUDING [prog3] dynp3,
            
...
            
...
            
PROCESS AFTER INPUT.
            
...
            
CALL SUBSCREEN: area1,
            
area2,
            
area3,

What is Table control?


Table control is an area on the screen in which you can display data in tabular form. You process it using a loop. Table controls are comparable to step loop tables. While a table control consists of a single definition row, step loop blocks may extend over more than one row. Table controls are more flexible than step loops and are intended to replace them.

Table controls allow you to enter, display, and modify tabular data easily on the screen.
They provide the following functions:
On definition:
  • Fixed columns
  • Column headers
  • At runtime:
  • Vertical and horizontal scrolling.
  • Modifiable column width.
  • Row and column selection.
  • Movable columns
  • Settings can be saved.
  • CONTROLS ctrl TYPE TABLEVIEW USING SCREEN scr.
            

What is the significance of the word ‘OUTPUT’ in the declaration?

It is part of the PBO event, therefore is processed before the screen is presented.

How do you assign an OK_CODE for a push button? How is it used in your ABAP?

Ans:- In the field list, name the element and give it the value that it will represent when pushed You must make sure that you clear the field that represents the push button after every check.

What are the two methods to declare the input field as mandatory?

If you set the required field as a program attribute, the user must enter a value in the field. Reabstrip quired fields appear on the screen containing a question mark (?).

What are user-defined validation checks in the flow logic?

Ans:- FIELD…SELECT FIELD…VALUES or in the module pool FIELD…MODULE.

Does the value command in the flow logic go in the PAI or the PBO event?

Ans:- PAI.

When is the chain command used in the PBO event?

Ans:- If you want to make more than one field ready for input after an error.

What table stores the online messages? What is the message class and what is its significance?

Ans:- Table T100. The message class is a specific class of messages for a group of transactions.

What are the 5 different message types and how are they handled by the system? What is the difference between the Warning and Error messages?

Ans:- A: Abend Message displayed on the current screen and subsequent task terminated
I: Information Message displayed on the current screen, but the user can continue the program by pressing ENTER
E: Error Message displayed on the current screen. With FIELD statements, the fields concerned become ready again for the input, and the user is required to make the entry /entries again
W: Warning As E message, but correcting input is optional
S: Success Message displayed on the follow-up screen as an I message.

What effect does the FIELD statement have within the flow logic?

Ans: - The field statement resets the fields so those fields are ready for input again.

Is the SET PARAMETER statement to be issued in the PBO or PAI module? Why?

Ans: - PAI, the value must be input into the fields first before it can be placed in the buffer.

Which function type has to be used for using “at exit-command”?

To use AT EXIT-COMMAND, we must assign a function type ‘E’ to the relevant function in the Menu Painter or Screen Painter.


What is the difference between SET SCREEN and CALL SCREEN?

With SET SCREEN, the current screen simply specifies the next screen in the chain. control branches to this next screen as soon as the current screen has been processed. Return from the next screen to the current screen is not automatic. It does not interrupt the processing of the current screen.  If we want to branch to the next screen without finishing the current one, use LEAVE SCREEN.

With CALL SCREEN, the current (calling) chain is suspended, and a next screen (or screen chain) is called in. The called screen can then return to the suspended chain with the statement LEAVE   SCREEN TO SCREEN 0. 

Sometimes we might want to let a user call a popup screen from the main application screen to let them enter secondary information. After they have completed their entries, the users should be able to close the popup and return directly to the place where they left off on the main screen. Here comes CALL SCREEN into the picture. This statement lets us insert such a sequence into the current one.


Can we specify the next-screen number with a variable?  ( Yes /  No ).

Yes.

What is a dialog module?

A dialog module is a callable sequence of screens that do not belong to a particular transaction. Dialog modules have their own module pools and can be called by any transaction.

What is a “call mode”?

In the ABAP/4 world, each stackable sequence of screens is a "call mode". This is important because of the way you return from a given current sequence. 

To terminate a call mode and return to a suspended chain, set the "next screen" to 0 and leave to it:
LEAVE TO SCREEN 0 or ( SET SCREEN 0 and LEAVE SCREEN ).  When you return to the suspended chain, execution resumes with the statement directly following the original CALL SCREEN statement.  

The original sequence of screens in a transaction in itself is a calling mode.  If you LEAVE TO SCREEN 0 in this sequence ( that is, without having stacked any additional call modes ), you return from the transaction altogether.

The maximum number of calling modes stacked at one time is Nine.


What is LUW or Database LUW or Database Transaction?

An “LUW” ( logical unit of work ) is the span of time during which any database updates must be performed in an “all or nothing” manner.  Either they are all performed  ( committed ), or they are all thrown away ( rolled back ).  In the ABAP/4 world, LUWs and transactions can have several meanings:

LUW ( or “database LUW” or  “database transaction” )  This is the set of updates terminated by a database commit.  An LUW lasts, at most, from one screen change to the next ( because the SAP system triggers database commits automatically at every screen change ).


What is SAP LUW or Update Transaction?

Update transaction ( or “SAP LUW”) This is a set of updates terminated by an ABAP/4 commit. An SAP LUW may last much longer than a database LUW since most update processing extends over multiple transaction screens. The programmer terminates an update transaction by issuing a COMMIT WORK statement.


What happens if only one of the commands SET SCREEN and LEAVE SCREEN is used without using the other?

If we use SET SCREEN without LEAVE SCREEN, the program finishes processing for the current screen before branching to.  If we use LEAVE SCREEN without a SET SCREEN before it, the current screen process will be terminated and branch directly to the screen specified as the default next-screen in the screen attributes.


What is the significance of the screen number ‘0’?

In "calling mode", the special screen number 0 (LEAVE TO SCREEN 0) causes the system to jump back to the previous call level.  That is if you have called a screen sequence with CALL SCREEN leaving to screen 0 terminates the sequence and returns to the calling screen.  If you have not called a screen sequence, LEAVE TO SCREEN 0 terminates the transaction.


What does the command ‘SUPPRESS DIALOG’ do?

Suppressing entire screens is possible with this command.  This command allows us to perform screen processing “in the background”. Suppressing screens are useful when we are branching to list-mode from a transaction dialog step.


What is the significance of the memory table ‘SCREEN’?

At runtime, attributes for each screen field are stored in the memory table called ‘SCREEN’.  We need not declare this table in our program.  The system maintains the table for us internally and updates it with every screen change.


What are the fields in the memory table ‘SCREEN’?

Name        Length        Description

What is a screen group? How it is useful?

Screen group is a field in the Screen Attributes of a screen.  Here we can define a string of up to four characters which is available at the screen runtime in the SY-DNGR field.  Rather than maintaining field selection separately for each screen of a program, we can combine logically associated screens together in a screen group.


What is Subscreen? How can we use a Subscreen?

A subscreen is an independent screen that is displayed in an area of another ("main") screen. To use a subscreen we must call it in the flow logic ( both PBO and PAI ) of the main screen.   

The CALL SUBSCREEN statement tells the system to execute the PBO and PAI events for the subscreen as part of the PBO or PAI events of the main screen. The flow logic of your main program should look as follows:

PROCESS BEFORE OUTPUT.
CALL SUBSCREEN INCLUDING ' ' ''.
PROCESS AFTER INPUT.
CALL SUBSCREEN.

The area is the name of the sub-screen area you defined in your main screen. This name can have up to ten characters. Program is the name of the program to which the sub screen belongs and the screen is the sub screen's number.

What are the restrictions on Subscreens?

Subscreens have several restrictions.  They cannot:
Set their own GUI status
Have a named OK code
Call another screen
Contain an AT EXIT-COMMAND module
Support positioning of the cursor


How can we use/display table data on a screen?

ABAP/4 offers two mechanisms for displaying and using table data on a screen. These mechanisms are TABLE CONTROLS and STEP LOOPS.

What is a transaction?

A transaction is a dialog program that changes data objects in a consistent way.

What are the basic components of a dialog program?


Screens (Dynpros)
Each dialog in an SAP system is controlled by dan pros.A dan pro consists of a screen

And its flow logic and controls exactly one dialog step.

What is the PBO and PAI events?

PBO- Process Before Output-It determines the flow logic before displaying the screen.

PAI-Process After Input-It determines the flow logic after the display of the screen and after receiving inputs from the User.

Can we use WRITE statements in screen fields? if not how is data transferred from field data to screen fields?

We cannot write field data to the screen using the WRITE statement. The system instead transfers data by comparing screen field names with ABAP/4  variable names. If both names are the same, it transfers screen field values to ABAP/4 programs fields and Vice Versa. This happens immediately after displaying the screen.

Can we use flow logic control key words in ABAP/4 and vice-versa?

The flow control of a Dynpro consists of os a few statements that syntactically resemble ABAP/4  statements. However, we cannot use flow control keywords in ABAP/4 and vice-versa.


9.What is GUI status? How to create /Edit GUI status?


A GUI status is a subset of the interface elements used for a certain screen. The status comprises 
those elements that are currently needed by the transaction. The GUI status for a transaction may be composed of the following elements:

-Title bar.

-Menu bar.

-Application toolbar

-Push buttons.


To create and edit the GUI status and GUI title, we use the Menu Painter.


How does the interaction between the Dynpro and the ABAP/4 Modules take place?


A transaction is a collection of os screens and ABAP/4 routines, controlled and executed by a Dialog processor. The Dialog processor processes screen after the screen, thereby triggering the appropriate

ABAP/4 processing of each screen. For each screen, the system executes the flow logic that contains the corresponding ABAP/4 processing. The controls pass from screen flow logic to ABAP/4 code and back.

What is an “on input filed” statements?

 ON INPUT.

The ABAP/4 module is called only if a field contains the Value other than the initial Value. This initial value is determined by the filed’s Data Type: blanks for character Fields, Zeroes for numerics. If the user changes the Fields Value back to its initial value, ON INPUT does not trigger a call.


What is an “on request Field” statement?

–          ON REQUEST

The ABAP/4 Module is called only if the user has entered the value in the field value since the last screen display. The Value counts as changed Even if the user simply types in the value that was already there. In general, the ON REQUEST condition is triggered through any

Form of” MANUAL INPUT’.

What is a conditional chain statement?

ON CHAIN-INPUT similar to ON INPUT.

The ABAP/4 module is called if any one of the fields in the chain contains a value other than its initial value(blank or nulls).

ON CHAIN-REQUEST

This condition functions just like ON REQUEST, but the ABAP/4 module is called if any one of the fields in the chain changes value.


What is “at exit-command:?

The flow logic Keyword at EXIT-COMMAND is a special addition to the MODULE statement in the Flow Logic. AT EXIT-COMMAND lets you call a module before the system executes the automatic field checks.


Which Function type has to be used for using “at exit-command”?

To Use AT EXIT – COMMAND, We must assign a function Type “E” to the relevant function in the MENU Painter OR Screen Painter

The Syntax used to call a screen as dialog box (pop up)


CALL SCREEN <screen number.>

STARTING AT <start column><start line>

ENDING AT <end column> <end line>

What is “call mode”?

In the ABAP/4  WORLD each stackable sequence, of screens is a “call mode”, This is IMP because of the way u return from the given sequence. To terminate a call mode and return to a suspended chainset the “next screen” to 0 and leave to it:

LEAVE TO SCREEN 0 or (SET SCREEN 0 and LEAVE SCREEN). When u return to the suspended chain execution resumes with the statement directly following the original CALL SCREEN statement. The original sequence of screens in a transaction (that is, without having stacked any
additional call modes), you returned from the transaction altogether.


What are the differences between TABLE CONTROLS and STEP LOOPS?


TABLE CONTROLS are simply enhanced STEP LOOPS that display with the look and feel of a table widget in a desktop application.  But from a programming standpoint, TABLE CONTROLS and STEP. 

LOOPS are almost exactly the same.  One major difference between STEP LOOPS and TABLE. 

CONTROLS is in STEP.

LOOPS their table rows can span more than one time on the screen.  By contrast, the rows in a TABLE CONTROLS  are always single lines but can be very long. (Table control rows are scrollable).  The structure of table control is different from step loops.  A step loop, as a screen object, is simply a series
of field rows that appear as a repeating block.  A table control, as a screen object consists of I) table fields (displayed in the screen ) ii) a control structure that governs the table display and what the user can do with it.

What are the Dynpro keywords?

FIELD, MODULE, SELECT, VALUES, and CHAIN are the Dynpro keywords.

Why do we need to code a LOOP statement in both the PBO and PAI events for each table in the screen?


We need to code a LOOP statement in both PBO and PAI events for each table on the screen.  This is because the LOOP statement causes the screen fields to be copied back and forth between the ABAP/4 program and the screen field.  For this reason, at least an empty LOOP….ENDLOOP must be there.

The field SY-STEPL refers to the index of the screen table row that is currently being processed.  The system variable

SY-stepl only has a meaning within the confines of LOOP….ENDLOOP processing.  Outside the loop, it has no valid value.

How can we declare a table control in the ABAP/4 program?

Using the syntax controls <table control name> type tableview using screen <scr no>.

What is the use of the statement Leave to List-processing?


Leave to List-processing statement is used to produce a list from a module pool.  Leave to list processing statement allows to switching from dialog-mode to list-mode within a dialog program.

When will the current screen processing terminate?

A current screen processing terminates when control reaches either a Leave-screen or the end of PAI.

 What happens if we use Leave to list-processing without using Suppress-Dialog?

If we don’t use Suppress-Dialog to next screen will be displayed but as empty, when the user presses ENTER, the standard list output
is displayed.

How the transaction that is programmed by the user can be protected?


By implementing an authority check.

 What are the modes in which any update tasks work?


Synchronous and Asynchronous.

What is the difference between Synchronous and Asynchronous updates?


A program asks the system to perform a certain task, and then either wait or doesn’t wait for the task to finish.  In synchronous processing, the program waits: control returns to the program only when the task has been completed.  In asynchronous processing, the program does not wait: the
system returns control after merely logging the request for execution.

What are the events by which we can program “help texts” and display “possible value lists”?


PROCESS ON HELP-REQUEST (POH).

PROCESS ON VALUE-REQUEST (POV).

What is the difference between Leave Transaction and Call Transaction?


In contrast, to LEAVE TO 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.

How can we send data to external programs?


Using SPA/GPA parameters(SAP memory).

Using EXPORT/IMPORT data (ABAP/4 memory)

SAP ABAP Real Time Interview Questions and answers

Field symbols in SAP ABAP


Conclusion

If you know more about Module Pool Programming Interview Questions and Answers in SAP ABAP, please comment below, or share these iq's to help others.

Comments

  1. Replies

    1. Looking for the best SAP PP Training in Bangalore, then don't delay join IntelliMindz SAP PP Training in Bangalore. Join our SAP PP training to get hands-on training and practice in SAP PP Software. Any Queries call @ 9655877677. IntelliMindz is the best IT Training Institute in Bangalore with placement, offering 200 and more software courses with 100% Placement Assistance.
      SAP PP in Bangalore
      SAP PP in Chennai
      SAP PP Online Course

      Delete
  2. if there is field which is mandatory , but user doesn't wants to give value in that field , also we can't change the field to not mandatory ( not required) , once we click on save. except mandt field the record is going to update in Z table , how to achieve this .

    ReplyDelete
  3. Thanks again for the article post.Really thank you! Fantastic.
    MuleSoft training
    MuleSoft online training

    ReplyDelete

Post a Comment

Popular posts from this blog

BADI Interview Questions in SAP ABAP

Sample SAP ABAP Programming Examples for Practice

Step by Step tutorial on BDC Session Method Program in SAP ABAP

SAP ABAP Interview Questions and Answers for 10 Years Experienced