SAP LDB SELECTIONS EXAMPLE
Get Example source ABAP code based on a different SAP table
ABAP_LDB - Example of a Selection Include
A logical database
* Include DBTEST_LDBSEL
* It will be automatically included into the database program
*-----------------------------------------------------------*
* If the source is automatically generated,
* 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
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE LFB1.
SELECTION-SCREEN FIELD SELECTION FOR TABLE LFC1.>
This automatically created selection include can be completed, for example, as follows:
SELECT-OPTIONS slifnr FOR lfa1-lifnr.
SELECT-OPTIONS sbukrs FOR lfb1-bukrs.
SELECT-OPTIONS sgjahr FOR flc1-gjahr.
SELECT-OPTIONS sbelnr FOR bkpf-belnr.
* User-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