Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Within JavaScript too it is easier to get/set data in the model. The data in the app at run-time has the same structure as represented in the FAB/ABAP Data Model Note only that it is in JSON format. Here we know of it more as the ‘Model’, and we can access it via standard JavaScript Code or more efficiently use the FAB delivered functions.

    For example: getField(“Orders”) will retrieve the array of Orders

    Here the first Order contains 2 OrderItems and the second as 3.

    You can access the OrderItems of the a particular index using the syntax getField("Orders/0/OrderItems")

Copying Data Model from Another App

Copying a Structure/Table:

  1. Create a new Structure or Table in your new Application named exactly like the one you wish to copy.
  2. Provide the Application Name of the Source App in the Reference FAB Project property.
  3. Provide the Structure name of the structure you are copying in the Reference Node property.
  4. Right click the Structure and select Add Fields from FAB Reference Project.
  5. The fields will be copied from the Source App.

Copying an Entire Data Model (From the Root Node)

  1. Set the Reference FAB Project as the Application Name of the source Application
  2. Right click the Structure and select Add Fields from FAB Reference Project.
  3. The fields will be copied from the Source App.

Sample FAB Application

Upload this XML file in the FAB Workbench (TCODE /IQX/FAB)
View filenameADAM_DEMO_DATA_MODEL_000001.xmlheight250
Create a class in SE24 with the name YCL_ADAM_DEMO_DATA_MODEL. Once created, switch the Class in Source Code-Based mode by clicking on  then copy and paste the code from the file below. Activate the class
View filename
YCL_ADAM_DEMO_DATA_MODELheight250

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@223dfe
showSpacefalse
sorttitle
typepage
cqllabel in ( "properties" , "app-life-cycle" , "fabworkbench" ) and type = "page" and space = currentSpace ( )
labelslist-control

...