ABAP File Formats


Albert Mink, @SAP

Lars Hvam, @heliconialabs

Disclaimer

  • Everything might change
  • Check respective licenses

History of sharing ABAP code

Let's talk about the ABAP file formats

What is ABAP file formats (AFF)?

Public definition of file content that is human-readable, complete and without redundancy

How?

For every object there is exactly one file named object_name.type.json

For its annotation and validation there is a JSON Schema, generated from an ABAP type

Examples

  • Form-based object: BAdI Enhancement Spot
  • Source-based object: ABAP Interface

BAdI Enhancement Spot

ADT form-based editor

AFF file


              {
                "formatVersion": "1",
                "header": {
                  "description": "WB Object Versioning",
                  "originalLanguage": "en"
                },
                "configuration": {
                  "tool": "badiDefinition"
                },
                "badiDefinitions": [
                  {
                    "name": "BADI_WB_OBJECT_VERS_PROVIDER",
                    "description": "BAdI  definition for workbench",
                    "interface": "IF_WB_OBJECT_VERSION_PROVIDER",
                    "instantiation": "creatingNewInstances",
                    "multipleUse": false,
                    "fallbackClass": "CL_BLUE_SVRS_VERSION_PROVIDER",
                    "filters": [
                      {
                        "name": "OBJECT_TYPE",
                        "description": "Workbench object type",
                        "type": "characterLike"
                      }
                    ]
                  }
                ]
              }
              

Filenames and formatting

Filename is composed by

  • obj_name.type.json

Ensure interchangeability by formatting

  • UTF-8
  • End-of-line marker LF ('\n')
  • Empty line at end-of-file

ABAP Interface

File Description
object_name.intf.abap ABAP source code
object_name.intf.json Metadata file

Metadata file in AFF

JSON data can be intuitive


            {
              "formatVersion": "1",
              "header": {
                "description": "AFF: Interface v1",
                "originalLanguage": "en"
              }
            }
          

Possible validation and annotation with JSON Schema, e.g. VS Code Extension

Metadata file in abapGit

XML data for creation of the object

Metadata file in gCTS

The database entries as JSON data

          ...
          {
            "table": "SEOCLASSTX",
            "data": [
              {
                "CLSNAME": "ZIF_ABAPGIT_AFF_INTF_V1",
                "LANGU": "E",
                "DESCRIPT": "AFF: Interface v1"
              }
            ]
          },
          {
            "table": "SEOCLASSDF",
            "data": [
            {
              "CLSNAME": "ZIF_ABAPGIT_AFF_INTF_V1",
              "VERSION": 1,
              "CATEGORY": 0,
              "EXPOSURE": 2,
              "STATE": 1,
              "RELEASE": 0,
              "AUTHOR": "MR_X",
          ...
          

Vision of ONE file format

ADT History/Compare

abapGit, abapGit Eclipse plugin (Steampunk)

Available object types

AFF specifies more than 27 object types

SAP Basis 7.56 and newer provides serializers

abapGit supports: INTF (experimental and via ajson), ATC Check Variants (CHKV), RAP Business Event Bindings (EVTB), ...

abapGit focuses on AFF for new object types

BREAK-POINT.

Schema in ABAP

Schema Generation

from ABAP in ABAP

github.com/SAP/abap-file-formats-tools

Automated Schema Generation

JSON Schema Generation

ABAP logic running in browser,
larshp.github.io/aff-web

abapGit activation

  • Can be tested via "experimental" switch
  • Will be enabled when no information is lost(translations and long text)
  • Pull old format, stage new format
  • Still 702 and up(if object works on the system)

abapGit migration

  • Ongoing for long time, also before AFF
  • Automated opening of PRs with updates on GitHub

Thanks to all contributors

14r5 AlexandreHT AndreaBorgia-Abo BeckerWdf BlackmanCC BurnerPat ChristopheCaparros Christopher-Hermann D047539 DerGuteWolf Dwivedirahul44 Ehret-Thomas ElNovi Elberet ErdoesiT Fmueller17 FreHu FunMustBe GiantCrocodile GoWale GuilhermeSaraiva96 HenrikGraugaard Hir0ki IvxLars JXYSGX7C JanisB-AT JohannesKonings JustACasual KDS42 Lutzi3 NicolasBusson OberstVonGatow OleksiiMalikov Olivia266 PeregrinTooc PilotFlying Postavka RainerWinkler RedWolf112 SaschaWaechter SebastianWolf-SAP Sirius-A Srinu3366 TheWirtschaftsmann ThomasPloski ThoralfHaensel TimoJohn TomK01 VishnAndr WegnerDan WolfTreak Zeatynis abap-weasel abapChaoLiu abinbaby-sap absap albertmink alex-salnikov alexanderchan alexanderpetrenz antonioyanez arcanist123 bigld bolarsson boy0korea buca92 burcuka ch-holzer cherifimourad chrismills christian102094 christianguenter2 christianguenter3 christianp86 czaikowsky d023604 d034973 damir-majer deborsa delucapietro dependabot-preview[bot] dependabot[bot] drakth ed-holland eduardocopat esjewett fabianlupa fdupret fidley filak-sap flyingSAP fossabot frij-aws g-back geert-janklaps gepparta germanysources giovannidegani github-actions[bot] goreraks grahamrobbo greenkeeper[bot] greenkeeperio-bot greg2git gregorwolf h13m9 habrahams hectormartinezn heichmann hf-kklein hhelibeb huber-nicolas ibnbr insidy ivanfemia jan-jezek jhunni joltdx jrodriguez-rc jsiglen juancarlosrodriguezf juriadasek jwigert kjetil-kilhavn kvtorp kwaishang larshp lucasborin manhofmann marcellourbani marcushoepfner markstuppacher matt1as mauriciolauffer maxim-engel-sap mbtools mfsap micotto mkaesemann mrsimpson mseich naveensrinivasan nomssi nununo olirogers p-dmitrij pawelwiejkut pcf0 pfaller pokrakam psio3123 raaleksandr rauva rayatus sambarza sandraros sbcgua schmelto schneider-michael schneidermic0 sdfraga se38 sepp4me sercankd shaiSAP shubhamWaghmare-sap shyambalachandran smb sratz sshlapak stefan-riedel-seifert stockbal thomas-erdoesi thorsten-wolf-neptune tiefox treisinger uenal-akkaya valdirmendesdev victorizbitskiy vonglan wombling wozjac wurzka xtough yellappam

Links

#ABAPisNotDead

https://larshp.github.io/abapconf2022/
Creative Commons License