Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

How to initialize a selection-screen elements of a LDB ?

At the AT SELECTION-SCREEN OUTPUT event that particular field  should be initialized .First you need to know the name of that field and to get the name place the cursor on that particular field then press F1 and in technical atributes you will get that fields name. In the following example F1S LDB is used  and Departure Date's lower value is initialized to sy-datum.

REPORT ZLDB.
NODES : spfli ,sflight , sbook.
AT SELECTION-SCREEN OUTPUT.
fldate-sign = 'I'.
fldate-option = 'EQ'.
fldate-low = sy-datum.
APPEND fldate.

Normal LDB (F1S) screen of  -

 
LDB screen with  initialized value of field Departure Date (fldate) --

How to add new fields in LDB screen ?

Inside a block you can declare a selection-screen element and that will appear in the selection screen along with the other LDB screen elements . But the added elements will not be considered as a selection criteria. So for the sake of proper output you need to give a IF condition after GET <NODES> statement  and before WRITE statement .

In the followed program (F1S LDB is used)  Connid is added as p_connid and by the IF condition connid value is considered in display.

REPORT zldb.
NODES : spfli ,sflight , sbook.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME .
PARAMETERS:
p_connid TYPE spfli-connid.
SELECTION-SCREEN END OF BLOCK b1.
GET spfli.
IF spfli-connid = p_connid.
WRITE : / spfli-carrid ,spfli-connid.
ENDIF.





If   new added p_connid field  is filled by 17 then the output (List) on the execution of the above code will be as followed ---


  • No labels