Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: converted page, updated screenshots

This explanation describes the FAB process flow and how it interfaces with ABAP and the SAP database.

...

Starting here is a typical scenario of a FAB for the development cycle.1.

  1. To get started you need to do nothing more than give the form a Form ID and Description and hit the tick.

      2. 

  1. Next, define your UI (User Interface) controls building on the defaulted template that the Create Icon provides.

...

Bind the controls to variables. 

    3.  After

  1. After you have defined some or all of your form controls you may want to place some front end validation on them.

...

For example, if they are changed i.e. a user enters data in the control.

...

Add a Script control and place any front end validations into the script.

          When

When the system detects that an input control has changed it looks for instructions as to what needs to be done if the input has changed.

...

The code executed is on a control by control basis.

...

Each control can have its own front end code written in JavaScript that validates or manipulates the entered data.

...

'Actions on change' tells FAB to execute the nominated function in the Script.

...

For an amount field, you may want to test for it being positive or that it is a number and has no characters.

...

If anything is found to be in error you probably alert the user and show an error.

      4.  Next

  1. Next, you probably want to introduce a process flow to the form. This is achieved by using the Workflow Icon on the FAB Workbench.

          This

This allows you to describe the roles, levels, tasks, and overview of the process flow

...

     Image Removed

     Image Removed

     Image Removed

     Image Removed

     Image Removed

     Image Removed

...

.

Info

Two-column process (workflow) designer view is only available for FAB version 3.3.1 and higher. Older versions of FAB will display the details pane of Workflow Definition but no Workflow Version List.

Preview of Workflow Version List:

...

Preview of Workflow Definition Details:

...

FAB offers ready-made templates for default approval process. To add this, click on the >>>Template button at the bottom of the screen. Select Draft,Submit,Approve.

...

Upon selecting, a confirmation popup will be displayed. Click on Yes.

...

This will automatically update the Roles, Levels, Tasks, and Process Flow in the workflow definition. Updates will be as follows:

...

Optional: Add validations upon form submission.

...

Save and close the workflow designer. Save the Form App.

   

  1. During the defining of the FAB Workflow/Status Management (shown in step 4) the developer took the opportunity

...

  1. to tell the system to do more front end validations before handing the form over to any backend validations

...

  1. or updates that need to be done in ABAP.

...

  1. These final front end validations are done in a function within the FAB Script and they are written in JavaScript.

...

In this FAB Workflow definition, the developer chose to have the function

...

onSubmitvalidation() executed

...

when the user hits the Submit button and before control is handed to ABAP.

       The code in the onSubmitValidations onSubmitValidation() is written by the developer and available in the Script.6.   

  1. For saving a form as Draft no validations are usually defined.

...

  1. Therefore, in step 4, there is no function assigned in the Validation Function column next to Draft.

       Image Removed

...

  1. If upon Submit all of the front end validations have completed without error then FAB starts running the backend processes.

...

  1. FAB looks for the Implementation Class associated with the form in order to know where to find the code it must execute.

...

You could have nominated the Implementation Class earlier but if you have not done so yet then now is the time to do so.

...

It has been optional until this point.

...

You may click on the wizard button (Image Modified) to have the implementing class name automatically generated.

       9. 

  1. The ABAP Implementation Class contains a series of methods in which you can redefine to include your own processes.

...

You can refer to these methods at any time by hitting the Code Icon ( Image Modified ) on the FAB Workbench toolbar menu.

...

Upon clicking, a popup window will be displayed.

...

Methods with redefinition created will have a 'Check' mark besides the ABAP Routine Icon ( Image Modified ).

...

If the chosen Workflow Mode

...

for the app is Process (default value), the following methods will be available:

      Image Removed

...

Else, if Workflow Mode for the app is Classic, the following methods will be available:Image Removed

...

      Notice how there are additional available methods for Process Workflows. To summarize, here is the tabulated list:

...

