‎2009 Nov 10 2:20 PM
Hello,
IN MY SAP system the materials are created from MDM.
The problem is with the long text. In MM03 when i see the material PO Text i can see multiple lines. However when i read this lines usind READ_TEXT FM it comes as one line with this sign # in between the lines.
EG,
line1#line2#line3
I thought of splitting into different lines at # but the Long text can actually have the # sign and this could cause an issue to other.
Howould would i get this into different lines.
I have tried this option
SPLIT itlines-tdline AT cl_abap_char_utilities=>cr_lf INTO TABLE it_tdline
but didnt work.
Any more suggestions,
Dan
‎2009 Nov 11 6:20 AM
Hi,
We too had faced this issue.
We splitted with cl_abap_char_utilities=>newline instead of cr_lf. Try this and check
Regards,
Swarna Munukoti.
‎2009 Nov 10 2:54 PM
You should get it in table. I am on ECC 5.0 and i got in table when i read using FM read_text.
‎2009 Nov 10 3:05 PM
it works good for the materials created in SAP, I am having issues when a materil is created from MDM.
Dan
‎2009 Nov 10 4:39 PM
Alright, i dont have MDM to test but i have tried copying from word document and also tried from text document. in both cases, i got the text in internal table format where TDFORMAT gives me what it means like line feed or command field and all other stuff.
I would recommend you to use another funciton module. go to Function group STXD and try other FMs. May be you can find another FM to get the formatted texts
‎2009 Nov 11 5:31 AM
Hi Dan,
SAP uses the "#"-sign to show a control character. Usually you never struggle with control characters in SAP data, unless the data came from an external system or users used copy&paste (e.g. copying&pasting a material description from a word document along with some newlines). Thus I'd suggest to first figure out what the control character is (i.e. simply use SE37 to read on material text and use debugger with hex view of the long text line to see what the actual character is; alternatively you could of course copy and paste the tool into some external application). I.e. since you only seem to have one "#" sign, it looks like your replacement of CR_LF cannot work (since that's two characters). So I'd expect your split should work once you've identified the right character.
In general I'd say, that within SAPscript (that's basically what those texts are, even if they are embedded into newer editor controls) shouldn't contain any control characters (after all, formatting is controlled via the TDFORMAT column and markup). So I'd also investigate, if you could prevent the material texts from having control characters (sounds like an issue from sending MDM system). I hope though, that I'm not telling any junk because of antiquated views...
Cheers, harald
‎2009 Nov 11 5:56 AM
hi ,
go through bellow code it may help u.
data: ist_lines type table of tline,
wa_lines type tline,
desc12 type string.
call function 'READ_TEXT'
exporting
CLIENT = SY-MANDT
id = 'F12'
language = 'E'
name = name1
object = 'EKKO'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER =
tables
lines = ist_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.
loop at ist_lines into wa_lines.
concatenate descp12 wa_lines-tdline into descp12.
endloop .
condense descp12.
replace all occurrences of '<(>&<)>' in descp12 with '&'.
clear wa_lines.
endif.
‎2009 Nov 11 6:20 AM
Hi,
We too had faced this issue.
We splitted with cl_abap_char_utilities=>newline instead of cr_lf. Try this and check
Regards,
Swarna Munukoti.
‎2009 Nov 16 9:36 PM