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

CONVERT_STREAM_TO_ITF_TEXT convert '&' to '<(>&<)>'

former_member660488
Participant
0 Likes
11,536

Hi experts,

when CONVERT_STREAM_TO_ITF_TEXT is used to convert string containing Character & to inner table,the resulting inner table convert '&' to"<(>&<)>". I need the & not <(>&<)>. Does anybody know how we can get the expected results?

Hi experts,

when CONVERT_STREAM_TO_ITF_TEXT is used to convert string containing Character & to inner table,the resulting inner table convert '&' to"<(>&<)>". I need the & not <(>&<)>. Does anybody know how we can get the expected results?

14 REPLIES 14
Read only

Sandra_Rossi
Active Contributor
0 Likes
9,486

If you want "&" instead of "<(>&<)>", then it's not format ITF, then you should not use CONVERT_STREAM_TO_ITF_TEXT.

Can you explain the context so that to better answer your question?

Do you just want to split a text into sections of constant length?

Do you want to store text in a standard text or any kind of "long text" in tables STXH/STXL?

Read only

former_member660488
Participant
0 Likes
9,486

1 .Smartforms output as dynamic text

2.The order of Excel printing is as follows.

DATA: l_string TYPE string,//the value is the long text above

gt_text TYPE tlint_t.

APPEND l_string TO lt_stream_lines .

CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'

EXPORTING stream_lines = lt_stream_lines

lf = 'X'

TABLES itf_text = gt_text.

Read only

Sandra_Rossi
Active Contributor
0 Likes
9,486

So, it's really the ITF format that you need, and "<(>&<)>" is then correct.

When the smart form is output, don't worry, & will be rendered.

For more information: SAP Library - Structure TLINE of the Lines Table

Read only

former_member660488
Participant
0 Likes
9,486

the smart form prints well,but the excel output still show "<(>&<)>" not '&',this is the problem I want to solve,Please help me,thank you advance

Read only

Sandra_Rossi
Active Contributor
0 Likes
9,486

I didn't notice that you were also talking about Excel. Can you explain what this Excel (file?) has to do with the smart form?

Read only

laxmi_jibhe
Explorer
0 Likes
9,486

HI ,

Please Try FM - DSVAS_WRD_STREAM_TO_ITF and Pass

NO_AND_REPLACEMENT = 'X'

Read only

0 Likes
9,486

Function module DSVAS_WRD_STREAM_TO_ITF does not exist

Read only

former_member660488
Participant
0 Likes
9,486

I want to output this long text to excel files.

Read only

Sandra_Rossi
Active Contributor
0 Likes
9,486

Then, why don't you call CONVERT_ITF_TO_STREAM_TEXT to do the opposite conversion?

Read only

laxmi_jibhe
Explorer
0 Likes
9,486

What's the component version for SAP system, its available in SAP ECC 6.0 , Release 702.

Read only

0 Likes
9,486

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.

Read only

former_member660488
Participant
0 Likes
9,486

if the internal table have three rows,need call three times,or the results connect multiple rows into one row ,What I need is three lines of data without format <(>&<)>.

There's no other way to switch at once,the fm CONVERT_ITF_TO_ASCII can work?

Read only

Sandra_Rossi
Active Contributor
0 Likes
9,486

No, you don't need to call CONVERT_ITF_TO_STREAM_TEXT three times. You call it once with internal table of three lines. There are lots of examples in the forum.

Read only

former_member660488
Participant
0 Likes
9,486

call it one once return a rows ,this is not what I want. I want three rows without "<(>&<)>"

I call CONVERT_STREAM_TO_ITF_TEXT tranfer a string to the internal table,

then call CONVERT_ITF_TO_STREAM_TEXT tranfer the the internal table to the ordinaty string.

After the final call, it returns to the previous data.