Credits

Thursday, February 10, 2011

SAP ABAP Report Programming Questions 4

You can group any complex internal data objects of an ABAP/4 program together in data clusters and store them temporarily in ABAP/4 memory or for longer periods in databases. You can store data clusters in special databases of the ABAP/4 Dictionary. These databases are known as ABAP/4 cluster databases and have a predefined structure.Storing a data cluster is specific to ABAP/4. Although you can also access cluster databases using SQL statements, only ABAP/4 statements are able to decode the structure of the stored data cluster.

Describe the functions of the debugger screen.

- Single step(F5) - Use this option to step through the program statement by statement. This allows you to branch into subroutines and function modules, and to execute these routines step by step as well. Once a subroutine or function module has been processed, control returns to the statement following the CALL FUNCTION or PERFORM statement.

- Execute(F6)- Use this option to process a program line by line. All of the statements on the current line are processed in a single step. If you are positioned on a line that calls a subroutine and you choose Execute, the Debugger processes the whole subroutine and then moves on to the line following the subroutine call. This allows you to jump through the statements within the subroutine.

- Return(F7) - The Debugger returns from a routine to the point at which control returns to the main program. Use this option to return from a subroutine, function module, or called program to the calling program.

- Continue(F8)- Use this option to process the program up to the next dynamic or static breakpoint or up to the cursor position. If there are no more breakpoints in the program and no cursor has been set, the system exits debugging mode and executes the rest of the program normally.

Caution :See to that the list with does not exceed 255 columns ,If it exceeds the extra columns will be truncated in Background

What are presentation and application servers in SAP?

A presentation server is actually a program named Sapgui.exe. It is usually installed on a user’s workstation.

Application server is a set of executables that collectively interpret the ABAP/4 programs and manage the input & output for them.

In an ABAP/4 program how do you access data that exists on a presentation server v/s on an application server?

For presentation server use UPLOAD or WS_UPLOAD function modules.

For application server use OPEN DATASET, READ DATASET and CLOSE DATASET commands.

Describe the syntax and function of the AUTHORITY CHECK command?

Ans :- AUTHORITY – CHECK OBJECT

ID FIELD

ID FIELD

…

IF SY-SUBRC NE 0.

The AUTHORITY-CHECK checks whether a user has the appropriate authorization to execute a particular activity.

Explain the EXPORT and IMPORT commands? How can you pass more than one group of data by using IMPORT commands?

EXPORT :-

To read data objects from an ABAP program into ABAP memory, use the following statement:

Syntax

EXPORT [FROM ] [FROM ] ... TO MEMORY ID .

This statement stores the data objects specified in the list as a cluster in memory. If you do not use the option FROM , the data object is saved under its own name. If you use the FROM option, the data objet is saved under the name . The name identifies the cluster in memory. It may be up to 32 characters long.

The EXPORT statement always completely overwrites the contents of any existing data cluster with the same name .

IMPORT :-

To read data objects from ABAP memory into an ABAP program, use the following statement:

Syntax

IMPORT [TO ] [TO ] ... FROM MEMORY ID .

This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO option, the data object in memory is assigned to the data object in the program with the same name. If you do use the option, the data object is read from memory into the field . The name identifies the cluster in memory. It may be up to 32 characters long.

You do not have to read all of the objects stored under a particular name . You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name , SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name , SY-SUBRC is always 0, regardless of whether it contained the data object . If the cluster does not contain the data object , the target field remains unchanged.

Explain the READ LINE and MODIFY LINE commands.

READ LINE :- Use the statements READ LINE and READ CURRENT LINE to read data from the lines of existing list levels. These statements are closely connected to the HIDE technique.

MODIFY LINE :- To modify the lines of a completed list from within the program, use the MODIFY LINE statement.

What are the differences between calling a program, transaction ‘with return’ and ‘without return’ and how can each be accomplished?

· Program

-SUBMIT |() [AND RETURN] [].

If you use AND RETURN, the system stores the data of the calling executable program and returns to the calling after processing the called program. The system resumes executing the calling program at the statement following the call.

