2007 May 30 10:19 AM
Hi all,
what is the use of read line statement?Can we use it instead of hide,if so is it increases performance?
what is the use of Get cursor?Why do we use get cursor instead of Hide?
Thanx in advance.
Regards,
Ram.
Hi all,
what is the use of read line statement?Can we use it instead of hide,if so is it increases performance?
what is the use of Get cursor?Why do we use get cursor instead of Hide?
Thanx in advance.
Regards,
Ram.
2007 May 30 10:21 AM
Hi
An example on read line:::it 'll give u better understanding on read line..
DATA: date TYPE d,
flag(1) TYPE c,
wa(10) TYPE c.
START-OF-SELECTION.
date = sy-datum.
DO 10 TIMES.
date = date + sy-index.
WRITE: / flag AS CHECKBOX, (10) date.
ENDDO.
AT LINE-SELECTION.
DO.
READ LINE sy-index FIELD VALUE flag
date INTO wa.
IF sy-subrc <> 0.
EXIT.
ELSEIF flag = 'X'.
WRITE / wa.
ENDIF.
ENDDO.
Regards,
Sree
2007 May 30 10:22 AM
hi
good
READ LINE
Use the statements READ LINE and READ CURRENT LINE to read data from the lines of existing list levels. These statements are closely connected to the HIDEtechnique.
=========
All of the lists generated by a single program are stored internally in the system. You can therefore access any list in a program that was created for the same screen and that has not yet been deleted by returning to a lower list level. To read lines, use the statements READ LINE and READ CURRENT LINE.
To read a line from a list after an interactive list event, use the READ LINE ...statement:
To read a line twice in succession, use the READ CURRENT LINE ... statement
This statement reads a line read before by an interactive event (F2) or by READ LINE.
The following program is connected to the logical database F1S.
REPORT demo_list_read_line NO STANDARD PAGE HEADING.
TABLES: sflight.
DATA: box(1) TYPE c, lines TYPE i, free TYPE i.
START-OF-SELECTION.
SET PF-STATUS 'CHECK'.
GET sflight.
WRITE: box AS CHECKBOX, sflight-fldate.
HIDE: sflight-fldate, sflight-carrid, sflight-connid,
sflight-seatsmax, sflight-seatsocc.
END-OF-SELECTION.
lines = sy-linno - 1.
TOP-OF-PAGE.
WRITE: 'List of flight dates'.
ULINE.
TOP-OF-PAGE DURING LINE-SELECTION.
WRITE: 'Date:', sflight-fldate.
ULINE.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'READ'.
box = space.
SET PF-STATUS 'CHECK' EXCLUDING 'READ'.
DO lines TIMES.
READ LINE sy-index FIELD VALUE box.
IF box = 'X'.
free = sflight-seatsmax - sflight-seatsocc.
IF free > 0.
NEW-PAGE.
WRITE: 'Company:', sflight-carrid,
'Connection: ',sflight-connid,
/ 'Number of free seats:', free.
ENDIF.
ENDIF.
ENDDO.
ENDCASE.
After the selection screen has been selected, the system displays a basic list where the user can fill in checkbox fields. The self-defined page header of the basic list uses the parameters CITY_FR und CITY_TO. The parameters are defined in the logical database F1S.
The program uses the status CHECK, where the function code READ (text Read Lines) is assigned to function key F5 and to a pushbutton in the application toolbar. The corresponding user action triggers the AT USER-COMMAND event. The system now reads all lines of the basic list using READ LINE in a DO loop. For each line, the values stored previously using HIDE are placed in the respective fields for each line. Using the FIELD VALUE option, the system also reads the checkbox box. If seats are still free, the system writes the company, the connection, and the number of free seats into a detail list for each line in which the checkbox was selected.
The system starts a new page with an individual page header for each output. On the detail list, the function code READ is deactivated using the EXCLUDING addition of the SET PF-STATUS statement.
After returning from the detail list, the checkboxes are still filled.
thanks
mrutyun^
2007 May 30 10:24 AM
Hi Rambabu,
Use the statements READ LINE and READ CURRENT LINE to read data from the lines of existing list levels. These statements are closely connected to the HIDE technique.
please see the sample code below:
data wa type c length 20.
at line-selection.
read line sy-index field value <field name1> <field name2>into wa.
write:/ wa.
Thanks.
2007 May 30 10:24 AM
Hi
Normally Hide is to store the field value temporarily when you are going for interactive report.
Get cursor used when you want specified field,exam if you want only one particular value,then use
Get cursor field <fieldname>
Read line used for particular row corresponding to sy-index value.
Thanks
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |