Created
September 25, 2014 05:16
-
-
Save js1972/0d76d1216069fe1789e1 to your computer and use it in GitHub Desktop.
Example ABAP code using sql host variables (@) which is the standard as of 7.40 and showing the SAP standard way to do JSON conversion.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
report y_test_json_output. | |
DATA purchaseorders TYPE STANDARD TABLE OF ekko. | |
SELECT * FROM ekko | |
INTO TABLE @purchaseorders | |
where bukrs = '2000' | |
and ernam = 'JSCOTT'. | |
DATA(lo_json_writer) = cl_sxml_string_writer=>create( type = if_sxml=>co_xt_json ). | |
CALL TRANSFORMATION id SOURCE itab = purchaseorders RESULT XML lo_json_writer. | |
cl_demo_output=>display_json( lo_json_writer->get_output( ) ). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment