Skip to content

Instantly share code, notes, and snippets.

@kgorin8
Last active February 26, 2023 15:53
Show Gist options
  • Save kgorin8/922e91b4223479f996e4ecf0a12b2537 to your computer and use it in GitHub Desktop.
Save kgorin8/922e91b4223479f996e4ecf0a12b2537 to your computer and use it in GitHub Desktop.
data: lr_tab type ref to data.
field-symbols <lt_tab> type table.
try.
create data lr_tab type standard table of (iv_table_name).
assign lr_tab->* to <lt_tab>.
catch cx_sy_create_data_error.
ev_exmessage = 'Error in data creation' && iv_table_name. "#EC NOTEXT
ev_rc = 4.
return.
endtry.
select * from (iv_table_name) into table <lt_tab> where (iv_where).
call transformation id
source root = <lt_tab>
result xml ev_xml.
replace all occurrences of '&' in ev_xml with '&amp;'.
replace all occurrences of '>' in ev_xml with '&gt;'.
replace all occurrences of '<' in ev_xml with '&lt;'.
replace all occurrences of '"' in ev_xml with '&quot;'.
replace all occurrences of '''' in ev_xml with '&#39;'. " '&apos;'
replace all occurrences of cl_abap_char_utilities=>newline in ev_xml with cl_abap_char_utilities=>cr_lf.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment