06-05-2008 2:44 PM
hi all,
i wud like to know whether its possible to extract text from standard text starting from the second line.
that is to say that if my include text has 2 or more lines, i want to extract data starting only from the second line onwards (or for that matter only the second line).
regards
pk
06-05-2008 2:49 PM
Use the funstion module READ_TEXT to get the full text.
The result will be in the form of an internal table.
read the second line of that internal table to get the text in the second line.
Sample code:
DATA IT_TLINE TYPE STANDARD TABLE OF TLINE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'Z006'
LANGUAGE = 'E'
NAME = L_VBELN
OBJECT = 'VBBK'
TABLES
LINES = IT_TLINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
READ TABLE IT_LINE INDEX 2.
IF SY-SUBRC = 0.
WRITE:/ IT_TLINE.
ENDIF.
06-05-2008 2:53 PM
thanx ravi and chidanand,
now wht i wud like to know is that can we display this extracted text into an ALV??
that is to say, once i capture this field, i want to display it as part of my ALV report?
pk
06-05-2008 3:00 PM
Hi prashant,
Do you need to display it in one line or in multiple line
If you want to display it in one line then what you need to do is
Loop <itab>
Concatenate the <text> to the final variable
Endloop.
now pass this final variable value into the ALV it will work...
06-05-2008 3:24 PM
well.. my idea is that i want to dispaly the captured text in the alv for the relevent line, based on certain conditions.
well im too tired to think straight now.
i guess i have to call it a day and rack my brains abt it first thing in the morning tomaro.
thanx anyways.
pk
06-05-2008 2:50 PM
Hi Prashant,
If you would like to get the text starting from the second line then what you need to do is call the function module READ_TEXT and it will return you all the line items in one table
Then loop at the internal table and read the text starting from the second line.