Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

call second line of include text

former_member184657
Active Contributor
0 Kudos

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

5 REPLIES 5

former_member181962
Active Contributor
0 Kudos

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.

0 Kudos

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

0 Kudos

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...

0 Kudos

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

former_member598013
Active Contributor
0 Kudos

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.