WE'VE FOUND SAPhelpdesk!!!

***** Read the Reviews / Rate the Solution
We're not quite there yet.But we're getting there!-and we really want you to know when we're ready.
We can send the latest updates to ur email.Just subscribe to the email updates below and confirm the confirmation link in your email

Here's how to stay updated:

Enter ur email:

ABAP PROGRAMING

ABAP PROGRAMING

1) What is Abap program?
Sol: Programs written in Abap programming language is called Abap program.
Abap program mainly consists of Abap statements, which are group as processing blocks.

2) What Abap program consists of?
Sol: Abap program consists of Abap statements which are grouped as processing blocks. So Abap program mainly consists of Processing blocks, which are processed sequentially as soon as they are called by runtime environment (Kernel and Basis services is called runtime environment).

3) What are the different kinds of Abap programs?
Sol: There are 2 kinds of Abap programs:
Report programs (Abap reports)
Dialog programs.

4) What is runtime environment?
Sol: Set of system provided programs that must be available for execution at runtime.

5) What is the structure of Abap program?
Sol: Abap program has modular structure.
Each Abap program has the following structure:
1. Declaration part for global data,
2. Dialog modules,
3. Event blocks, and
4. Subroutines.

6) How structure of an Abap program is divided?
Sol: Each Abap program structure is divided into 2 parts:
• Declaration part for global data (of variable, classes, selection screens etc) &
• Processing block
o Dialog modules
o Event blocks &
o Subroutines.

7) Does Abap have different types of Abap program? If yes, on what basis they are categorized?
Sol: Yes, there are different Abap program types. Abap program is categorized based on program type.

8) What is program type?
Sol: It is the factor which determines whether a program can be run, if so how.

9) List different types of Abap program in Abap language?
Sol: There are 7 types of Abap programs
1. Type 1 = Executable Abap programs.
2. Type M = Module pool programs (Dialog programs)
3. Type F = Function group
4. Type S = Subroutine pool
5. Type I = Include program
6. Type K = Class pool
7. Type J = Interface pool

10) Can we call a program from another application program?
Sol: yes it is possible to call a program from another application program, by making use of Abap keywords for e.g. submit, leave, leave to list processing etc.

11) List different events in executable program or report?
Sol: Events in executable program are:
1. Load-of-program
2. Initialization
3. At-selection-screen
4. Start-of-selection
5. Get – with logical database
6. Check – with logical database (with get event)
7. Reject – with logical database (with get event)
8. Stop – with logical database and also with other events like initial.., at sel-screen, s-o-s and also with get event
9. End-of-selection
10. Module
11. Endmodule

12) Load-of-program?
Sol: Event keyword:
The corresponding event is triggered in an internal session immediately after a program with type 1, M, F, or S is loaded. The corresponding processing block is processed once per program and internal session (it will be triggered only once, but the contents of which will be displayed even after this event is written many a times in the program).

REPORT ZWASEEM_PROGRAM_EVENTS .

break-point.
load-of-program.
write:/ 'Hello this is load of program event'.

initialization.
write:/ 'initial'.

start-of-selection.
write:/ 'start of selection'.

start-of-selection.
write:/ 'start of selection -2'.

load-of-program.
write:/ 'Hello this is load of program event -------'.

The processing block LOAD-OF-PROGRAM has approximately the same function in an ABAP program with type 1, M, F, or S as the constructor method of a class in ABAP Objects (to assign some default values).

13) Initialization event?
Sol: This event occurs before the standard selection screen is called. You can use it, for example, to initialize the input fields of the standard selection screen.

14) Describe the process flow of Initialization?
Sol: The precise flow logic of INITIALIZATION is as follows:
1. First, the default values are placed in the selections (DEFAULT specifications).
2. Then the INITIALIZATION event is processed.
3. Now, the variants are imported (if the program is started using a variant), and any values passed in the WITH clause of the SUBMIT statement are passed to the relevant fields.
4. The AT SELECTION-SCREEN OUTPUT event is now processed if it is defined in the program. This event is processed in each PBO of the selection screen (unlike INITIALIZATION, which is processed only once).
5. The selection screen is displayed.
6. The screen fields containing user input are transferred to the program fields.
7. Finally, the START-OF-SELECTION event is processed.

15) How many time the event Initialization is triggered?
Sol: Since the INITIALIZATION event is only processed once (when the program starts), it is not suitable for screen modifications, such as hiding individual parameters (LOOP AT SCREEN, MODIFY SCREEN), since these modifications would disappear after a single cycle of the selection screen. The correct event for screen modifications is AT SELECTION-SCREEN OUTPUT.

