Get Example source ABAP code based on a different SAP table
ID DYNPRO% • READ LINE ABAP Statement
READ LINE> Short Reference >
ABAP_SYNTAX READ ${ ${LINE line $[${OF PAGE page$}$|${OF CURRENT PAGE$}$]> $[ • idx$]$}> $| ${CURRENT LINE$} $} $[result>$].>
ABAP Addition 1 ... LINE line $[${OF PAGE page $}$|${OF CURRENT PAGE$}$] $[ • idx$]> 2 ... CURRENT LINE>
What does it do? This statement assigns the content of a line stored in the list buffer to the system field sy-lisel>, and allows other target fields to be specified in result>>. In addition, all values for this line stored using HIDE>> are assigned to the respective variables. The line to be read is specified using the addition LINE> or using CURRENT LINE>. System Fields> sy-subrc>Meaning> 0The specified line exists and was read. Not 0The specified line does not exist. • OF PAGE READ LINE • OF CURRENT PAGE READ LINE • • READ LINE
ABAP Addition PAGE$}$] $[ • idx$]>
What does it do? The addition LINE> selects a line. The line number is specified by line> which expects a data object of type i>. The line number is related to a list page of a list level. The list level can be specified with the addition •>, where idx> expects a data object, which contains the list index, of type i>. The value of idx> must be greater than or equal to 0. If the addition •> is not specified, the list level 0 (the basic list itself) is selected when the basic list is created and the list level at which the event was raised (sy-listi>) is selected when a list event is processed. The list page can be specified either with PAGE page> or with CURRENT PAGE>. page> expects a data object of the type i > that contains the page number of an existing page of the list level. No line is selected if no line is found for the specified values in line>, idx> and page>. CURRENT PAGE> indicates the topmost displayed page of the list, on which the last list event has taken place. No line is selected while creating the basic list. If no addition is specified for the page, the current page (sy-pagno>) is selected when the basic list is created, and the page on which the event was raised (sy-cpage>) is selected during the processing of a list event. • CURRENT READ LINE
ABAP Addition
What does it do? For the addition CURRENT LINE>, the line on which the screen cursor was positioned during a preceding list event (sy-lilli>), or the last line read with a preceding READ LINE> statement, is selected. No line is selected while creating the basic list.
Example ABAP Coding
This example reads all lines of the basic list after selecting a line. The content of the checkbox is assigned to the output data object flag>. A target field wa> with length 10 is used for the date, since this is the length of the output area and contains separators. If an assignment was made to the output field date>, the area length would be reduced. The selected data is displayed in the details list. ABEXA 00522 ABAP_EXAMPLE_END