GithubHelp home page GithubHelp logo

isabella232 / sap-business-one-service-layer-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sap-archive/sap-business-one-service-layer-sdk

0.0 0.0 0.0 1.16 MB

An SDK for SAP Business One Service Layer OData interface. Provide CRUD and filter functions by in strong type programming languages. Easy to use and efficient for partner to build Business One add-ons.

License: Apache License 2.0

Java 89.14% Batchfile 0.39% FreeMarker 10.47%

sap-business-one-service-layer-sdk's Introduction

Important Notice

This public repository is read-only and no longer maintained.

SAP Business One Service Layer SDK

Business One Service Layer SDK make it easy to access SAP Business One Service Layer OData interface.

Introduction

  1. Strong typed, detection of errors speeds development Strong Type
  2. Content assist intelligent code recommander & completion Code Completion
  3. Logger shows what happening in detail Logs

Examples

  1. Login & Logout

    Usage typically looks like this, an adaptation of the canonical Retrofit sample.

    public class Logon 
    {
        static public void main(String[] argc) throws Exception 
        {
            ServiceLayerClient client = login();
            logout(client);
        }
    
    
        public static void logout(ServiceLayerClient client) 
        {
            Logout logout = client.target(Logout.class);
            logout.logout();		
        }
    
    
        public static ServiceLayerClient login() throws Exception
        {
            ServiceLayerClient client = ServiceLayerClient.inSecureClient("https://xxx.xxx.xxx.xxx:50000/b1s/v1");
            Login login = client.target(Login.class);
            Login.LoginParam param = new Login.LoginParam();
            param.setCompanyDB("SBODEMOUS");
            param.setUserName("manager");
            param.setPassword("******");
            login.login(param);	
            return client;
        }
    }
  2. Create Order

    public class AddOrder 
    {
        static public void main(String[] argc) throws Exception 
        {
            ServiceLayerClient client = Logon.login();
            addOrder(client);
            updateOrder(client);
            Logon.logout(client);
        }
        private static void updateOrder(ServiceLayerClient client) {
            Orders orderService = client.target(Orders.class);
            Document document= new Document();
            document.setReference1("test");
            orderService.update(2, document);
        }
        private static void addOrder(ServiceLayerClient client) 
        {
            Orders orderService = client.target(Orders.class);
            Document document= new Document();
            document.setCardCode("C");
            document.setDocDate(LocalDate.now());
            document.setDocDueDate(LocalDate.now());
            DocumentLine line = new DocumentLine();
            line.setItemCode("i1");
            line.setQuantity(BigDecimal.valueOf(1));
            line.setPrice(BigDecimal.valueOf(1.3));
            document.getDocumentLines().add(line);
            Document docCreated = orderService.create(document);
            System.out.println("Document created with Number :" + docCreated.getDocNum());		
        }
        
    }

sap-business-one-service-layer-sdk's People

Contributors

jingchen24 avatar priyankasakundarwar avatar sebastianwolf-sap avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.