16) Is Initialization event used for screen modifications?
Sol: Since the INITIALIZATION event is only processed once (when the program starts), it is not suitable for screen modifications, such as hiding individual parameters (LOOP AT SCREEN, MODIFY SCREEN), since these modifications would disappear after a single cycle of the selection screen. The correct event for screen modifications is AT SELECTION-SCREEN OUTPUT.

17) Does Initialization event get processed with call selection-screen?
Sol: The INITIALIZATION event is only processed with SUBMIT, not with CALL SELECTION-SCREEN.

18) Does SET PF_STATUS statement work during this event?
Sol: The SET PF-STATUS statement does not work during the processing of an event. Instead, you should set a status with one of the function modules RS_SET_SELSCREEN_STATUS or RS_EXTERNAL_SELSCREEN_STATUS

19) At Selection-screen event?
Sol: At selection-screen is the basic form of whole series of at selection-screen that is triggered when the standard selection screen is being processed, i.e. it will be triggered or processed between Initialization and start-of-selection.
At selection-screen is used to validate the user input and also to modify the selection screen before it is called (PBO).
Or
The basic form of the selection screen events is the AT SELECTION-SCREEN event.
This event occurs after the runtime environment has passed all input data from the selection screen to the ABAP program.
The other selection screen events allow programmers to modify the selection screen before it is sent and specifically check user input.

20) List other forms of At selection screen?
Sol: Other At selection-screen events are:
1. At selection-screen on field
2. At selection-screen on block
3. At selection-screen on end of select-table
4. At selection-screen on help-request for field
5. At selection-screen on value-request for field
6. At selection-screen on radiobutton group group_name
7. At selection-screen on exit_command
8. At selection-screen output.

21) At selection-screen on field?
Sol: In the PAI event of the selection screen, the event
AT SELECTION-SCREEN ON
is triggered when the contents of each individual input field are passed from the selection screen to the ABAP program.

22) At selection-screen on block?
Sol: In the PAI event of the selection screen, the event
AT SELECTION-SCREEN ON BLOCK
is triggered when the contents of all of the fields in a block are passed from the selection screen to the ABAP program.
You can use this event block to check the consistency of the input fields in the block. If an error message occurs within this event block, the fields in the block are made ready for input again on the selection screen.

23) At selection-screen on select-table and end of select-table?
Sol: These events are triggered on table selected for multiple values of select-options.
At first, the
AT SELECTION-SCREEN ON
event is triggered for the current line of the selection table.
It can then be processed like a single field.
Next, the
AT SELECTION-SCREEN ON END OF
event is triggered.
This event block allows you to check the whole selection table . Warning messages are displayed as dialog boxes, not in the status line.

24) At selection-screen on help-request for field?
Sol: If the data type of an input field declared in an executable program is defined in the ABAP Dictionary, the documentation of the underlying data element is automatically displayed if the user positions the cursor in that field and presses F1. To create help for input fields that have no Dictionary reference, or to override the help normally linked to the field, you can create an event block for the event
AT SELECTION-SCREEN ON HELP-REQUEST FOR
The event is triggered when the user calls the F1 help for the field . If no corresponding event block has been defined, the help from the ABAP Dictionary is displayed, or none at all if the field has no Dictionary reference. If a corresponding event block exists, it takes precedence over the default help mechanism. It is then up to the programmer to ensure that appropriate help is displayed.

Note: You cannot declare the event block AT SELECTION-SCREEN ON HELP-REQUEST for input fields on the selection screen that are declared within a logical database.
Example:

PARAMETERS: P_CARR_1 TYPE ZWASDATA.

AT SELECTION-SCREEN ON HELP-REQUEST FOR P_CARR_1.

CALL SCREEN 100 STARTING AT 10 5
ENDING AT 60 10.

25) At selection-screen on value-request for field?
Sol: If a field in an executable program is defined with reference to an ABAP Dictionary field for which possible entries help is defined, the values from the ABAP Dictionary help are automatically displayed when the user calls the F4 help for that field. To create possible values help for input fields that have no Dictionary reference, or to override the help normally linked to the field, you can create an event block for the event
AT SELECTION-SCREEN ON VALUE-REQUEST FOR
The event is triggered when the user calls the F4 help for the field . If no corresponding event block has been defined, the possible values help from the ABAP Dictionary is displayed, or none at all if the field has no Dictionary reference. If a corresponding event block exists, it takes precedence over the default possible values help mechanism. It is then up to the programmer to ensure that an appropriate list of values is displayed, and that the user can choose a value from it.
Note: You cannot declare the event block AT SELECTION-SCREEN ON VALUE-REQUEST for input fields on the selection screens that are declared within a logical database.

