‎2008 Nov 08 6:11 AM
hi,
i have a prob. when i run read function, let say my data in header text is
we & you
then this function returns
we <(>& <)> you
why this is happing and how can i got same text as i feed in header text.
i.e. it convert & char. to <(>& <)>
mukesh
‎2008 Nov 08 6:19 AM
Hi Mukesh,
You can look at the sample code at this link.
I hope it will surely help you.
[http://www.sap-img.com/abap/use-fm--read-text-to-read-the-various-text.htm]
Regards,
Amit.
‎2008 Nov 08 6:30 AM
Hi,
try this..
data: it_lines TYPE STANDARD TABLE OF tline.
DATA: c_tab TYPE tdtab_c132 WITH HEADER LINE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = 'B01'
language = sy-langu
name = name
object = 'EBANH'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
lines = it_lines
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.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
REFRESH c_tab[].
CALL FUNCTION 'CONVERT_ITF_TO_ASCII'
EXPORTING
* CODEPAGE = '0000'
formatwidth = 72
language = sy-langu
tabletype = 'ASC'
* TAB_SUBSTITUTE = ' '
* LF_SUBSTITUTE = ' '
replace_symbols = 'X'
replace_sapchars = 'X'
IMPORTING
* FORMATWIDTH_E =
* X_DATATAB =
c_datatab = c_tab[]
* X_SIZE =
TABLES
itf_lines = it_lines
* EXCEPTIONS
* INVALID_TABLETYPE = 1
* OTHERS = 2
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT c_tab.
CONCATENATE text c_tab INTO text SEPARATED BY space.
ENDLOOP.
Arunima
‎2008 Nov 08 6:31 AM
After the function module, use the following;
REPLACE ALL OCCURRENCES OF '<(>' IN TABLE itab_lines WITH '' .
REPLACE ALL OCCURRENCES OF '<)>' IN TABLE itab_lines WITH '' .This will solve your problem.
Regards
Karthik D
‎2008 Nov 08 6:34 AM
hello karthik,
actually this prob occurs for every special character...so it is not possible to write this line for every special character....so it is better to pass the final table through any perticular FM...i think it will be much more easier..
Arunima
‎2008 Nov 08 6:41 AM
As far as i tested only special characters like $ and < are enclosed as mentioned by you that too all are enclosed by the same format <(> <)> So you can make use of my code.
Regards
Karthik D
‎2008 Nov 08 6:49 AM
No...it is for all special characters....and also for special styles...in the text if you underline or bold or something other style use..then also some unknown character will come in the output....so i have passed it in this FM....so all the formatting will be ok...
Arunima
‎2008 Nov 08 7:12 AM
Thats ok, if you got the solution close the thread as answered.
Regards
Karthik D
‎2009 Nov 16 4:20 AM