...

     *Processing On Load methods are executed every time the form application is first loaded.

     *Data Submission Processing methods are before and when the user hits Draft or Submit or Approve.

      

      The order in which FAB executes the methods within the ABAP Implementation class is as follows:10. 

  1. FAB looks for any code to be executed first in the VALIDATIONS_ON_SAVE method.

...

The code in this method usually does more in depth validations than those done by the JavaScript in the front end.

...

Using an ABAP case statement, the developer can control what code gets executed at what stage in the process flow.

...

  1. Next FAB looks to executes code in the ENHANCE_DATA_BEFORE_SAVE.

...

In this method, you may want to manipulate the data into a format that you want for storing into the SAP database.

...

  1. Next FAB executes code in the PERFORM_ACTIONS_FOR_STATUS_CHG.

...

If the form is being submitted, then code in this method could be something along the lines of retrieving the next

...

reference number in a series held in the SAP backend and storing it in a previously defined hidden form variable.

...

The value of certain variables that control the visibility of screen controls can be changed from true to false.

...

For example, depending on the action there may be a need to disable fields that an approver is not permitted to access and change.  

...

A common scenario in the PERFORM_ACTIONS_FOR_STATUS_CHG method is to have a case statement and

...

depending on the value of status and action variables, execute custom methods.

...

For example, if the Current Action is ‘APPROVE’ then the developer can branch-off and run a custom-built

...

method that updates the SAP database using a BAPI. 

...

  1. Next FAB executes code in the ENHANCE_SUCCESS_MESSAGE.

...

Upon successful execution of the Action, a success message can be sent back to the screen.

...

The contents of that message can be defined in this method but you will need to access this method directly

...

from the implementing class as this is not displayed in the Form Life-Cycle popup window.

...

  1. Having described the flow taking place when the form is submitted it now necessary

...

  1. to go back to describe the methods that are executed when the form is loaded.

...

  1. These ABAP methods enable the developer to leverage off data within your SAP database to supply important information to your FAB form.

...

DETERMINE_INITIAL_FIELD_VALUES can be used to find data and default information onto your form the very first time a form is loaded.

...

This may be used for picking up some information about the submitter that is to be shown

...

on the screen so that at a later point in time the approver is shown any required details.

...

For example: showing the status of the submitter as to whether they are set up in the system as a contractor or casual.

...

Since you are now using an ABAP method you can include any existing code that describes your business rules and place it into this method.

...

In order to redefine this method, you will also need to access this directly from the implementing class.

...

DETERMINE_FIELD_VALUES_ON_LOAD is executed each time the form is loaded.

...

This can be used to interrogate FAB variables and adjust visibility on the form according to the stage at which a form is at.

...

Once again it can be used to incorporate existing ABAP code that determines how you want data on the form to be manipulated and used.

...

  1. Finally FAB seeks to execute ‘Workflow’ processes that you may have setup. The methods that you may have redefined with your required code are:

...

a.

...

DETERMINE_APPROVERS_ON_SAVE.     

Use this method to determine approvers based on level. 

      Image Removed

...

b.  DETERMINE_APPROVERS_WORKFLOW     

Use this method if a SAP workflow task is used to determine approvers via Rule with function /IQX/RULE_DETERMINE_AGENTS.

 c. ESCALATION_PROCESS     Use

Use this method if you have setup FAB to do workflow escalations, See Workbench Workflow Icon.

...

For escalation, you need a background job to check on your setting.

...

In this method, you can add approvers or change approvers or do whatever is required for your escalation scenarios.

     Image Removed

...

Ending here is a typical scenario of a FAB for the development cycle.

For more information on the ABAP implementation class, you may refer to Application Form Life-Cycle > ABAP Implementation

Filter by label (Content by label)
showLabelsfalse
max5
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@223dfe
showSpacefalse
sorttitle
typepage
cqllabel in ( "code" , "javascript" , "workflow" , "escalation" ) and type = "page" and space = currentSpace ( )
labelskb-how-to-article

...