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: 

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

former_member660488
Participant
0 Kudos
5,483

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

Sandra_Rossi
Active Contributor
0 Kudos
3,433

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?

former_member660488
Participant
0 Kudos
3,433

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.

Sandra_Rossi
Active Contributor
0 Kudos
3,433

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

former_member660488
Participant
0 Kudos
3,433

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

Sandra_Rossi
Active Contributor
0 Kudos
3,433

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?

laxmi_jibhe
Explorer
0 Kudos
3,433

HI ,

Please Try FM - DSVAS_WRD_STREAM_TO_ITF and Pass

NO_AND_REPLACEMENT = 'X'

0 Kudos
3,433

Function module DSVAS_WRD_STREAM_TO_ITF does not exist

former_member660488
Participant
0 Kudos
3,433

I want to output this long text to excel files.

Sandra_Rossi
Active Contributor
0 Kudos
3,433

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

laxmi_jibhe
Explorer
0 Kudos
3,433

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

0 Kudos
3,433

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.

former_member660488
Participant
0 Kudos
3,433

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?

Sandra_Rossi
Active Contributor
0 Kudos
3,433

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.

former_member660488
Participant
0 Kudos
3,433

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.