SAP---ABAP

Monday, November 26, 2007


Q) 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 object is saved under the name . the name identifies the cluster in memory. It ma 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 king.

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.

Q)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.


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


Program

-SUBMIT | {field>) [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.




>>NEXT>>






>>PREVIOUS>>




QUESTION DATABASE



Q) What are DATA CLUSTERS ?

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

Q)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.

Q)Problem : How to run a program in background?

Solution : Execute the Report a

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 immediately, uncheck delete after output, and new spool request.

Press enter.

Another screen appears with heading start time. You can press start immediately, then save. Now the Background job is scheduled for the given program.

Q)To View the status of background Job, The transaction code is SM37.

Execute from the resulting screen. A Job overview --> From the Job list select U’r program and select spool from the application tool bar a output Controller:List of Spool Requests a Select U’ r Spool request and click display icon from the overview screen. You can see the List.


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

Q)What are presentation and application servers in SAP?

A presentation server is actually a program named SAP GUI. Ex. It is usually installed on a user’s workstat on. Application server is a set of executables that collectively interpret the ABAP/4 programs and manage the input & output for them.

Q)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.

Q)Describe the syntax and function of the AUTHORITY CHECK command?

Ans :- AUTHORITY - CHECK OBJECT ID FIELD
ID FIELD

IF SY – SUBRC NE O .
The AUTHORITY – CHECK checks whether a user has the appropriate authorization to execute a particular activity.



>>>PREVIOUS>>>


Q) Version Management functions –


- Canceling changes - reset revised version to active version

- Storing changes - active version will be temporarily stored in version


Q)Switching changes - switch between active and revised versions Version catalog - list of all existing versions of an object

Q)Revised version - produced when we edit an existing object


- active version - produced when we activate an object

- Temporary version - produced when we copy the active version temporarily to the database with store version functions

- Historical versions - created when 1. Correctuib us created 2 cirrectuib us Released

Q)Table Buffering : Possible buffering types


- full buffering - either, whole table or none of the table is located in the buffer (Tables up to 30 kb done in client dependent fully buffered tables)

- Generic buffering - generic areas of the table are fully buffered.

- Generic key - left justified section of primary key of a table.

- Generic area - all records for which fields of generic key correspond

Single record buffering - records actually being accessed are loaded to buffers, large records where few records are accessed.



Q)Types of internal tables?Internal Tables ? Types ?


STANDARD table

Key access to a standard table uses a linear search. This means that the time required for a search is in linear relation to the number of table entries.

You should use inde operations to access standard tables.

SORTED table

Defines the table as one that is always saved correctly sorted.

Key access to a sorted table uses a binary key. If the key is not unique, the system takes the entry with the lowest index. The runtime required for key access is logarithmically related to the number of table entries.

HASHED table

Defines the table as one that is managed with an internal hash procedure

You can only access a hashed table using the generic key operations or other generic operations (SORT, LOOP, AND SO ON). Explicit or implicit index operations (such as LOOP . . . FROM oe INSERT itab within a LOOP) are not allowed.

INDEX table

A table that can be accessed using an index.

Index table is only used to specify the type of generic parameters in a FORM or FUNCTION. That means that you can’t create a table of type INDEX.

Standar tables and sorted tables are index tables.

Syntax :


DATA itab TYPE table type of line type [WITH UNIQUE/NON-UNIQUE KEY ] [Initial size n] [WITH HEADER LINE]







QUESTION DATABASE

The following events occur during the processing of the output list of a report program:

Event keyword Event

TOP-OF-PAGE Point during list Processing when a new page is started
END-OF-PAGE Point during list Processing when a Page Is ended

The following events occur during the display of the output list of a report program:
Event key work Event


AT LINE-SELECTION Point at which the user Selects a Line


AT USER-COMMAND Point at which the user Presses a Function key or enters a command in the
command Field.

AT PF ..nn.. Point at which the User presses the Function key with the function code PF With the selection screen, ABAP/4 offers an interactive element also for report programs. You can define a selection screen without having to bother about all the details required in dialog programming.

