Thursday, February 10, 2011

SAP ABAP Scripts Question and Answers Part 5

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 a 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:
Area is the name of the subscreen 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 subscreen belongs and screen is the subscreen'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 in a screen ?
ABAP/4 offers two mechanisms for displaying and using table data in a screen. These mechanisms are TABLE CONTROLS and STEP LOOPS.

What are the differences between TABLE CONTROLS and STEP LOOPS ?
- TABLE CONTROLS are simply enhanced STEP LOOPS that display data 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 line 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 controls 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.

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 in 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

type tableview using screen .

Differentiate between static and dynamic step loops.
Step loops fall into two classes: Static and dynamic. Static step loops have a fixed size that cannot be changed at runtime. Dynamic step loops are variable in size. If the user re-sizes the window the system automatically increases or decreases the number of step loops blocks displayed. In any given screen you can define any number of static step loops but only a single dynamic one.

What are the two ways of producing a list within a transaction ?
By submitting a separate report.
By using leave to list-processing.

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 switch from dialog-mode to list-mode within a dialog program.

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

How is the command Suppress-Dialog useful ?
Suppressing entire screens is possible using this command. This command allows
us to perform screen processing “in the background”. The system carries out all PBO and PAI logic, but does not display the screen to the user. Suppressing screens is useful when we are branching to list-mode from a transaction dialog step.

What happens if we use Leave to list-processing without using Suppress-Dialog ?
If we don't use Supress-Dialog the next screen will be displayed but as empty.
when the user presses ENTER, the standard list output is displayed.

How the transactions that are 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 waits 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 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.

Overall how do you write transaction program in SAP?
Create the transaction using object browser (SE80)
Define the objects e.g. screen, Transactions. – Modules – PBO, PAI.
And you can create a transaction from SE93 also.

Does SAP has a GUI screen painter? If yes What operating systems is it available on? What is the other type of screen painter called?
On what OS is it available – Window based.
Other type of screen painter – alpha numeric screen painter.

What are step loops? How do you program page down page up in step loop?
Step loops: Method of displaying a set of records.
Page down & Page up: decrement / increment base counter
Index = base + sy-step1 – 1

Normally how many and what files get created when a transaction program is written? What is top XXXXXXTOP program?
Main program with A Includes
II ) Include for PBO
III) Include for PAI
IV) include for Forms

Where is processing logic located in an on-line program?
Ans :- ABAP/4 program (module pool)

Describe the online processor. What is its function?
Ans :- Controls the flow of online program.

How are screen names defined? Do you create a screen first or define your program first?
Ans :- Define the program first and then create a screen.

What does PBO stands for? When is the PBO logic performed?
Ans :- PROCESS BEFORE OUTPUT –Processed before the screen is displayed.

What does PAI stands for? When is the PAI logic performed?
Ans :- PROCESS AFTER INPUT –Processed after the user has pressed ENTER.

How is data passed from the screen fields to the ABAP/4 program?
Ans :- Through the flow logic.

What does the TOP Include do for you as a programmer?
Ans: For global declarations.

What are the steps in creating screen?
Where are the module statement declared? Where is the logic within each module?
Ans :-

Go to SE41 ( Screen Painter )
Enter the program name and screen number . Press Enter.
Design the screen and save, check and activate it.

Module statements are in the flow logic within each module is in the ABAP/4 module pool

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


Ans :- Then we know that it is part of the PBO, therefore is processed before the screen is presented.

Describe the fields on the screen ?

Ans :- Attributes screen , Screen types ,follow up screens , cursor position etc. After you have entered the screen number, the screen branches to the screen attribute maintenance. Enter a short description , select the type NORMAL and specify the number of the follow-up screen.

What are the three components of ON-LINE program?

Ans :- Screen , ABAP/4 program and transaction code.

What is gained by using the Dictionary Fields menu option when creating your screen?

Ans :- The fields you have created inherits the same attributes as those in the Data Dictionary.

How to Create a checkbox , frame, pushbuttons and radio buttons on a screen?

Ans :- Just type a name and go to graphic element push button.

How do you assign an OK_CODE for a push button? How it is 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 pushbutton after every check.
What automatic checks does the screen perform? (should be four)

Describe all four and how they are used?

Ans :- The field format, required input, a foreign key table ,parameters.

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

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

How does foreign key work? What you have to put in your screen to identify the foreign key?

No? Then where is the foreign key identified?

Ans :- You have defined a screen field by referring to a Data Dictionary, which has a check table. When the foreign key is checked the system compares the values of the fields to be checked with the contents of the key fields of the corresponding table.

What are the two effects of the foreign key from a user standpoint?

Ans :- Possible entries & a check against the key field contents.

What is 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.

If an error occurs in the module pool, which fields are available for entry and which are display only fields?
Ans :- Only those fields defined with the FIELD statement before MODULE & relevant checks in a chain.

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 then 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 user can continue program by pressing ENTER
E: Error Message displayed on the current screen. With FIELD statements , the fields concerned become ready again for input and 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 does WITH statement add to a message?

Ans :- In the place of the & or $ the fields or values are placed in the error 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.

Where are the messages displayed on the screen?

Ans :- At the bottom.

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

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

Where does the GET PARAMETER statement get its values? Which field gets populated with the new value?
Ans :- From the buffer.

Where can the SET CURSOR command be executed? What is its effect?

Ans :- In PBO, To position the CURSOR in a particular field after the screen is displayed.

What are the matchcodes and how do they affect the screen field? Where are they specified in the online program?
Ans :- In the Properties window of the Field.

What is the effect of an ON CHAIN-REQUEST command in your flow logic?

Ans :- When value of any of the fields between CHAIN…..ENDCHAIN is attempted to change.

What commands are used to change database table entries?

Ans :-

How can you check if the changes to the database were successful?

Ans :-

What is the difference between the Long form and the short form of making database changes?

No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)


Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive