Scrol

SAP Trainings contact sap.sreeram@gmail.com or 091-9916083157, 001-210-399-8414

Memory Management


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.

Internal session: - created by calling a transaction (with CALL TRANSACTION), a dialog module (with CALL DIALOG) or a report (with SUBMIT or RETURN).

For external session: - internal sessions are allowed.

Roll area: - Data areas of used programs are created in roll areas for each internal session.

Posting data between internal sessions: - EXPORT TO MEMORY and IMPORT FROM MEMORY.

Main program group: - Created when exporting an internal session.

Additional program group: - If a function module belonging to a function group not so far loaded, additional program group is created.

Subroutine call: - When external subroutine is called, system loads the relevant program and adds it to the program group of calling program.

Work areas: - Both table & common workareas with the same name are created once for each program group and then shared by all programs in the group.

List system: - Consists of basic list and all details list belonging to basic list assigned to exactly one screen level.

User interface: - Only program has its own user interface. Internal sessions interface is initially empty. Special user interface has to be activated using SET PF-STATUS statement.

ABAP/4 memory: - Retained only during the lifetime of an external session.

Data cluster: - Group of several data objects.

Data objects: - Units of data, which a program processes at runtime.

SAP ABAP general FAQ'S


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 <object name>
              ID <name1> FIELD <f1>
              ID <name2> FIELD <f2>
                      …
              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 <f1> [FROM <g 1>] <f 2> [FROM <g 2>] ... TO MEMORY ID <key>.

This statement stores the data objects specified in the list as a cluster in memory. If you do not use the option FROM <f i >, the data object <f i > is saved under its own name. If you use the FROM <g i > option, the data objet <g i > is saved under the name <f i >. The name <key> 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 <key>.

 

IMPORT :-

To read data objects from ABAP memory into an ABAP program, use the following statement:
Syntax
IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.

This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO <g i > option, the data object <f i > in memory is assigned to the data object in the program with the same name. If you do use the option, the data object <f i > is read from memory into the field <g i >. The name <key> 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 <key>. You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC is always 0, regardless of whether it contained the data object <f i >. If the cluster does not contain the data object <f i >, 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 <rep>|(<field>) [AND RETURN] [<options>].
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 <tcod> [AND SKIP FIRST SCREEN] [USING <itab>].
This statement saves the data of the calling program, and starts transaction <tcod>. At the end of the transaction, the system returns to the statement following the call in the calling report.
-LEAVE TO TRANSACTION <tcod> [AND SKIP FIRST SCREEN].
This statement ends the calling program and starts transaction <tcod>. 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 <pid> FIELD <f>.
This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
GET PARAMETER ID <pid> FIELD <f>.
This statement fills the value stored under the ID <pid> into the variable <f>. If the system does not find a value for <pid> 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 <dataset name> for <input output appending> in <binary text > mode at POSITION <position>   MESSAGE <field>
·         READ DATASET <dataset name > INTO <field>
·         CLOSE DATASET <dataset name>
·         DELETE DATASET <dataset name>
      TRANSFER <field> to <dataset name>


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)
3)      Data entered that exceeds the initial size stores in the roll file (Slower 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 <condition> 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. <condition> 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 <fg>.
This statement defines a field group <fg>. 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 <f1> to a variable <f2>, use the following statement:
MOVE <f1> TO <f2>.
or the equivalent statement
<f2> = <f1>.
The contents of <f1> remain unchanged. <f1> 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
<f4> = <f3> = <f2> = <f1>.

Assign :- ASSIGN <f> TO <FS>.
When you assign the data object, the system checks whether the technical attributes of the data object <f> correspond to any type specifications for the field symbol <FS>. The field symbol adopts any generic attributes of <f> that are not contained in its own type specification. Following the assignment, it points to <f> 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.

SAP ABAP : Problem:How to run a program in background?


Problem:How to run a program in background?
Solution :Execute the Report 
In the selection screen :After filling the screen fields press F9.
A screen appears requesting U to print the Background Parameters
*Enter the output device(Eg HPLJ /SAP2 etc)
*In the spool options Uncheck Print immedietly,Uncheck delete after output,and new spool request.
Press enter.
Another screen appears with heading start time .U can press start immly ,then save
Now the Background job is scheduled for the given program .

To View the status of background Job,The transaction code is SM37.
Execute from the  resulting screen .Job overview -->From the Job list select U’r program and select Spool from the application toolbarOutput Controller :List of Spool RequestsSelect U’r Spool request and click Display  icon from  the overview screen .
U will be displayed with the List.
Caution :See to that the list with does not exceed 255 columns ,If it exceeds the extra columns will be truncated in Background

SAP Debugging


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.
-    Tables - Display the contents of internal tables.