The selection screen is always processed directly after a report program is started. The user can enter field values and selection criteria on this screen.

The main purpose of the selection screen is to enable the user to control the database selections of the report program. If a report program is started from another ABAP/4 program with the SUBMIT statement (see Calling Reports), the selection screen objects also serve as a data interface, With a selection screen defined in the report program, you can enable the user to


Assign values to variables with the PARAMETERS statement

Determine selection criteria with the SELECT-OPTIONS statement

Q)How do you read selected lines of database table into an internal table in packages of predefined size.


SELECT * FROM SPGLI INTO TABLE ITAB PACKAGE SIZE ..N..

Where ‘n’ is variable.

Q)Name the WILDCARD characters which are used for comparisons with character strings & numeric

strings.‘%’ and ‘-‘



Q)How to specify a client for database table processing.

TABLES SPFLI .


SELECT * FROM SPFLI CLIENT SPECIFIED
WHERE MANDT BETWEEN ‘001’ AND ‘003’ .
. . .
ENDSELECT.

Q) Activation – During activation, the runtime object of aggregate object or tables is created. The runtime object is buffered so that the application program can access it quickly. Runtime object has information about the following objects of table

- domain – data elements – field definition – table definition


Q) Lock Mechanism – prevents a new database operation being started an existing one has been correctly completed. When conversion is done, lock is created automatically and released only when conversion is successful.

Clearing of locks

- restart adjustment – attempt is made to continue conversion at the point of termination cancel adjustment - lock entry is simply deleted from table.







Sunday, November 25, 2007

Working on Polymorphism >>>PRevious>>>



Then provide the logic.






Select display_method then provide the parameters for this method.






Go back to method then provide the logic.








Save it
check it

, and activate it






Provide SUBCLASS:









Press CREATE button.








Click on

SAVE .




Go to attribute provide the values that means provide super class name.







Go to methods we can see like this.







>>>previous>>>


Saturday, November 24, 2007



Working on Polymorphism >>>Next>>>


POLYMORPHISM:-


Polymorphism is a characteristic of being able to assign a different behavior or value in a subclass, to something that was declared in a parent class. For example, a method can be declared in a parent class, but each subclass can have a different implementation of that method. This allows each subclass to differ, without the parent class being explicitly aware that a difference exists.


CLAUSES REGARDING POLYMORPHISM:-


1.Allows one interface to be used for a general class of actions.

2.When objects from different classes react differently to the same procedural call.

3.User can work with different classes in a similar way, regardless of their implementation.

4.Allows improved code organization and readability as well as creation of “extensible” programs.

5.Although the form of address is always the same, the implementation of the method is specific to a particular class.


Go to SE24 T-code.






Press create button.






Press Save button



Provide methods.







Select the first method then provide the parameters for this method.







Go back to the methods then double click on the method name.

Then provide the logic.


>>>Next>>>




>>>PREVIOUS>>>


Question Database


Q) What are Reports and how do you setup Reports?

A report program reads and analyzes data from one or more database tables without modifying database. Usually, the result of such a program is in the form of list which is output to the screen or sent to a printer.


Q) What are the different types of programs?

I Include Program
M Module Pool

F Function Modules
S External Subroutines

1 On line program

Q) What are the events in report programming Explain?

The following events occur at runtime of a typical report program which uses logical databases. INITIALIZATION Point before the selection screen is displayed When you start a program in which a selection screen is defined (either in the program itself or logical database program), the system normally processes the selection screen first. If you want to execute a processing block before the selection screen is processed, you can assign it to the keyword INITIALIZATION.

AT SELECTION-SCREEN Point after processing user input on the selection screen while the selection screen is still active.

The event keyword AT SELECTION-SCREEN provides you with several possibilities to carry out processing blocks while the system is processing the selection screen.

START-OF-SELECTION point after processing the selection screen

