javascript
【转】ABAP内表数据和JSON格式互转
本程序演示ABAP內表數據如何轉為JSON格式,
以及JSON數據如何放入內表。
REPORT?ZTEST005.
DATA?:?JSON_SER?TYPE?REF?TO?CL_TREX_JSON_SERIALIZER,
???????JSON_DES?TYPE?REF?TO?CL_TREX_JSON_DESERIALIZER.
DATA?:?JSONSTR?TYPE?STRING.
DATA?:?BEGIN?OF?ITAB?OCCURS?0?,
?????????MATNR?TYPE?MAKT-MATNR,
?????????MAKTX?TYPE?MAKT-MAKTX,
???????END?OF?ITAB.
START-OF-SELECTION.
??SELECT?*?INTO?CORRESPONDING?FIELDS?OF?TABLE?ITAB
????FROM?MAKT?UP?TO?20?ROWS?WHERE?SPRAS?=?'1'.
??"內表-》JSON
??CREATE?OBJECT?JSON_SER
????EXPORTING
??????DATA?=?ITAB[].
??CALL?METHOD?JSON_SER->SERIALIZE.
??CALL?METHOD?JSON_SER->GET_DATA
????RECEIVING
??????RVAL?=?JSONSTR.
??"JSON-》內表
??REFRESH?ITAB[]."會append
??CREATE?OBJECT?JSON_DES.
??CALL?METHOD?JSON_DES->DESERIALIZE
????EXPORTING
??????JSON?=?JSONSTR
????IMPORTING
??????ABAP?=?ITAB[].
??LOOP?AT?ITAB.
????WRITE?:?/?SY-TABIX,ITAB-MATNR,ITAB-MAKTX.
??ENDLOOP.
- ABAP:
- EPO Connector.
- ActionScript:
- ActionScript3.
- Ada:
- GNATCOLL.JSON.
- AdvPL:
- JSON-ADVPL.
- ASP:
- JSON for ASP.
- JSON ASP utility class.
- AWK:
- JSON.awk.
- rhawk.
- Bash:
- Jshon.
- JSON.sh.
- BlitzMax:
- bmx-rjson.
- C:
- JSON_checker.
- YAJL.
- LibU.
- json-c.
- json-parser.
- jsonsl.
- WJElement.
- M's JSON parser.
- cJSON.
- Jansson.
- jsmn.
- parson.
- ujson4c.
- nxjson.
- frozen.
- microjson.
- C++:
- JSONKit.
- jsonme--.
- ThorsSerializer.
- JsonBox.
- jvar.
- rapidjson.
- JSON for Modern C++.
- ArduinoJson.
- minijson.
- jsoncons.
- QJson.
- jsoncpp.
- JOST.
- CAJUN.
- libjson.
- nosjob.
- JSON++.
- JSON library for IoT.
- qmjson.
- JSON Support in Qt.
- JsonWax for Qt.
- C#:
- fastJSON.
- JSON_checker.
- Jayrock.
- Json.NET - LINQ to JSON.
- LitJSON.
- JSON for .NET.
- JSON@CodeTitans.
- JSONSharp.
- fluent-json.
- Manatee Json.
- FastJsonParser.
- LightJson.
- Ciao:
- Ciao JSON encoder and decoder.
- Clojure:
- data.json.
- Cobol:
- XML Thunder.
- Redvers COBOL JSON Interface.
- ColdFusion:
- SerializeJSON.
- toJSON.
- D:
- Libdjson.
- Dart:
- json library.
- Delphi:
- Delphi Web Utils.
- JSON Delphi Library.
- E:
- JSON in TermL.
- Fantom:
- Json.
- FileMaker:
- JSON.
- Fortran:
- json-fortran.
- YAJL-Fort.
- Go:
- package json.
- Groovy:
- groovy-io.
- Haskell:
- RJson package.
- json package.
- Java:
- JSON-java.
- JSONUtil.
- jsonp.
- Json-lib.
- Stringtree.
- SOJO.
- json-taglib.
- Flexjson.
- JON tools.
- Argo.
- jsonij.
- fastjson.
- mjson.
- jjson.
- json-simple.
- json-io.
- JsonMarshaller.
- google-gson.
- Json-smart.
- FOSS Nova JSON.
- Corn CONVERTER.
- Apache johnzon.
- Genson.
- JSONUtil.
- cookjson.
- JavaScript:
- JSON.
- json2.js.
- clarinet.
- Oboe.js.
- LabVIEW:
- flatten.
- Lisp:
- Common Lisp JSON.
- Emacs Lisp.
- LiveCode:
- mergJSON.
- LotusScript:
- JSON LS.
- LPC:
- Grimoire: LPC JSON.
- Lua:
- JSON Modules.
- M:
- DataBallet.
- Matlab:
- JSONlab.
- 20565.
- 23393.
- Net.Data:
- netdata-json.
- Nim:
- Module json.
- Objective C:
- NSJSONSerialization.
- json-framework.
- JSONKit.
- yajl-objc.
- TouchJSON.
- OCaml:
- Yojson.
- jsonm.
- PascalScript:
- JsonParser.
- Perl:
- CPAN.
- perl-JSON-SL.
- Photoshop:
- JSON Photoshop Scripting.
- PHP:
- PHP 5.2.
- PicoLisp:
- picolisp-json.
- Pike:
- Public.Parser.JSON.
- Public.Parser.JSON2.
- PL/SQL:
- pljson.
- PowerShell:
- PowerShell.
- Puredata:
- PuRestJson.
- Python:
- The Python Standard Library.
- simplejson.
- pyson.
- Yajl-Py.
- ultrajson.
- metamagic.json.
- R:
- rjson.
- jsonlite.
- Racket:
- json-parsing.
- Rebol:
- json.r.
- RPG:
- JSON Utilities.
- Rust:
- Serde JSON.
- json-rust.
- Ruby:
- json.
- yajl-ruby.
- json-stream.
- yajl-ffi.
- Scheme:
- MZScheme.
- PLT Scheme.
- Squeak:
- Squeak.
- Symbian:
- s60-json-library.
- Tcl:
- JSON.
- Visual Basic:
- VB-JSON.
- PW.JSON.
- .NET-JSON-Transformer.
- Visual FoxPro:
- fwJSON.
- JSON.
- vfpjson.
總結
以上是生活随笔為你收集整理的【转】ABAP内表数据和JSON格式互转的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【转】ABAP的坑5
- 下一篇: SAP中用json数据格式调用http接