Thursday, February 10, 2011

SAP ABAP Report Programming Questions 5

How do you set up background jobs in SAP? What are the steps? What are events driven batch jobs?

  • - Create a job using function module JOB-OPEN
  • - Collect the job specifications.
  • - Add a job step to the job with the function module JOB-SUBMIT.
  • - Close the job and pass it to Background processing system for execution with the function module JOB-CLOSE
  • - Types = System events – triggered when activation of new operation mode takes place
  • - User events - Triggered from ABAP/4 or external program.
  • - Triggering an event notifies the background processing that named condition has been reached. The Background system reacts by starting any jobs that were waiting for the event.

Transaction codes related to background jobs creation and processing are :-

SM36(Job creation)

SM37(Job selection and execution).

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.

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.

Transferring SPA/GPA Parameters to Transactions

To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-related SAP memory. You use the SAP memory to transfer values between programs beyond the borders of transactions. A user can access the values stored in the SAP memory during one terminal session for all modes used in parallel.

To fill an SPA/GPA parameter, use:



To read an SPA/GPA parameter into an ABAP program, use:



What is the difference between Commit-Work and Rollback-Work tasks ?

- Commit-Work statement “performs” many functions relevant to synchronized execution of tasks. Rollback-Work statement “cancels” all requests relevant to synchronized execution of tasks.

What are the different database integrities ?

  • - Semantic integrity

- Relational integrity

- Primary key integrity

- Value set integrity

- Foreign key integrity and

- Operational integrity.

What is SAP locking ?

- It is a mechanism for defining and applying logical locks to database objects.

What does a lock object involve ?

- The tables

- The lock argument.

What are the different kinds of lock modes ?

- Shared lock

- Exclusive lock

- Extended exclusive list.

How can a lock object be called in the transaction ?

  • - By calling Enqueue and Dequeue in the transaction.

What are the events by which we can program “help texts” and display “possible values lists” ?



What are function modules ? Types of parameters ?

- Function modules are general-purpose library routines that are available system-wide.

- In general, function module can have four types of parameters:

- EXPORTING: for passing data to the called function

- IMPORTING: for receiving data returned from the function module

- TABLES: for passing internal tables only, by reference (that is, by address)

- CHANGING: for passing parameters to and from the function

How to send a report to the printer instead of displaying it on the screen ?

- We can send a report to the printer instead of displaying it on the screen. To do this, use the keywords TO SAP-SPOOL:


How can we send data to external programs ?

- Using SPA/GPA parameters (SAP memory)

- Using EXPORT/IMPORT data (ABAP/4 memory)

What are the differences between SELECT-OPTIONS,VARIANTS AND PARAMETERS?

To enter values for variables on the selection screen, you must define the variables using the PARAMETERS statement.

To enter a range of values for the variables on the selection screen we use SELECT-OPTIONS statement.

If you want to run the same report program with the same selections at regular intervals (for example, for monthly sales statistics), In, ABAP/4 offers you combine the desired values for all these selections in one selection set. Such a selection set is called a VARIANTS.

What is SPA / GPA ? When do you use it?

To fill the input fields of a called transaction with data from the report, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-related SAP memory. You use the SAP memory to transfer values between programs. A user can access the values stored in the SAP memory during one terminal session for all modes used in parallel.

Usually, the input fields on the initial screen of a transaction are connected to SPA/GPA parameters. If you fill these parameters from within your program before calling the transaction, the system fills the input fields with the corresponding values.

Why and how do you display a message? What are the message types?

An ABAP/4 module lets the system know that an error has occurred by issuing information,error or warning messages. you can also use success messages when a particular action is performed successfully. When the user presses ENTER, the current process is interrupted. The system returns the user to the SAP main menu using Abend message.

Message is displayed using MESSAGE Xnnn, where X is the type of the message and nnn is the number of the message.

You have to declare the Id of the message class in the program using

MESSAGE-ID cc,where cc is the message class.

How and where do You create Message class?

You can create a message class from two places in the system:

  • 1) From an Object class object list (in the Object Browser)

2) From an ABAP/4 module (in the ABAP/4 editor)

What do you define in the Data element and Domain?

  • For Data Element
  • The information includes the field's representation on the screen in the form of FIELD TEXTS, COLUMN CAPTIONS in list outputs of the table contents and the format of the output via PARAMETER IDS and Online field documentation.
For Domain
  • Data Type,Field Length and the allowed data values are defined .

What is the difference between a pool table and a transparent table?

  • Transparent Table :
  • A tran table has a one to one relataionship in the database. The table in the dictionary has the same name, same no of fields, and the fields have the same name as in the R3 table defn. A transparent tabel has application data (Master and Transaction).
  • Pooled Table :

A pool table has many to one relation with the table in the database. For one table in the database there r many tables in the dictionary. Tha table in the database has a diff name than in the table in the data dict, it has diff no of fields and field names are different. A pooled table is stored in the pool at the database level. A table poo is a databse table with a special struct that enables the data of many R3 tables to be stored in it. It can hold only pooled tables.

What are field symbols and field groups? Have you used component idx of structure with field groups?

  • A field symbol does not physically reserve space for a field, but points to a field which is not known until runtime of the program. Field symbols are comparable to the concept of pointers as used in the programming language C.

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.

What is the step by step process to create a table in data dictionary?

  • 1. Selecting the table fields
  • 2. Maintaining foreign keys
  • 3. Creating secondary indexes (optional)
  • 4. Maintaining technical settings
  • 5. Activating a table

  • What is the advantage of structures and how do you use them in Abap/4 programs?
  • A structure is defined in the ABAP/4 Dictionary like a table and can be accessed from ABAP/4 programs. Any change to the definition of the structure in the ABAP/4 Dictionary is automatically implemented in all programs.
  • While data in tables is stored permanently in the database, structures contain data only during the runtime of a program.
  • Structures are used in abap/4 programs to transfer data between programs as it is globally defined.Structures are used in particular for defining data at the interface between module pools and screens and for standardizing parameters for function modules.

What does an extract statement do in the Abap/4 program?

  • With the first EXTRACT statement of a report, the system creates the extract dataset and adds the first extract record. With each subsequent EXTRACT statement, the system adds another extract record to the extract dataset.

What is a collect statement and how is it different from the append statement?

  • To fill an internal table with lines which have unique standard keys, we use the COLLECT statement.
  • If an entry with the same key already exists, the COLLECT statement does not append a new line as APPEND statement, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry.
  • What is an open SQL vs Native SQL.
  • Open SQL allows you to access all database tables known to the SAP system, regardless of the database manufacturer. Sometimes, however, we may want to use database-specific SQL statements called Native SQL in your ABAP/4 program.
  • To avoid incompatibilities between different database tables and also to make ABAP/4 programs independent of the database system in use, SAP has created a set of separate SQL statements called Open SQL. Open SQL contains a subset of standard SQL statements as well as some enhancements which are specific to SAP.
  • A database interface translates SAP's Open SQL statements into SQL commands specific to the database in use. Native SQL statements access the database directly.
  • What does an EXEC SQL statement do in ABAP? What is the disadvantage of using it?
  • To use a Native SQL statement, it must be preceded by an EXEC SQL statement and concluded by an ENDEXEC statement.
  • An ABAP/4 program with Native SQL statements does not generally run with different databases.

  • What are the events used in ABAP4?
    The events are
    • · TOP-OF-PAGE
    • · END-OF-PAGE
    • · AT PF
    • · GET
    • · GET LATE.
    • · AT User Command

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