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: 

Display long text in an ABAP Query.

Former Member
0 Kudos
1,348

Hi all,

Could any one please help me in guiding me, to tell how can I display the long text which is got from the function module 'READ_TEXT' in an ABAP query.

The issue here is that Iam able to loop at the <itab> table and get the long text for each of the records any, but Iam not able to display it on an infoset..

Send me the examples if any..

Thanks & Regards,

Sanjay Mankar.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
176

Dear dont try with ABAP Qualry

use alv or like that

sample code is attach here

if you have any claryfication reply me

&----


*& Form F001-BasicData_LText

&----


  • text

----


  • -->IN_PAR text

  • -->OUT_PAR text

----


FORM F001-BasicData_LText TABLES in_par STRUCTURE itcsy out_par STRUCTURE itcsy.

*

DATA :

IT_LTEXT TYPE STANDARD TABLE OF TLINE,

WA_LTEXT TYPE TLINE,

W_FTEXT(100) TYPE C,

W_FTEXT1(100) TYPE C,LW_LEN TYPE I.

*

DATA :

W_ID LIKE thead-tdid, "Text ID

W_LANGU LIKE THEAD-TDSPRAS, "Language

W_NAME LIKE thead-tdname, "Name

W_OBJECT LIKE thead-tdobject. "Texts:

*

*

READ TABLE in_par WITH KEY 'EKPO-MATNR'.

*

w_NAME = in_par-value.

*

W_ID = 'GRUN'.

W_OBJECT = 'MATERIAL'.

W_LANGU = SY-LANGU.

*

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = W_ID

LANGUAGE = W_LANGU

NAME = W_NAME

OBJECT = W_OBJECT

TABLES

lines = IT_LTEXT

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

*

Loop at IT_LTEXT into WA_LTEXT.

W_FTEXT1 = WA_LTEXT-TDLINE.

CONCATENATE W_FTEXT W_FTEXT1 INTO W_FTEXT SEPARATED BY SPACE.

Endloop.

*

LOOP AT out_par WHERE name EQ 'W_FTEXT'.

out_par-value = W_FTEXT.

MODIFY out_par.

ENDLOOP.

*

ENDFORM. "F001-BasicData_LText

*

*

&----


*& Form F001-LTEXT_DEVIDING

&----


  • text

----


  • -->P_IT_DVTXT text

----


FORM F001-LTEXT_DEVIDING TABLES in_par STRUCTURE itcsy out_par STRUCTURE itcsy.

*

DATA : W_TEXTLINE(100) TYPE C,

W_DELIMITER TYPE C,

W_OUTPUTLEN TYPE I,

W_FTEXT(100) TYPE C,

OUT_LINE1 TYPE C,

OUT_LINE2 TYPE C,

OUT_LINE3 TYPE C,

W_LINE1(35) TYPE C,

W_LINE2(35) TYPE C,

W_LINE3(35) TYPE C.

*

READ TABLE in_par WITH KEY 'W_FTEXT'.

*

W_FTEXT = IN_PAR-VALUE.

W_TEXTLINE = W_FTEXT.

W_DELIMITER = ' '.

W_OUTPUTLEN = 30.

*

*

CALL FUNCTION 'RKD_WORD_WRAP'

EXPORTING

TEXTLINE = W_TEXTLINE

DELIMITER = W_DELIMITER

OUTPUTLEN = W_OUTPUTLEN

IMPORTING

OUT_LINE1 = W_LINE1

OUT_LINE2 = W_LINE2

OUT_LINE3 = W_LINE3.

*

LOOP AT out_par.

if out_par-name eq 'W_LINE1'.

out_par-value = W_LINE1.

elseif out_par-name eq 'W_LINE2'.

out_par-value = W_LINE2.

elseif out_par-name eq 'W_LINE3'.

out_par-value = W_LINE3.

endif.

MODIFY out_par.

*

ENDLOOP.

*

ENDFORM. " F001-LTEXT_DEVIDING

rewads if helpful

7 REPLIES 7

Former Member
0 Kudos
177

Dear dont try with ABAP Qualry

use alv or like that

sample code is attach here

if you have any claryfication reply me

&----


*& Form F001-BasicData_LText

&----


  • text

----


  • -->IN_PAR text

  • -->OUT_PAR text

----