The event START-OF-SELECTION gives you the possibility of creating a processing block after processing the selection screen and before accessing database tables using a logical database. You can use the processing block, for example, to set the values of internal fields or to write informational statements onto the output screen.


At the START-OF-SELECTION event, also all statements are processed that are not attached to an event keyword except those that are written behind a FORM-ENDFORM block.

GET table point at which the logical database offers a line of the database table ..table.. The most important event for report programs with an attached logical database is the moment at which the logical database program has read a line from a database table. To start a processing block at this event, use the GET statement as follows.

syntax GET ..table.. [fields ..List..]
after this statement, you can work with the current line of the database table ..table... The data is provided in the table work area ..table..

GET ..table.. LATE point after processing all tables which are hierarchically inferior to a specific data base table, use the event keyword GET as follows

GET ..table.. LATE [FIELDS ..list..]

In analogy to report programs that use only SELECT statements, the processing block of a GET ..table.. LATE statement would appear directly before the ENDSELECT statement in the SELECT loop for the database table ..table..

END-OF-SELECTION point after processing all the lines offered by a logical database.

To define a processing block after the system has read and processed all database tables of a logical database, use the keyword END-OF-SELECTION.


>>NEXT>>


>>>PREVIOUS>>>


Question Database


14) In how many ways we can modify SAP tables?


Groups of fields or individual fields can be added to SAP delivered tables using append structures, or customizing includes:


Ø Customizing includes are provided in SAP tables and structures to allow you to add fields to these structures/tables without modifying the tables themselves.


Ø Append structures allow you to add fields to SAP-provided structures and transparent tables that were not provided for in the standard version.


Customizing includes are supplied empty by SAP and are filled in by the customer with the help of special customizing transactions. These includes make it possible to extend (add fields to) tables without modifying the tables themselves and without the risk of additions being overwritten during a Release Upgrade.


· Names of customizing includes start with ‘CI_’. If a table does not contain a customizing include, you can still make additions by creating an Append structure. You cannot add your own ‘.INCLUDE CI_’ to an SAP table.


Append structures are intended for additions not provided for in the standard version of SAP tables via customizing includes. They are to be used with SAP transparent tables or structures, not with customer tables.


An Append structure is a structure assigned to exactly one table. However, a single table can have a number of append structures. It is recommended to use only one append structure in a table.


When an append structure is activated, its assigned table is also activated with all of the append structure fields. When a table including an append structure is activated, the append structure fields are found and added to the table.


Append structures cannot be deleted.


Append structures cannot be used with tables containing fields of data type VARC, LCHR, or LRAW because these data types must be the last field in a table.


Use the Append structures … push-button in the table display screen to add fields to SAP tables.


Fields contained in an Append structure are added to the SAP tables when an upgrade is performed and the appropriate tables are activated.


>>>NEXT>>>










>>>>previous>>>





Question Database




11) How many types of table buffering are there?



• Buffering types:

Single record: Only records actually being processed are moved into the buffer. This type of buffering preserves buffer space but requires more database hits in order to load the table. Recommended for large tables when only a few records need to be accessed.



Generic: A subset of the table records is loaded based on part of the primary key. Recommended if only certain “generic” areas of the table will be needed.


Full: Results in either all of the table or none of it being loaded into the buffer. Recommended for a) tables up to 30 K in size, b) larger tables where access is needed to many records, and c) tables against which attempts to access data will frequently yield a “no record found” result.



12) What is an index? What is the use of an index?


An index serves as a sorted copy of the table reduced to specific fields, with a pointer to the remaining fields.

Indexes accelerate the reading of tables when the system looks for records satisfying specific search criteria.

The system determines the most efficient index by which to select data for the specific request.



13) What is Database Utility?


• The Database (DB) Utility is a tool used in SAP to serve as a interface between the database management software (i.e., ORACLE, INFORMIX, DB2, INGRES, etc.) and the ABAP Dictionary.


It is used to:


– Convert data (i.e., change field lengths and data types, etc.)

