sap_connect 0.1.0
sap_connect: ^0.1.0 copied to clipboard

provides connection to the SAP server, making requests to the SAP server, receiving and processing data from the SAP server in response to requests

sap_connect - the package is designed to establish a connection and then execute queries to the SAP system #

Visually represents a screen for setting up a connection and logging to SAP system GIF showing / hiding connection settings and switching input language

Connection settings are saved on the device
Provides connection and work in the language chosen by the user (internationalization)
After the connection is established, it allows you to perform queries to the SAP server

To make this package work, you must install to the SAP server package YDK_WEBS.

The package comes with a simple but fully working example, see the folder example\sap_flights_simplest_demo

To simplify the creation of the application and all the necessary settings, you can use the class SapApplication
The main settings of the application are stored in the class SapStartParams
Application debugging can be performed without the SAP server, but with simulating server interaction, see global variable [kFakeHandler] in sap_connect.dart
Use the methods to execute server requests: SapConnect().fetchPostWS(...) or SapConnect().fetchPost(...).
Difference between SapConnect().fetchPostWS(...) and SapConnect().fetchPost(...) methods:

  • SapConnect().fetchPostWS(...) Making a request to the server with a blocking screen output, the WaitScreen obscures the program screen during the execution and processing of the request. During execution of the processing of query results, additional requests to the server can be executed using fetchPost.
  • SapConnect().fetchPost(...) Just executes a request to the server, returns Future on the result of execution

general development approach:

on the SAP server, create the class inherited from class YDK_CL_WEBS_ACTION and make a class-method in it class:

CLASS <name of class> DEFINITION inheriting from YDK_CL_WEBS_ACTION....   
  CLASS-METHODS <name of method>
      !action_data TYPE string   " incaming query, usually a string JSON 
      !return_status TYPE string " return status of processing result
      !return_data TYPE string.  " returned data, most often a string JSON

  METHOD <name of method>.
* In order to make it easier to work with request data, load the request into the variable with a structure corresponding to the request structure (query)
    from_json( EXPORTING json = action_data CHANGING data = query ).

* Process the request, fill in the structure for returning data (ret_data)

* Return the processing result (ret_data)
    get_json( EXPORTING data = ret_data IMPORTING return_status = return_status return_data = return_data ).	

Call the created method from the mobile application:

      handlerType  : HandlerType.Method,
      handlerID    : <name of class>,
      action       : <name of method>,
      actionData   : query, // usually a string JSON 
      context      : context,
      postCallback : (Post post) {
        if (post.returnStatus != PostStatus.OK) return;
        setState(() {
// processing query results saved in post.returnData

the status returned by the SAP server (return_status) is a string, two values are reserved

  • "OK" - in dart constant PostStatus.OK; in abap constant YDK_CL_WEBS_ACTION=>STATUS_OK - request processing was successful
  • "ERR" - in dart constant PostStatus.Error; in abap constant YDK_CL_WEBS_ACTION=>STATUS_ERR - the processing was NOT successful, in this case the description of the error is in post.returnData, simple string not JSON

any other values can be used by the programmer as he pleases

pub points

provides connection to the SAP server, making requests to the SAP server, receiving and processing data from the SAP server in response to requests

Repository (GitHub)
View/report issues




async, cookie_jar, crypto, device_id, flutter, flutter_localizations, fluttertoast, intl, open_file, package_info, path_provider, shared_preferences


Packages that depend on sap_connect