Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

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

Notifications You must be signed in to change notification settings

SAP-archive/SAP-Business-One-Service-Layer-SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());		
        }
        
    }

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published