If you omit the AND RETURN addition, all data and list levels of the calling program (the entire internal session) are deleted. After the called executable program has finished, control returns to the level from which you started the calling program.

· Transaction

-CALL TRANSACTION [AND SKIP FIRST SCREEN] [USING ].

This statement saves the data of the calling program, and starts transaction . At the end of the transaction, the system returns to the statement following the call in the calling report.

-LEAVE TO TRANSACTION [AND SKIP FIRST SCREEN].

This statement ends the calling program and starts transaction . This deletes the call stack (internal sessions) of all previous programs. At the end of the transaction, the system returns to the area menu from which the original program in the call stack was started.

What are the differences between the parameter SET and GET?

SET PARAMETER ID FIELD .

This statement saves the contents of field under the ID in the SAP memory. The code can be up to 20 characters long. If there was already a value stored under , this statement overwrites it. If the ID does not exist, double-click in the ABAP Editor to create a new parameter object.

GET PARAMETER ID FIELD .

This statement fills the value stored under the ID into the variable . If the system does not find a value for in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.

WHAT are the commands that allow you to process sequential file? And what is their syntax?

· READ DATASET (reading) and TRANSFER (writing)

· OPEN DTASET for in mode at POSITION MESSAGE

· READ DATASET INTO

· CLOSE DATASET

· DELETE DATASET

TRANSFER to

What is the difference between opening a dataset for input, output, appending?

· FOR OUTPUT

Opens the file for writing if exists it is overwritten if not then it is created.

· FOR INPUT

Opens an existing file for reading.

· FOR APPENDING

Opens the file for writing at the end of the file .If it does not exist, it is

created, if opened, you return to the end.

When an internal table is created, the settings criteria for the value of occurs?

The objective of setting the value of an occurs for an internal table is a question of optimization. The following facts should be taken into account when making such decision.

1) The complete data area of a program is 64000 bytes.

2) The initial size declared is kept in roll area (quicker access to program)

You should also analyze the expected volume and access rates before making the decision.

Define "Check " statements, how it works?

To terminate a single loop pass conditionally, use the CHECK statement in the statement block of the loop.

If the condition is not true, any remaining statements in the current statement block after the CHECK statement are ignored, and the next loop pass starts. can be any logical expression.

Explain Field Group(extract dataset)?

An extract dataset consists of a sequence of records. These records may have different structures. All records with the same structure form a record type. You must define each record type of an extract dataset as a field group, using the FIELD-GROUPS statement.

FIELD-GROUPS .

This statement defines a field group . A field group combines several fields under one name. For clarity, you should declare your field groups at the end of the declaration part of your program.

A field group does not reserve storage space for the fields, but contains pointers to existing fields. When filling the extract dataset with records, these pointers determine the contents of the stored records.

What is the difference between Move & assign statement?

Move :- To assign the value of a data object to a variable , use the following statement:

MOVE TO .

or the equivalent statement

= .

The contents of remain unchanged. does not have to be a variable - it can also be a literal, a text symbol, or a constant. You must always specify decimal points with a period (.), regardless of the user’s personal settings.

Multiple value assignments in the form

= = = .

Assign :- ASSIGN TO .

When you assign the data object, the system checks whether the technical attributes of the data object correspond to any type specifications for the field symbol . The field symbol adopts any generic attributes of that are not contained in its own type specification. Following the assignment, it points to in memory.

How do you run a report for a row in table?

Using Graphics Multiplexer. There is an option some thing similar to screen capture which captures data only. Using that data you can draw graphs (3D and 2D). This option is available all the time from Menu! -> Generate Graphics which captures the data then you need to drag and select the data you want to draw a graph on. Once you select you can click on Graphics, which launches graphics multiplexer.

Memory Management

SAP memory (Global Memory): - is available to a user during the entire duration of a terminal session. Its contents are retained across transaction boundaries as well as external and internal sessions.

External session: - when user logs on to R/3 system, the system creates a new terminal session called external session. E.g. System à Create Session.