26) At selection-screen on radiobutton group group_name?
Sol: In the PAI event of the selection screen, the event
AT SELECTION-SCREEN ON RADIOBUTTON GROUP
is triggered when the contents of all of the fields in a radio button group are passed from the selection screen to the ABAP program.
This event block allows you to check the whole group.
If an error message occurs within this event block, the radio button group is made ready for input again on the selection screen.
The individual fields of radio button groups do not trigger the event AT SELECTION-SCREEN ON .

27) At selection screen on exit-command?
Sol: This event is normally only triggered by "system" pushbuttons. Be careful when using it, so as not to interrupt the system processes.
Effect: This event is processed when an exit command is triggered on the selection screen, that is, a command after which there are no field checks or PAI processing. These are usually the events "Back", "Cancel", and "Exit".

28) At selection-screen output?
Sol: This event is executed at PBO of the selection screen every time the user presses ENTER - in contrast to INITIALIZATION.

29) What START-OF-SELECTION processing block/event contains?
Sol: This event will be triggered when the standard selection screen have been processed/ displayed (Screen # 1000 is displayed).
Use: You can use it to prepare for reading data and creating the list by, for example, setting values for internal fields and writing introductory notes on the output list.
E.g. start-of-selection.
write:/ 'start of selection'.

Note:
o The REPORT statement always executes a START-OF-SELECTION implicitly.
o Consequently all processing logic between the REPORT statement and the next event keyword (until the system encounters any other event like load-of-program, initialization, at selection-screen) is automatically processed in the START-OF-SELECTION event.
o Immediately afterwards, the system processes the statements that belong to an explicit START-OF-SELECTION block.
o All ABAP statements (except declarative statements in the declaration part of the program) are part of a processing block. Non-declarative ABAP statements, which occur between the declaration of global data and a processing block, are automatically assigned to the START-OF-SELECTION processing block.

30) Get event?
Sol: The corresponding events are triggered in an executable program when data is read within the program using a logical database.
Notes
1. You can only use the "GET node." statement once in a program.
2. Internally, GET events are implemented as FORM routines. Consequently, all data objects that you create using DATA are local, that is, they can only be addressed within the event. This also applies to AT SELECTION-SCREEN ....

31) Check event?
Sol: When database tables are read using logical databases, you can use a special variant of the CHECK statement in the event blocks for GET events.
CHECK SELECT-OPTIONS.
• The statement checks if the contents of the interface work area that has been filled by the logical database for the current GET event, meets the conditions in all selection tables that are linked to the database table read.
• This variant of the CHECK statement only works in conjunction with selection criteria that are linked to database tables, and should only be used for GET events.

32) Reject event?
Sol: This statement exits a GET block. Stops processing the current database table line and resumes with the next line of the table on the same hierarchy level. Unlike the CHECK statement, you can also use REJECT within a subroutine or loop for table selection.

33) Stop event?
Sol: Effect
This statement terminates a processing block in an executable program.
Note
The statement is only intended for use in the INITIALIZATION, AT SELECTION-SCREEN, START-OF-SELECTION, and GET events. It terminates the current processing block in an executable program and triggers the END-OF-SELECTION event. In all other processing blocks, or when you do not want to trigger the END-OF-SELECTION event, you must use EXIT.

34) End-of-selection?
Sol: The END-OF-SELECTION event is triggered in type 1 programs once the logical database has finished reading all data and before the list processor is started.
You can use the corresponding event block to process and format the data that the program has stored in internal tables or extracts during the various GET events.

35) What is module?
Sol: The processing block of code between Module and Endmodule is called “MODULE”.
The module statement is used in the Executable program to call the module mod_name present in the screen flow logic (PBO, PAI, PHR, and PVR).
Example
DATA: INPUT, GOOD_INPUT.
MODULE CONTROL.
...
IF INPUT NE GOOD_INPUT.
MESSAGE E123.
ENDIF.
ENDMODULE.

Note
The ABAP/4 statement MODULE, which is always terminated by ENDMODULE, must not be confused with the flow logic statement MODULE (screen).

36) End module?
Sol: Indicates the termination of Module call present in screen flow logic.
Closes a module mod_name which is called by keyword “Module”.

Confused? Feel free to ask

saphelpdesk.co.inYour feedback is always appreciated.I will try to reply Ur queries as soon as time allows.
Regards,
SAPhelpdesk

0 comments:

Post a Comment

Your Ad Here
Write 4 Us ( Support me ) !!!