DATA : lr_ixml TYPE REF TO if_ixml, lr_doc TYPE REF TO if_ixml_document, lr_root_elem TYPE REF TO if_ixml_element, lr_node1_elem TYPE REF TO if_ixml_element, lr_stream TYPE REF TO if_ixml_stream_factory, lr_ostream TYPE REF TO if_ixml_ostream, lr_render TYPE REF TO if_ixml_renderer, xml_string TYPE string. lr_ixml = cl_ixml=>create( 0 ). * Get reference of the document lr_doc = lr_ixml->create_document( ). * get reference of the root lr_root_elem = lr_doc->create_simple_element_ns( prefix = ‘asx’ name = ‘test’ parent = lr_doc ). * Add root element attributes lr_root_elem->set_attribute_ns( name = ‘asx’ prefix = ‘xmlns’ value = ‘http://www.sap.com/testxml’ ). lr_root_elem->set_attribute_ns( name = ‘version’ value = ‘1.0’ ). * Get reference of the first node of teh root lr_node1_elem = lr_doc->create_simple_element_ns( prefix = ‘asx’ name = ‘names’ parent = lr_root_elem ).
Category: Uncategorized
Encode and Decode String for security reason in SAP UTF8 Format
PARAMETERS : p_string TYPE string. DATA : lv_encode_str TYPE xstring, lv_decode_str TYPE string. WRITE ‘Plain String :’, p_string. CALL METHOD cl_http_utility=>if_http_utility~encode_utf8 EXPORTING unencoded = p_string RECEIVING encoded = lv_encode_str. WRITE
‘Encoded String:’, lv_encode_str COLOR 5. CALL METHOD cl_http_utility=>if_http_utility~decode_utf8 EXPORTING encoded = lv_encode_str RECEIVING unencoded = lv_decode_str. WRITE
‘Decoded Sing:’, lv_decode_str COLOR 3.
Encode and Decode String for security reason in SAP
SAP provides standard Utility class CL_HTTP_UTILITY which provides methods that can be used to encode and decode string for security reasons. PARAMETERS : p_string TYPE string. DATA : lv_encode_str TYPE string,
Removing HTML tags from String
Step1. The FM – SOTR_TAGS_REMOVE_FROM_STRING can be used to remove all the HTML tags from the string variable and just replies back only the text. Go
Code page used SAP System & Language Specific Code Page
Character Encoding is like utf-8 etc. Code Page is used instead of character encoding in SAP and code page is a 4 digit number. Go
WAIT UP TO … Secs Command Vs FM : ENQUE_SLEEP
Post Summary: ABAP Command – WAIT UP TO … Secs holds the program processing for that seconds but it internally triggers a data babe commit