Liquid UI - Documentation - 4.01 Data Synchronization

4.01 Data Synchronization


Data synchronization between Offline and SAP ERP can be performed in two separate ways - by user action or automatically. Synchronization by user action is the most common method, where the synchronization process is divided into Upload and Download buttons in the application. Automatic synchronization occurs whenever a WiFi connection is available and is used primarily for a Master Record - Addendum structure. In this method, when a WiFi connection becomes available, a button labeled 'Synchronization' will appear. Users can then click the button to synchronize the data between Offline and SAP ERP.

All synchronization must take place through the GuiXT Server. Therefore, this section is divided into two separate parts, as follows:

  • Client Configuration
  • Server Configuration

Synactive recommends that each Offline transaction should have a separate script file and that these script files should be stored in the SynScript folder previously discussed.

There are two synchronization methods that users can employ to synchronize data between Offline and SAP. Both methods use standard APIs in Offline to communicate with GuiXT Server. The Server then passes the data on to the SAP ERP system. Both methods also contain the same Upload and Download functions. These methods are as follows:

  • Generic Synchronization
  • Configurable Synchronization

As explained in the Offline Architecture section earlier, the Offline client synchronizes data with SAP via the GuiXT Server. The GuiXT Server is responsible for processing client requests in SAP and also for forwarding the SAP responses to the Offline client.


Client Configuration

The Offline client needs to know through which GuiXT server the data requests will be processed and sent to SAP. Therefore in this connection model, the users will specify the GuiXT server in the client. This determination is different for both generic synchronization and configurable synchronization.

Generic Synchronization

With generic synchronization, the Offline client can connect to only a single GuiXT Server at run time. The GuiXT server connection information is retrieved from the logon screen where users enter the server information. When synchronization starts, the Offline client connects to this server and this specified server handles all the requests.

  • SR3GenericDownloadProcess: The Generic Download Process is defined in the SynR3.js file and is as follows:
     
    SR3GenericDownloadProcess(strDownloadCode,arCriteriaScreen,arKeyFields,bSendStatusMessage,strDownloadTable);

    The arguments are defined as follows:

    • strDownloadCode: Process code that must be sent to the GuiXT Server in order to create
      the layout for current download processing in server.
    • arCriteriaScreen: The download criteria that will be sent to GuiXT Server to determine
      the data set that will be downloaded from SAP ERP.
    • arKeyFields: Unique data table columns or a combination of columns that will be
      populated by unique data.
    • bSendStatusMessage: Messages sent to the user.
    • strDownloadTable: Table that information will be downloaded into. If this table is not
      specified, Offline will store data in the table that corresponds to the current transaction.
  • SR3GenericUploadProcess: The Generic Upload Process, like the Download Process, is defined in the SynR3.js file. The function itself may be written as follows:
     
    SR3GenericUploadProcess(strUploadCode,nShowRows,strAdditionalCondition,strAdditionalTableNames,bSendStatusMessage);
    

    The arguments are defined as follows:

    • strUploadCode: Process code that must be sent to the GuiXT Server in order to create the layout for current upload processing in server.
    • nShowRows: The number of records that will be uploaded at the given time.
    • strAdditionalCondition: A condition that is created to specify what data is to be uploaded. Typically, this will be all modified records, so a common condition would be as follows: RESERVED_MODIFIED_NAME='X'
    • strAdditionalTableNames: Any additional table names from which the user wishes to upload data.
    • bSendStatusMessage: Messages sent to the user.


Configurable Synchronization

The Client is able to connect multiple GuiXT Servers run time. This means while users are in an offline application, they can initiate synchronization with the option of data synchronization going through any GuiXT Server that is defined in the system.

If a company has multiple GuiXT Servers defined in the network, offline has the capability to utilize all these servers in data synchronization. All possible GuiXT Server connections are defined in config.js in offline platform as constants as shown below:

const S1 = {servername:"server1",client:800,language:"en"};
const S2 = {servername:"server2",client:800,language:"en"};
  • SR3GenericDownloadProcessConfigurable: The Generic Upload Process Configurable is also defined in the SynR3.js file and is as follows:
     
    SR3GenericDownloadProcessConfigurable(objServer,strUserName,strPassword,strDownloadCode,arCriteriaScreen,arKeyFields, bSendStatusMessage,strDownloadTable,nType);

    The arguments are defined as follows:

    • objServer: The GuiXT Server to which Offline will connect. The predefined connection constants (S1,S2…) are sent to this parameter.
    • strUserName: The current user logged into the device.
    • strPassword: Password for the current user.
    • strDownloadCode: Process code that must be sent to the GuiXT Server in order to create the layout for current download processing in server.
    • arCriteriaScreen: The download criteria that will be sent to the GuiXT Server to determine the data set that will be downloaded from SAP ERP.
    • arKeyFields: Unique data table columns or a combination of columns that will be populated by unique data.
    • bSendStatusMessage: Boolean value that specifies if status messages are to be sent to the user.
    • strDownloadTable: Table that information will be downloaded into. If this table is not specified, Offline will store data in the table that corresponds to the current transaction.
    • nType: The type of download. There are four distinct types, as follows:
      • 0: All unmodified records in a data table will be deleted and downloaded again.
      • 1: All records in a data table will be deleted before the download starts.
      • 2: Only modified records in a data table are deleted before download starts.
      • 3: Unmodified records in a data table are deleted and existing records are skipped.
  • SR3GenericUploadProcessConfigurable: The Generic Upload Process Configurable is also defined in the SynR3.js file and is as follows:
    SR3GenericUploadProcessConfigurable(objServer,strUserName,strPassword,strUploadCode,nShowRows,strAdditionalCondition,strAdditionalTableNames,bSendStatusMessage);

    The arguments are defined as follows:

    • objServer: The GuiXT Server to which Offline will connect. The predefined connection constants (S1,S2…) are sent to this parameter.
    • strUserName: The current user logged into the device.
    • strPassword: Password for the current user.
    • strUploadCode: Process code that must be sent to the GuiXT Server in order to create the layout for current upload processing in server.
    • nShowRows: The number of records that will be uploaded at the given time.
    • strAdditionalCondition: A condition that is created to specify what data is to be uploaded. Typically, this will be all modified records, so a common condition would be as follows: RESERVED_MODIFIED_NAME='X'
    • strAdditionalTableNames: Any additional table names from which the user wishes to upload data.
    • bSendStatusMessage: Boolean value that will specify if status messages are to be sent to the user.

Can't find the answers you're looking for?