Application Development and Automation 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: 
Read only

READ_TEXT multiple lines

Former Member
0 Likes
5,238

Hi Experts

Is there anyone who know that, how can we display multiple line in smartforms? I have used READ_TEXT but I can only display the last line, it's something like having the latest value in the variable.

I have tried using concatenate also but the output is coming in the same line; do we have any provision of new line character or some other technique to acheive this.

Responses will be highly appreciated.

Thanks and Regards

Vishal

1 ACCEPTED SOLUTION
Read only

former_member480923
Active Contributor
0 Likes
2,901

Hi,

The same parameters that you pass on to the READ_TEXT FM, use the same and pass it to the Text node with <b>node type = Include Text</b>.

This might solve the Problem.

Thanks

Anirban M.

9 REPLIES 9
Read only

Former Member
0 Likes
2,901

hi,

when tou use the FM REad_tect u will ge t teh Internal table... if you want to print the total data you have to loop the internal table.. i haef done the same. in my smartform

Read only

Former Member
0 Likes
2,901

Use RKD_WORD_WRAP function, here you can set the column width in which you would like to fit your text (like in a newspaper article), the function nicely wraps the text

For example I am pasting the input/output directly from SE37 on this function after setting a width of 35 chars

INPUT

THIS IS A VERY LONG TEXT AND THE GIVEN FUNCTION SHOULD WRAP IT NICELY IN A COLUMN NOT EXCEEDING 35 CHARACTERS WIDTH

OUTPUT

THIS IS A VERY LONG TEXT AND THE

GIVEN FUNCTION SHOULD WRAP IT

NICELY IN A COLUMN NOT EXCEEDING

Also note that the function wraps your text in a maximun 3 lines, so for longer lines you may need to do some calculation to get it all wrapped

Read only

0 Likes
2,901

hi

 IT_TLINE is internal table type STANDARD TABLE OF TLINE
  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      ID                      = '0002'
      LANGUAGE                = V_LANGU
      NAME                    = V_TDNAME
      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.
  IF SY-SUBRC <> 0.
    CLEAR IT_TLINE.
  ENDIF.

loop the table IT_TLINE in in you r smartforms..

Read only

0 Likes
2,901

Hi Vishnu

We have data; like this:

ssdfsd

dsfsdf

dsfdsgh

dgdfgfd

sdgdsgg

dasfsd123456789

I need to display the data in same way, as this data we will be getting from the database.

Do we have any solution for like some new line character or something.

Regards

Vishal

Read only

former_member480923
Active Contributor
0 Likes
2,902

Hi,

The same parameters that you pass on to the READ_TEXT FM, use the same and pass it to the Text node with <b>node type = Include Text</b>.

This might solve the Problem.

Thanks

Anirban M.

Read only

0 Likes
2,901

Hi Anirban

Could you please tell me which parameter I need to pass.

This is my FM: READ_TEXT:

CALL FUNCTION 'READ_TEXT'

EXPORTING

CLIENT = SY-MANDT

ID = '0002'

LANGUAGE = wa_language

NAME = WA_TDNAME

OBJECT = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

LINES = it_tline_marks

  • 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_tline_marks into wa_tline_marks.

v_packlist_marks = wa_tline_marks-tdline.

endloop.

And how to determine the node type.

Thanks and Regards

Vishal.

Read only

0 Likes
2,901

Hi Anirban,

The variable WA_TDNAME holds the Invoice Number and from the header of that invoice we are getting the data, and which is in multiple lines.....................

If i'll pass this WA_TDNAME in to the text node; either I am getting the invoice number by using &WA_TDNAME&or I am getting it as "WA_TDNAME".

Response to this will be highly appreciated.

Thanks and Regards

Vishal.

Read only

0 Likes
2,901

HI Vishal,

You need to pass the following

ID = '0002'
LANGUAGE = wa_language
NAME = WA_TDNAME
OBJECT = 'VBBK'

Into the text Node. Use a Program Line before this to retrieve the values of the wa_langugae and wa_tdname (if required). The Text node will print all the data as found from the read text return table.

Hope that Helps

<i>Please reward Points if Helpfull</i>

Thanks

Anirban M.

Read only

Former Member
0 Likes
2,901

hi vishal,

READ_TEXT function module will return the internal table. What u need to do is declare one internal table in global definitions and pass that internaltable as a parameter to Read_text fun module.

<i>.....

1)it_lines type lines.

2) do this in program lines.

note :pass this <b>it_lines</b> as a export values of <b>program lines</b>.

CALL FUNCTION 'READ_TEXT'

EXPORTING

ID = '0002'

LANGUAGE = V_LANGU

NAME = V_TDNAME

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.

IF SY-SUBRC <> 0.

CLEAR IT_TLINE.

ENDIF.

3) loop this it_lines and use text element to print contents for it_lines.

...>place this in text element &it_lines-text...&

thats it! you can get the desired output.

[II].....

Same thing can be achived in another way.

text element--> include text....

I HOPE UR PROBLEM WILL SOLVED.....DON'T FORGET TO GRADE POINTS IF UR PROB SOLVED...

Regards

Sreenivasa Sarma