Writing ABAP Queries
Content
Introduction
Creating Functional Areas using a Logical DB
Creating Functional Areas Without a Logical DB
Creating the User Group
Creating The Query
Ranked List and Statistics
Data Retrieval Using Program
Authorizations
  Writing ABAP Queries
-Data Retrieval Using Program-
 
Page 7 Of 8
 

Retrieving Data Using Program

Sometimes a situation arises when an ABAP query’s automatic data retrieval facility is not enough to get the desired results. In that case, the steps up to creating the functional area are the same. Only difference is that on the Title and Database screen specify a structure in the field Table and select the field Data Retrieval Using Program.

The default report name given by the system can be overwritten.

This report needs to be defined before hand – because it is used as a model while generating the query report. Thus the report itself remains unchanged but based on that another one is created.

Note: Ensure that the report is free of syntax errors and has the same fixed point arithmetic settings as the functional area.

General Format Of the Report

A typical report of this type will have the following format:

Report <report name>.

Tables: <list of dictionary structures to be used>.

Parameters: <name of parameters>.

Select-options: <name of select options>.

Data: < all internal tables>.

*<query head> This comment should always be after data declarations.

Beginning of a loop to retrieve each record and place it in the field string tab.

Select, do-enddo, loop, etc.

<code to format the data>.

*<query body> This comment should always be the last statement in the loop.

At this stage the data will come into the field string.

Endselect, enddo, endloop.

 
Stats Box
Vendor Listings (9)
Jobs (3)
Resumes (3)
Tutorials (18)
Articles (22)
Code Snippets (1)
CBTs (17)
Books (4)
Online Training (15)
Latest 5 Tutorial
SAPscript
SAP Mobile Engine
Integrating XML into SAP Business Connector
Lotus Notes Integration
SAP Data Archiving
 
Copyright © 2007 SapDox.com. All rights Reserved.