Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Obsolete Language Elements →  Obsolete Processing of External Data →  Logical Databases (Obsolete) →  Logical Databases - Examples 

Example of a Selection Include

A logical database TEST_LDB has the structure shown in Example of a Logical Database. The generated proposal for the selection include is then as follows:

*-----------------------------------------------------------*
* Include DBTEST_LDBSEL
* It will be automatically included into the database program
*-----------------------------------------------------------*
* If the source is automatically generated,
* please perform the following steps:
* 1. Replace ? by suitable names (at most 8 characters).
* 2. Activate SELECT-OPTIONS and PARAMETERS (delete stars).
* 3. Save source code.
* 4. Edit database program.
*
* Hint: Syntax check is not possible within this include!
* It will be checked during syntax check of database program.
*-----------------------------------------------------------*

* SELECT-OPTIONS :  ?  FOR LFA1-LIFNR.

* Parameter for search pattern selection:
* PARAMETERS p_sp AS SEARCH PATTERN FOR TABLE LFA1.

* SELECT-OPTIONS :
*                   ?  FOR LFB1-LIFNR,
*                   ?  FOR LFB1-BUKRS.

* SELECT-OPTIONS :
*                   ?  FOR LFC1-LIFNR,
*                   ?  FOR LFC1-BUKRS,
*                   ?  FOR LFC1-GJAHR.

* SELECT-OPTIONS :
*                   ?  FOR BKPF-BUKRS,
*                   ?  FOR BKPF-BELNR,
*                   ?  FOR BKPF-GJAHR.

* Enable DYNAMIC SELECTIONS for selected nodes :
* Enable FIELD SELECTION for selected nodes :

If the nodes LFA1 and LFB1 are defined for dynamic selections and the node LFC1 defined for field selections, the following additional program lines are generated:

SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE LFA1.
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE LFB1.
SELECTION-SCREEN FIELD SELECTION FOR TABLE LFC1.

This automatically generated selection include can be complete, for example, as follows:

* Selection criteria:
  SELECT-OPTIONS slifnr  FOR lfa1-lifnr.
  SELECT-OPTIONS sbukrs  FOR lfb1-bukrs.
  SELECT-OPTIONS sgjahr  FOR flc1-gjahr.
  SELECT-OPTIONS sbelnr  FOR bkpf-belnr.

* Self-defined parameters:
  PARAMETERS pstida LIKE sy-datum FOR NODE bkpf.

* Dynamic selections for LFA1 and LFB1:

  SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE: lfa1, lfb1.

* Field selection for LFB1 and LFC1:
  SELECTION-SCREEN FIELD SELECTION FOR NODE: lfb1, lfc1.

A selection is made from the available selection criteria and is given a name. The additional parameter pstida is declared and associated with the node BKPF. Dynamic selections are defined for the tables LFA1 and LFB1. The tables LFB1 and LFC1 are defined for field selections.

Other versions: 7.31 | 7.40 | 7.54