FORM F001-BasicData_LText TABLES in_par STRUCTURE itcsy out_par STRUCTURE itcsy.

*

DATA :

IT_LTEXT TYPE STANDARD TABLE OF TLINE,

WA_LTEXT TYPE TLINE,

W_FTEXT(100) TYPE C,

W_FTEXT1(100) TYPE C,LW_LEN TYPE I.

*

DATA :

W_ID LIKE thead-tdid, "Text ID

W_LANGU LIKE THEAD-TDSPRAS, "Language

W_NAME LIKE thead-tdname, "Name

W_OBJECT LIKE thead-tdobject. "Texts:

*

*

READ TABLE in_par WITH KEY 'EKPO-MATNR'.

*

w_NAME = in_par-value.

*

W_ID = 'GRUN'.

W_OBJECT = 'MATERIAL'.

W_LANGU = SY-LANGU.

*

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = W_ID

LANGUAGE = W_LANGU

NAME = W_NAME

OBJECT = W_OBJECT

TABLES

lines = IT_LTEXT

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

*

Loop at IT_LTEXT into WA_LTEXT.

W_FTEXT1 = WA_LTEXT-TDLINE.

CONCATENATE W_FTEXT W_FTEXT1 INTO W_FTEXT SEPARATED BY SPACE.

Endloop.

*

LOOP AT out_par WHERE name EQ 'W_FTEXT'.

out_par-value = W_FTEXT.

MODIFY out_par.

ENDLOOP.

*

ENDFORM. "F001-BasicData_LText

*

*

&----


*& Form F001-LTEXT_DEVIDING

&----


  • text

----


  • -->P_IT_DVTXT text

----


FORM F001-LTEXT_DEVIDING TABLES in_par STRUCTURE itcsy out_par STRUCTURE itcsy.

*

DATA : W_TEXTLINE(100) TYPE C,

W_DELIMITER TYPE C,

W_OUTPUTLEN TYPE I,

W_FTEXT(100) TYPE C,

OUT_LINE1 TYPE C,

OUT_LINE2 TYPE C,

OUT_LINE3 TYPE C,

W_LINE1(35) TYPE C,

W_LINE2(35) TYPE C,

W_LINE3(35) TYPE C.

*

READ TABLE in_par WITH KEY 'W_FTEXT'.

*

W_FTEXT = IN_PAR-VALUE.

W_TEXTLINE = W_FTEXT.

W_DELIMITER = ' '.

W_OUTPUTLEN = 30.

*

*

CALL FUNCTION 'RKD_WORD_WRAP'

EXPORTING

TEXTLINE = W_TEXTLINE

DELIMITER = W_DELIMITER

OUTPUTLEN = W_OUTPUTLEN

IMPORTING

OUT_LINE1 = W_LINE1

OUT_LINE2 = W_LINE2

OUT_LINE3 = W_LINE3.

*

LOOP AT out_par.

if out_par-name eq 'W_LINE1'.

out_par-value = W_LINE1.

elseif out_par-name eq 'W_LINE2'.

out_par-value = W_LINE2.

elseif out_par-name eq 'W_LINE3'.

out_par-value = W_LINE3.

endif.

MODIFY out_par.

*

ENDLOOP.

*

ENDFORM. " F001-LTEXT_DEVIDING

rewads if helpful

Former Member
0 Kudos
176

Hi Nelson,

Thanks for you reply and I will assign you the points for the same, & I think you are right in saying that use ALV report instead of the ABAP query & I will be using that, because I tried all the ways out in the query and its not possible to display the text..

Thanks & Rgds,

Sanjay.

0 Kudos
176

are you solved the problem?

0 Kudos
176

No I have not solved this problem...I will be developing an ABAP report instead of displaying the long text in the query.

Regards,

Sanjay.

Former Member
0 Kudos
176

Sanjay,

After READ_TEXT you have to use EDIT_TEXT and SAVE_TEXT Funtion nmodule then only data will get save.

Now your problem will get resolve.

Pls. mark for all useful answers

Former Member
0 Kudos
176

DEAR

why you getting delay to develop that report.

I have sample report if you want i'll send it to you.

0 Kudos
176

Hi Nelson,

I would appreciate if you can really send me the sample report for displaying the long text.

Thanks in advance.

Regards,

Sanjay.