– Activate objects in the ABAP Dictionary

– Create tables and indices

– Perform all standard table operations in the database that were entered in the ABAP Dictionary

• The DB Utility automatically writes the SQL commands necessary to create, change and delete tables and indexes in the physical database, and records the tables in the ABAP Dictionary.


• As the DB Utility is operating, a log file gets created which contains information on whether or not the conversion was successful and the point of failure during the conversion if it was not successful.


• The DB Utility can be run either online or in the background.


• You can also manually run the DB Utility from any ABAP Dictionary screen under the UTILITIES menu or transaction SE14.


>>>NEXT>>>









>>>PREVIOUS>>>




Question Database




Q5) what is a domain?


A domain specifies the technical characteristics and the allowed values of a field.

Domains are linked to fields via data elements. In other words, fields are assigned to data elements, and data elements are assigned to domains. You cannot directly assign fields to domains.

The technical characteristics of a field are the field’s type and length. These are also referred to as the field’s format.

The allowed values of a field define what is acceptable input for that field. These may be listed explicitly or may be specified by reference to a value table.

Domains can exist independently in the ABAP Dictionary.

Just as multiple fields may be assigned to the same data element, multiple data elements may be assigned to the same domain.

As with data elements, pre-defined domains exist in the system and are available for your use. If an SAP R/3-supplied domain matches the characteristics you require, use the pre-defined domain. If you wish to change the domain’s allowed values, however, you must create your own domain.

In addition to the characteristics listed previously, domains can also specify a fields output characteristics, such as output length and whether or not lowercase letters are permitted for that domain.

By defining valid values for a domain, automatic validation is provided for any fields that point to that domain. This includes validation at the ABAP Dictionary level (if a program tries to insert invalid data, an error will occur) as well as at the screen level (users will not be permitted to enter invalid data).

Additionally, users can obtain a list of possible entries (for fields pointing to domains with allowed values) by pressing function key F4.




Q6) what is a foreign key?


A foreign key is a field (or combination of fields) that represents the primary key of another table.



Foreign keys are used for:


– Maintaining data integrity

– Providing additional texts in the online help system

– Creating other dictionary objects that are defined over multiple tables
(such as views)



Q7) what is a value table?


The table containing the set of allowed values attached to a domain.



Q8) what is a check table?


The table that is referenced by a foreign key. A check table is either identical to a value table, or is another table containing a subset of the records in a value table.



Q9) what is a foreign key table?


The table containing fields that are the primary key of the other table. The foreign key table is also known own as the “dependent” or “child” table.

When creating foreign key relationships, you should always specify the cardinality of that relationship. Here is a reminder of the possible values for each side of the n : m notation that SAP uses to specify cardinality.


Q10) How many table types are there in SAP ABAP dictionary?



There are 5 different table types in the SAP ABAP Dictionary:


* Transparent tables

* Structures

* Pool tables

* Cluster tables

* Views




>>>NEXT>>>






>>>PREVIOUS>>>




Question Database




Q1) what is a data dictionary?


A data dictionary is a centralized storage location for information about the data that is stored in a database. This information is often called “metadata” (data about data).

A data dictionary provides answers to questions


such as:


* What data is contained in the database?

* What are the attributes of this data: name, length, format, etc.?

* What relationships exist among different data objects?



Q2) what is SAP’s data dictionary?


SAP’s data dictionary is called the ABAP Dictionary.


The ABAP Dictionary:


– Enforces data integrity

– Manages data definitions without redundancy

– Is tightly integrated with the rest of the ABAP Workbench



Q3) what is database utility?



The database utility provides the interface between the ABAP Dictionary and the underlying database management system (DBMS). It supports the creation of tables and secondary indices in the database both online and in the background.

Whenever you make a change to a dictionary object that affects the underlying database, the database utility is activated. Usually it works silently behind the scenes, but occasionally the database utility will prompt you for information. This occurs when an error is encountered or when existing data must be converted.

