2009 Jan 24 8:53 AM
Hi all,
I want to read multiple rows by read_text functions but it shows me single row only.
Plz help me how to read multiple rows ..
2009 Jan 24 9:05 AM
I have used read_text to read multiple lines without any issues, what problem u r facing, wud be better if u show the code.
I did like this used the FM then loop at the itab ahving the text.
data: v_str type char255. "or even more as u want.
loop at it_tline into wa.
concatenate v_str wa-tdline into v_str.
endloop.
кu03B1ятu03B9к
2009 Jan 24 9:05 AM
I have used read_text to read multiple lines without any issues, what problem u r facing, wud be better if u show the code.
I did like this used the FM then loop at the itab ahving the text.
data: v_str type char255. "or even more as u want.
loop at it_tline into wa.
concatenate v_str wa-tdline into v_str.
endloop.
кu03B1ятu03B9к
2009 Jan 24 9:16 AM
Hi kartik,
my code is like :
data : begin of itab occurs 0,
NO_OF_BOX TYPE TLINE-TDLINE,
end of itab.
data: name type THEAD-TDNAME.
DATA lt_text TYPE tline occurs 0 with header line.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'B01'
language = sy-langu
name = name
object = 'EBAN'
TABLES
lines = lt_text.
loop at lt_text.
MOVE lt_text-TDLINE TO i_TAB-NO_OF_BOX.
IF NOT I_TAB-NO_OF_BOX IS INITIAL.
exit.
ENDIF.
endloop.
MODIFY I_TAB.
ENDLOOP.
Please Help me
2009 Jan 24 9:23 AM
hi ankita please clarify the following points.
data : begin of itab occurs 0,
NO_OF_BOX TYPE TLINE-TDLINE,
end of itab.
data: name type THEAD-TDNAME.
DATA lt_text TYPE tline occurs 0 with header line.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'B01'
language = sy-langu
name = name
object = 'EBAN'
TABLES
lines = lt_text.
loop at lt_text.
MOVE lt_text-TDLINE TO i_TAB-NO_OF_BOX.
IF NOT I_TAB-NO_OF_BOX IS INITIAL. " i think problem lies in this condition as soon as first line is read the condition becomes true and exits the loop. so re-think about this condtion
exit.
ENDIF.
endloop.
MODIFY I_TAB. "why these two lines
ENDLOOP. " which loop is it
Why are u putting the condition inside the loop at lt_text since ur exiting at condition u r not able to read all lines of text.
кu03B1ятu03B9к
Edited by: kartik tarla on Jan 24, 2009 2:53 PM
2009 Jan 24 9:32 AM
Hi kartik...
I am using this code because I want to modify my internal table field..
If i am not using it , only blank value store in internal table.
IF NOT I_TAB-NO_OF_BOX IS INITIAL.
exit.
ENDIF.
2009 Jan 24 9:44 AM
>
> Hi kartik...
> I am using this code because I want to modify my internal table field..
>
> If i am not using it , only blank value store in internal table.
>
>
> IF NOT I_TAB-NO_OF_BOX IS INITIAL.
>
> exit.
> ENDIF.
Hi ankita,
See.
What ur code is currently doing is reading one line then
checking this condition
IF NOT I_TAB-NO_OF_BOX IS INITIAL.
exit.
ENDIF.
Condition is true so it exits.
So its not reading other lines.
do like this
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'B01'
language = sy-langu
name = name
object = 'EBAN'
TABLES
lines = lt_text.
if sy-subrc = 0. " This is important
loop at lt_text.
concatenate i_TAB-NO_OF_BOX lt_text-TDLINE to i_TAB-NO_OF_BOX.
endloop.
endif.
MODIFY I_TAB. "here if u want u can put this check IF NOT I_TAB-NO_OF_BOX IS INITIAL. but i think its not required as now we are looping at lt_text only if sy-subrc is 0
кu03B1ятu03B9к
2009 Jan 24 9:58 AM
Thanks kartik...
It works but last some text is missed..
is there any limit for character...
because it shows only 130 characters...
2009 Jan 24 10:06 AM
size limit depends on data type of this i_TAB-NO_OF_BOX
just check it, probably u wud require to change its data typeto extend it.
кu03B1ятu03B9к