‎2007 Apr 03 5:50 AM
Hi Experts,
I am using following code.
READ LINE lo_lnidx1 FIELD VALUE t_header-ip_clabs INTO e_header-ip_clabs
t_header-ip_meins INTO e_header-ip_meins
t_header-ip_cnf INTO e_header-ip_cnf
t_header-ip_end1 INTO e_header-ip_end1
t_header-ip_start1 INTO e_header-ip_start1
t_header-ip_end2 INTO e_header-ip_end2
t_header-ip_start2 INTO e_header-ip_start2
t_header-ip_frbnr INTO e_header-ip_frbnr.
All T_header fields have data but they are getting transferred to E_HEADER.
Can you pls help me.
Thanks in Advance.
‎2007 Apr 03 6:02 AM
Hi.Murali..
you are explicitly moving the line contents into e_header....
what is your problem?? can u be more clear..
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.
‎2007 Apr 03 6:09 AM
Hi Rammohan,
READ LINE lo_lnidx1 FIELD VALUE t_header-ip_clabs INTO e_header-ip_clabs
t_header-ip_meins INTO e_header-ip_meins
t_header-ip_cnf INTO e_header-ip_cnf
t_header-ip_end1 INTO e_header-ip_end1
t_header-ip_start1 INTO e_header-ip_start1
t_header-ip_end2 INTO e_header-ip_end2
t_header-ip_start2 INTO e_header-ip_start2
t_header-ip_frbnr INTO e_header-ip_frbnr.
when i debugged this program all T_HEADER fields have valuse but they are getting transported to E_HEADER fields
Thanks in Advance.
‎2007 Apr 03 6:11 AM
please comment all the lines ater the READ statement and see whether you are still getting all the fields populated in e_header.
‎2007 Apr 03 6:05 AM
The main Requirement is that hide ,read line is that the data can be made available to beyond basic list. in ur case if u do same thing through read line. if u don't use another structure inspite of that if u use old one then also that doesn't make any difference.
more information regarding read line see below
READ LINE lo_lnidx1 FIELD VALUE t_header-ip_clabs INTO t_header-ip_clabs
t_header-ip_meins INTO t_header-ip_meins
t_header-ip_cnf INTO t_header-ip_cnf
t_header-ip_end1 INTO t_header-ip_end1
t_header-ip_start1 INTO t_header-ip_start1
t_header-ip_end2 INTO t_header-ip_end2
t_header-ip_start2 INTO t_header-ip_start2
t_header-ip_frbnr INTO t_header-ip_frbnr .
try this u will understaand better
READ LINE
Syntax
READ { {LINE line [{OF PAGE page }|{OF CURRENT PAGE}]
[INDEX idx] }
| {CURRENT LINE} }
[result].
Extras:
1. ... LINE line [{OF PAGE page }|{OF CURRENT PAGE}] [INDEX idx]
2. ... CURRENT LINE
Effect
This statement assigns the content of a row 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 row stored with HIDE are assigned to the respective variables.
The row to be read is specified with the addition LINE or with CURRENT LINE.
System Fields
sy-subrc Relevance
0 The specified row is available and was read.
Not equal to 0 The specified row does not exist.
Addition 1
... LINE line [{OF PAGE page }|{OF CURRENT PAGE}] [INDEX idx]
Effect
For the addition LINE, a data object of the type i is expected for line, which includes the line number based on the list page of a list level.
The list level can be specified with the addition INDEX, where a data object (which contains the list index) of type i is expected for idx. The value of idx must be greater than or equal to 0. If the addition INDEX is not specified, then the list level 0 (the basic list itself) is selected during the creation of the basic list, and the list level at which the event was triggered (sy-listi) is selected during the processing of a list event.
The list page can be specified either with PAGE page or with CURRENT PAGE. For page, a data object of the type i that contains the page number of an existing page of the list level is expected. No row is selected if no row 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 row is selected while creating the basic list. If no addition is specified for the page, then the current page (sy-pagno) is selected during the creation of the basic list, and the page on which the event was triggered (sy-cpage) is selected during the processing of a list event.
Addition 2
... CURRENT LINE
Effect
For the addition CURRENT LINE, the line on which the screen cursor was positioned during a preceding list event (sy-lilli), or the last row read with a preceding READ LINE statement, is selected. No row is selected while creating the basic list.
Example
This example reads all rows of the basic list after selecting a row. The content of the checkbox is assigned to the output data object flag. A target field wa with lenght 10 is used for the date, since this is th length of the output area and contains separators. If you assigned to the output field date, the area length would be reduced. The checked data is displayed in the details list.
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.
READ LINE - result
Syntax
... [LINE VALUE INTO wa]
[FIELD VALUE dobj1 [INTO wa1] dobj2 [INTO wa2] ...].
Extras:
1. ... LINE VALUE INTO wa
2. ... FIELD VALUE dobj1 [INTO wa1] dobj2 [INTO wa2] ...
Effect
Specification of target fields for READ LINE.
Addition 1
... LINE VALUE INTO wa
Effect
The addition LINE VALUE assigns the formatted content of the complete list row in the list buffer to the data object wa.
Addition 2
... FIELD VALUE dobj1 [INTO wa1] dobj2 [INTO wa2] ...
Effect
The addition FIELD VALUE assigns the output areas
of single data objects dobj1 dobj2... which have been put out to the list buffer to these data objects, or -if specified- to the data objects wa1 wa2 .... For wa resp. wa1 wa2 ..., character-type (before release 6.10 flat) data objects are expected. The list row resp. data objects dobj1 dobj2 ... are treated as if they had the data type c, so that closing blanks are not accepted.
With data objects dobj1 dobj2... that have been put out multiple times to a row, only the first one is read out. If a data object dobj1 dobj2 ... is not found at all, the specification is ignored.
If the output area of a data object is to be read which was addressed in the WRITE-statement via a field symbol and there is no longer the same data object assigned to the field symbol, then the name of the data object and not the name of the field sysmbol must be specified.
Note
The content of the row resp. of single output areas is of character-type and prepared according to the rules for the WRITE-statement. At assignment, the usual conversion rules apply. This fact can lead to incompatibilities with the target fields dobj1 dobj2 ... resp. wa1 wa2 ... , especially if these are numeric and the output contains separators. Due to this, the usage of READ LINE is mainly recommended for analysis of fields ready-for-input, whereas for other analyses, you can save values type-related with HIDE.
Message was edited by:
sunil kumar
Message was edited by:
sunil kumar
‎2007 Apr 03 6:06 AM
Afetr you read line statement you will have the header values in t_header which you are explicitly moving into e_header,
Please be more clear on your problem
‎2007 Apr 03 6:14 AM
Hi,
You said "All T_header fields have data but they <b>are getting transferred</b> to E_HEADER". Do you mean to say they are transferred <b>or NOT transferred</b>.
If they are transferred correctly, what is the issue?
<b>If they are not getting transferred, Check following things.</b>
- You have written this code under events AT LINE-SELECTION, AT PFxx, ATUSER-COMMAND etc.
- Once you select the line in the list you are passing the value of SY-LISEL into lo_lnidx1 before using it into READ LINE statement
- The fields you are transferring ( t_header-ip_meins, ip_cnf .... ip_frbnr ect ) are displayed on output. If this fields are not being displayed on output, the content of fields of e_header will not change.
Please check this and let me know if you still have a issue.
Regards,
RS
‎2007 Apr 03 6:20 AM
Hi Rs,
Sorry ..the fields are not getting transferred..
All of these fields are Input fields on Output screen.
Thanks in Advance,
‎2007 Apr 03 6:38 AM
Hi,
Can you paste your code here? How you are writing this lines, how you are selecting this line and where you are moving this line into e_header.
This will help me identify the problem.
Regards,
RS