The database utility provides the interface to the DBMS by automatically generating the Data Definition Language (DDL) that the DBMS understands.



Q4) what is a data element?


A data element provides a meaningful description for a field. You will hear it called a semantic domain. The data element description appears beside a field in a table definition. These descriptions are language-dependent.


>>>NEXT>>>




>>>PREVIOUS>>>


Question Database


Q) What is a table? What is the difference between structure and table?

Answer: Table consists of rows and columns where we store the real world data. Main difference between structure and Table –

When we create table and activate it, it will be created both in ABAP dictionary and under lying physical database. Table can hold data. Where as structure can not hold data. It is created only in the ABAP dictionary. We can declare objects that are of structure type and make use of them to hold data in run time.


Q)Have you ever created custom database tables (Z tables) in any project?

Answer: This is the most common question being asked in any interview. For this you can say YES. I will give you a real time example. There is a report program. You want to maintain the log of execution for that report. That means you want to maintain user details who has executed the report. When they have executed and what time?

For that you will create a custom table with fields like user id, date, time etc. When ever a particular report is executed, the custom table is updated with the details mentioned above. This is the simple scenario. Like this, we can create custom tables to suit our requirements.

Q)What is a logical database?


Answer: This is one of the most commonly asked questions in a SAP technical interview. A logical database is simply an ABAP program that combines the contents of database tables. A logical database is linked to an ABAP report program as one of the program attributes.


It supplies the ABAP report program with a set of hierarchically structured table entries derived from different database tables. This saves the developer from having to program the data retrieval. The logical database term covers both the program and the dataset.


Q). In SAP how can a user view a list of all changed entries in customizing tables?

Answer: For viewing changed entries in a user has to turn on table logging, once this is done, one can view each changed entry to the customizing table. SAP shows information by system, date, time, user, the old entry, and the new entry; a list of all prior modified data is also shown by the system.


>>>NEXT>>>









QUESTION Database


Q) What is ASAP methodology?

Answer. ASAP stands for Accelerated SAP (ASAP). ASAP is a software tool used for project management in SAP implementations. Normally, any SAP implementation involves various phases. ASAP helps in guiding a SAP implementation project. Thus from the initial stages to the "Go Live" stage, ASAP helps in streamlining the entire SAP implementation process.

One of the most asked question in a SAP interview is whether it is possible to have a self defined transaction code in SAP. The answer to the question is simple and if given tactfully can impress the interviewers.

Q) In SAP, is it possible to have a self-defined transaction code?

Answer: To start with, yes, self-defined reports, transactions or functions are possible within SAP. There might be numerous reasons why a company might go in for customized transaction codes or for that matter reports. To cater to this demand, SAP allows creation of user-defined transaction codes.

Creating a transaction code allows the user to speed up access to specific reports/programs as the user no longer needs to use transaction code [SA38]. Thus, instead of using T-Code SA38, then entering the program name or report name and pressing execute, the same can be done directly through a pre-defined T-Code. The user can then simply use a transaction code, which will automatically open the program. In SAP customized T-codes can be created through transaction code [SE93].

Q) What is ABAP data dictionary?

Answer. A data dictionary is central source information for data in a data management system. Its function is creation and management of data definitions.The data dictionary objects are automatically created in the database.

Q) How many types of tables are there in SAP?

Answer. There are three types of tables

1) Transparent tables
2) Pooled tables
3) Cluster tables

Table pools (pools) and table clusters (clusters) are special table types in the ABAP Dictionary. The data from several different tables can be stored together in a table pool or table cluster. Tables assigned to a table pool or table cluster are referred to as pooled tables or cluster tables.

A table pool or table cluster should be used exclusively for storing internal control information (screen sequences, program parameters, temporary data, and continuous texts such as documentation). Data of commercial relevance is usually stored in transparent tables.

