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: 

READ_TEXT format problem

david_fryda2
Participant
0 Kudos

Hi everyone,

In so10, I wrote a simple text with tabulation.

Now I want to write that text using READ_TEXT function (or whatever works).

The READ_TEXT function returns a table with the text but instead of tabulations there are quotes.

How can I solve that problem ?

Thanks.

Regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi David,

Pl. send me the code you have written, I will try to reconstuct the scenario and will answer/

Darshan.

10 REPLIES 10

Former Member
0 Kudos

Hi David,

Pl. send me the code you have written, I will try to reconstuct the scenario and will answer/

Darshan.

0 Kudos

Hi Patel,

Here is the code :

<code>

data: GT_LINES like LIKE tline OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'Z0Q3'

language = 'B'

name = '123456'

object = 'VBBK'

TABLES

lines = gt_lines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

</code>

In fact, the user goes to transaction va22, goes to the header and to TEXT.

He adds his own text (it's like so10).

This is why the object is VBBK because it's SD component.

Thanks.

Regards.

Message was edited by:

David Fryda

0 Kudos

HI David,

Try this

Data: mystring type string.

LOOP AT gt_lines.

concatenate mystring gt_lines-tdline into mystring separated by space.

ENDLOOP.

athavanraja
Active Contributor
0 Kudos

where do you intend to use the text returned by READ_TEXT. in sapscript environment the two ,, for tab will be interpretted by the system properly as tab. you can check this by going to print preview from SO10.

if you intend to use this in some other environment you may need to convert all those doule ,, into proper ASCII format.

Raja

0 Kudos

Hi,

I intend to use this in SMARTFORM.

But it does not format it correctly.

Is there a way to do it ?

Thanks.

Regards.

0 Kudos

sorry havent worked in Smart forms for a long time.

can you try replacing the double ,, in your text with CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB and pass it to smart form?

Raja

younes_bouaouad
Explorer
0 Kudos

Hi,

For smartforms it's better to use text modules.

Former Member
0 Kudos

Hi

Goto Smartforms tcode

Create a TEXT MODULE

and write all the text data what you have written in SO10 in that Text module

and call that text module in the respective window of the Smartform.

taht's all.

There is no need to use the READ_TEXT fun module if you have to use the text in smartforms.

Reward points for useful Answers

Regards

Anji

0 Kudos

Hi,

I do have to use the READ_TEXT function because the text I want to display depends on the quotation number. In each quotation number, the user can insert a free text : this text is not created in so10 but with va21 (or va22).

So, depending on the quotation number I get a diferent text.

Thanks,

Regards.

Clemenss
Active Contributor
0 Kudos

Hi David,

SAPScript texts tabs are represented as ,, (two commas - to be seen in debugger or in classic sapscript editor). Every line has a TDFORMAT 2-character format column and a TDLINE 255 characters text line.

The trick is that the format used in TDFORMAT is defined for a paragraph of a layout set or style. In smatforms it's about the same. * in the format column means default format. In the default format, the standard TAB distance may be defined differently for SO10 text and smartform text.

As SAP is an integrated system you should be aware that thousands of developers rarely know what integration means

Regards,

Clemens