08-18-2011 5:55 AM
Hello,
We will receive xml files containing product data that I want to upload into the sales text of our materials in JP28.
Using the iXML library with T_FILE_PARSE program as an example I can easily extract most fields but the problem is that one field has paragraphs of text in CData. Using the code bellow I can extract some of the data as a string but it's too short to get everything.
case node->get_type( ).
when if_ixml_node=>co_node_cdata_section.
break grainneq.
text = node->get_value( ).
write: / 'CDATA:'.
write at indent text color col_group inverse.
Looking in the library
08-18-2011 6:03 AM
This is the XML file tag I'm concerned with
<longDescription><![CDATA[This chapter contains blah blah blah goes on for a few paragraphs
.......................................
.......................................
]]></longDescription>
08-18-2011 6:16 AM
Hi,
Method GET_VALUE() returns value of type string.
text = node->get_value( ).
Please check type of text.
Regards,
Ravi.
08-18-2011 8:53 AM
as shakar said ,
data: lt_text type table of string .
lt_text[] = node->get_value( ).
regards
Prabhu
08-19-2011 6:43 AM
My bad, text was in fact receiving the full string (I thought it was truncating).
So I've just added a function module to split the string into lines that the CREATE_TEXT fm can handle.
Both responses were helpful so I've awarded points....although the question was probably confusing to you as the data was there along:)
Thanks for the quick response in any case.
when if_ixml_node=>co_node_cdata_section.
text = node->get_value( ).
call function 'SWA_STRING_SPLIT'
exporting
input_string = text
max_component_length = 132
tables
string_components = swastrtab.