Transparent Table: Exists with the same structure both in dictionary as well as in database exactly with the same data and fields. Pooled Table: Pooled tables are logical tables that must be assigned to a table pool when they are defined. Pooled tables are used to store control data. Several pooled tables can be combined in a table pool. The data of these pooled tables are then sorted in a common table in the database.
Cluster Table: Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can be used to store control data. They can also be used to store temporary data or texts, such as documentation.

A transparent table is a table that stores data directly. You can read these tables directly on the database from outside SAP with for instance an SQL statement. I.E you can use Native SQL also to read the tables along with Open SQL. Transparent table is a one to one relation table i.e. When you create one transparent table then exactly same table will create in data base and if is basically used to store transaction data.

A clustered and a pooled table cannot be read from outside SAP because certain data are clustered and pooled in one field. I.E they must be read using OPEN SQL only. You cannot read them using native SQL.

You can create secondary indexes on transparent tables where as secondary indexes can’t be created on pooled and cluster tables.


>>>NEXT>>>






Maintaining Translations for Work item texts and
Outcome names


In this tutorial, we would look into a simple method of translating Work item texts and step names to the desired language.


Let us open any existing workflow definition.







Check the same workflow definition by logging in German Language:







You can observe that the text remains in the English language, whereas “Workflow Started” is translated as “Workflow gestartet” (As the SAP has already provided translation for this)


Now to translate the text to German,

Click on Extras -> Translation -> Translation (As shown in the screenshot below):









Following pop-up appears: Select German from the list box.









Now a screen with all the workflow steps and outcome names are displayed for maintaining the translation.







For our testing purposes, let us maintain the German text for the first two step types.










Save and activate.


Now logon in German Language and check the workflow definition. You can observe that for the two step types, the text is available in German.










Displaying Graphics using an ABAP Program


“I would like to explain about a simple report program to display graphics. The SAP Graphics can be used for various business purposes”.


In this article I am explaining about a simple Sales analysis on a yearly basis.


*&---------------------------------------------------------------------*
*& Report ZGRAPH_TEST
*&
*&---------------------------------------------------------------------*
REPORT ZGRAPH_TEST.
DATA: BEGIN OF TAB OCCURS 5,
CLASS(5) TYPE C,
VAL1(2) TYPE I,
VAL2(2) TYPE I,
VAL3(2) TYPE I,
END OF TAB.
DATA: BEGIN OF OPTTAB OCCURS 1,
C(20),
END OF OPTTAB.
MOVE: 'fan' TO TAB-CLASS,
12 TO TAB-VAL1, 8 TO TAB-VAL2, 15 TO TAB-VAL3.
APPEND TAB.
CLEAR TAB.
MOVE: 'cool' TO TAB-CLASS,
15 TO TAB-VAL1, 10 TO TAB-VAL2, 18 TO TAB-VAL3.
APPEND TAB.
CLEAR TAB.
MOVE: 'DA' TO TAB-CLASS,
17 TO TAB-VAL1, 11 TO TAB-VAL2, 20 TO TAB-VAL3.

APPEND TAB.

CLEAR TAB.

OPTTAB = 'FIFRST = 3D'. APPEND OPTTAB. "// Grafik-Typ
OPTTAB = 'P3TYPE = TO'. APPEND OPTTAB. "// Objektart
OPTTAB = 'P3CTYP = RO'. APPEND OPTTAB. "// Farben der Objekte
OPTTAB = 'TISIZE = 2'. APPEND OPTTAB. "// Haupttitelgröße
OPTTAB = 'CLBACK = X'. APPEND OPTTAB. "// Background Color

CALL FUNCTION 'GRAPH_MATRIX_3D'


EXPORTING
COL1 = '1997'
COL2 = '1998'
COL3 = '1999'
DIM2 = 'Products'
DIM1 = 'Years'
TITL = 'Sales In Rs. Crores'
TABLES
DATA = TAB
OPTS = OPTTAB
EXCEPTIONS
OTHERS = 1.



LEAVE PROGRAM.



Results :


Execute the report program for an output shown below.









Click on Overview for detailed view.







To display more detailed view.