Thesis

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

}w!"#$%&'()+,-.

/012345<yA|
Masaryk University
Faculty of Informatics

Optimization of Order and


Purchase Process in SAP and
Integration with Print System

Master Thesis

Radovan Nieslanik

Brno, Autumn 2016


Declaration
Hereby I declare, that this paper is my original authorial work, which
I have worked out by my own. All sources, references and literature
used or excerpted during elaboration of this work are properly cited
and listed in complete reference to the due source.

Radovan Nieslanik

Advisor: Mgr. Juraj Michálek

ii
Acknowledgement
I would like to thank my supervisor Juraj Michálek for his professional
supervision, comments and overall support during the formation of
this work. Also I would like to thank my college Iva Skřivánková for
counsel during the technical implementation and ABB to make this
master thesis possible.

iii
Abstract
The aim of the thesis is to provide overlook over ABB’s sales and
purchase process and optimize it. Then on given document of the
process there is implemented prototype of Fiori mobile application.

iv
Keywords
SAP, YSoft SafeQ, Fiori, Automatization, Sales and Purchase process

v
Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 ERP SAP system . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1 ERP Systems . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 SAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 Brief history . . . . . . . . . . . . . . . . . . . . . 4
2.2.2 SAP S/4 HANA . . . . . . . . . . . . . . . . . . . 4
2.2.3 ERP Market . . . . . . . . . . . . . . . . . . . . . 5
2.2.4 SAP Products . . . . . . . . . . . . . . . . . . . . 6
2.3 mySAP Business Suite . . . . . . . . . . . . . . . . . . . . 6
2.4 SD and MM module . . . . . . . . . . . . . . . . . . . . . 7
2.4.1 Sales and Distribution module . . . . . . . . . . 7
2.4.2 Material Management module . . . . . . . . . . 7
3 Process to be automated . . . . . . . . . . . . . . . . . . . . . 9
3.1 Former manual processing . . . . . . . . . . . . . . . . . . 9
3.2 Automatization . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 IDoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4 Documents of process . . . . . . . . . . . . . . . . . . . . . 13
3.4.1 Sales order . . . . . . . . . . . . . . . . . . . . . . 15
3.4.2 Purchase requisition . . . . . . . . . . . . . . . . 15
3.4.3 Purchase order . . . . . . . . . . . . . . . . . . . 15
3.4.4 Inbound delivery . . . . . . . . . . . . . . . . . . 16
3.4.5 Post goods receipt . . . . . . . . . . . . . . . . . 16
3.4.6 Outbound delivery . . . . . . . . . . . . . . . . . 17
3.4.7 Post goods issue . . . . . . . . . . . . . . . . . . . 17
3.4.8 Invoice . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4.9 Release billing document . . . . . . . . . . . . . 18
3.5 Application requirements . . . . . . . . . . . . . . . . . . . 18
4 Development . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1 End user delivery . . . . . . . . . . . . . . . . . . . . . . . 19
4.1.1 ABAP programs . . . . . . . . . . . . . . . . . . 19
4.1.2 Web Dynpro . . . . . . . . . . . . . . . . . . . . . 19
4.1.3 Fiori . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.1.4 Choice of delivery . . . . . . . . . . . . . . . . . 20
4.2 Technologies used . . . . . . . . . . . . . . . . . . . . . . . 21
4.2.1 Programming language . . . . . . . . . . . . . . 21

vi
4.2.2 Selection screen . . . . . . . . . . . . . . . . . . . 22
4.2.3 Data retrieval . . . . . . . . . . . . . . . . . . . . 22
4.2.4 Temporal Tables . . . . . . . . . . . . . . . . . . . 24
4.2.5 BAPI and BADI . . . . . . . . . . . . . . . . . . . 25
4.2.6 Function modules and Forms . . . . . . . . . . . 26
4.2.7 SAP List Viewer . . . . . . . . . . . . . . . . . . . 26
4.2.8 ABAP Includes . . . . . . . . . . . . . . . . . . . 27
4.3 Development environment . . . . . . . . . . . . . . . . . . 27
4.3.1 Ticketing tool – HP Service Manager . . . . . . . 27
4.3.2 Systems . . . . . . . . . . . . . . . . . . . . . . . 28
4.4 Implementation . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4.1 Errors . . . . . . . . . . . . . . . . . . . . . . . . 30
4.4.2 Testing . . . . . . . . . . . . . . . . . . . . . . . . 31
4.4.3 Performance tuning . . . . . . . . . . . . . . . . 31
4.5 End user evaluation and savings . . . . . . . . . . . . . . . 32
5 Print from Mobile Device . . . . . . . . . . . . . . . . . . . . 34
5.1 HANA Cloud Platform Cockpit . . . . . . . . . . . . . . . 34
5.2 WEB IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2.1 WEB IDE vs Cloud9 . . . . . . . . . . . . . . . . 35
5.2.2 Fiori . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.3 Integrated application . . . . . . . . . . . . . . . . . . . . . 36
5.3.1 Print functionality . . . . . . . . . . . . . . . . . 37
5.4 Development . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.5 Implementing Cordova Print Plugin . . . . . . . . . . . . . 38
5.6 Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.6.1 SAP Companion application . . . . . . . . . . . 38
5.6.2 SAP Hybrid Application Toolkit . . . . . . . . . 39
5.6.3 Fiori mobile service . . . . . . . . . . . . . . . . . 39
5.7 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.8 Testing integrated app . . . . . . . . . . . . . . . . . . . . . 40
6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
A Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

vii
1 Introduction
With the development of industries and the need for managing pro-
cesses and resources, it has become very important to have a tool that
can help to coordinate them. Enterprise Resource Planning (ERP) sys-
tems integrate all data and processes of an organization into a unified
system. This thesis focuses on SAP ERP system and one of the core pro-
cesses of each manufacturing organization: materials ordering process
and creation of documents between the company and the customer.
The goal of the thesis is to describe, optimize and automate order pro-
cess with cooperation with ABB, and then develop mobile application
that can print one of its documents via YSoft SafeQ.
The automation covers orders in SAP of ABB Discrete automa-
tion and Motion division. The orders are placed by the customers in
the portal. The processing of the orders then starts in SAP ERP. This
process is called OMS – Order Management System.
The print integration is delivered via Fiori mobile application.
This application can be deployed to Android or iOS. The targeted
operating system in this thesis is Android. The mobile application
retrieves data from SAP demo system ES4 service and then prints
the document via YSoft SafeQ.
The thesis contains six chapters. The first chapter is the introduc-
tion of this work. The second chapter describes common attributes of
ERP systems and introduces SAP system more deeply. It deals with
versions of SAP system, its market share and products delivered by
SAP. Two SAP modules that the optimization is about are described
in more detail: Material Management, Sales and Distribution.
The process that is to be automated is depicted in the third chapter.
The manual process is introduced and the automatization is proposed.
The IDoc message document is also described as the main communi-
cation element. All the documents created as the order is processed
are presented at the end of this chapter.
In the fourth chapter, the technologies and development of autom-
atization are described. The end user delivery and the tools that can
be used to deliver the functionality are discussed, as well as the tech-
nologies, development environment and implementation.
The fifth chapter contains the development and integration of

1
1. Introduction

the mobile application. The application is developed in the HANA


Cloud Platform, uses Cordova Printer plugin and can print docu-
ments via YSoft SafeQ. The development, deployment and testing of
the integrated application is specified.
The conclusion of the thesis and further improvements are covered
in the sixth chapter.

2
2 ERP SAP system
This chapter introduces the ERP systems: what they are and why
companies drive their core businesses with them. The targeted system
of this master thesis is SAP ERP. Its history, market share, products
and core modules, regarding this thesis, will be explained in more
depth.

2.1 ERP Systems

An ERP system is made up of enterprise resource planning applica-


tions that share a database and communicate with each other and.
This means it can eliminate information data between departments
and give everyone a single source of information. The system can auto-
mate core business processes and help reduce risk, ensure regulatory
compliance and fast reporting. [23]
The ERP systems were to be replaced by Internet applications and
separated systems that can communicate together. But over the time,
organizations were forced to control the IT budget and also the prob-
lems, as IT complexity, transparency and cost of ownership have be-
come crucial. Thus the organizations have started to focus on modern
ERP systems and target the creation of the added value together with
lowering the cost of IT. [30]
The ground foundation of ERP systems is one common database
which provides the possibility to incorporate all the processes essential
for the given company. These processes are generally in the areas such
as finances, controlling, production planning, logistics, sales, material
management and human resources. [26]
Common and integrated database can be used by different SAP
modules. For example, there is an employee with data in HR module
working as the production supervisor. Data about him are accessible
for the production planning module as well as for the human resources
module at the same time, without duplicating it. Thanks to the deep
integration of applications it is possible to use only one database
without any other interfaces and the data are inserted into the system
only once.

3
2. ERP SAP system

2.2 SAP
2.2.1 Brief history

SAP company was founded in 1972 by five former employees of IBM


in Germany. The meaning of SAP is an abbreviation for Software,
Anweldungen und Produkte. This translates to English as Software,
Applications and Products. The founders wanted to develop a prod-
uct that could cover all processes and manage whole economics of
an organisation.
The first standard software for financial accounting was released
in 1972. This product was the foundation of SAP R/1 system, still
not fully featured ERP system. The letter R refers to the real-time
processing.
SAP R/2 was released in 1979 and was the first real ERP system.
The breakthrough was SAP R/3 in 1992 which was based on client-
server architecture. It used relational databases and could be run on
any hardware and software. SAP R/3 lead SAP to the first position on
market of standard software for management of business economics.
[13]
Since 2004 the new components with central business suite called
mySAP ERP are delivered.

2.2.2 SAP S/4 HANA

SAP is focusing on the cloud technologies and in-memory computing


SAP S/4 (HANA). The newest products are aiming for the real-time
delivery of data using HANA databases. HANA stands for high per-
formance analytic appliance and is designed to process structured
data from the relational databases, both SAP and non-SAP applica-
tions. HANA can run in parallel with SAP ERP applications. Analysts
can access the real-time operational and transactional data. They do
not have to wait for a run of daily or weekly reports. SAP HANA can
be deployed on-site as an appliance, or purchased as a managed cloud
service.
SAP HANA Cloud Platform (HCP) is a cloud platform based on
open standards. It provides access to a feature rich, easy to use devel-
opment environment in the cloud. The platform includes a compre-

4
2. ERP SAP system

hensive set of the services for integration, enterprise mobility, collabo-


ration and analytics.
SAP HANA Cloud Platform enables the customers and partners to
rapidly build, deploy and manage cloud based enterprise applications
that complement and extend SAP or non-SAP solutions, either on-
premise [21], or on-demand.
As a Platform as a Service operated by SAP, HCP frees from any
infrastructure and IT costs and offers advanced quality of service –
availability, scalability, multitenancy.
These are the programming models that could be used to build
highly scalable applications:

• Java – SAP HANA Cloud Platform is Java EE 6 Web Profile


certified. Development of Java applications for any application
server is possible. The existing Java applications can be also run
on the platform.

• HTML5 – lightweight HTML5 applications can be easily devel-


oped and run in a cloud environment.

• SAPUI5 – use the UI Development Toolkit for HTML5 (SAPUI5)


for developing rich user interfaces for modern Web business
applications.

The applications developed on SAP HANA Cloud Platform run


in a modular and lightweight run time container. The platform pro-
vides a secure, scalable run time environment with reusable platform
services.
The preferred technologies to develop and deploy applications are:
WEB IDE, SAPUI5, HANA Cloud Platform.

2.2.3 ERP Market


The ERP Market shows continual growth. In case of big organizations
that have more than 1000 employees in Germany, SAP has market
share about 55% and worldwide about 27%. It is the leading ERP
System. [5]

5
2. ERP SAP system

2.2.4 SAP Products


SAP products are complex solutions to all internal divisions of organi-
zation. However, SAP can also accommodate some process that are
outside of the organization, and thus overlaps common ERP solutions.
Products can be divided into three categories:

• Technological components, like SAP Enterprise portal, SAP Mas-


ter data management or SAP Exchange infrastructure. These
components altogether are identified as SAP NetWeaver.
• Products that relate to the management of the organization.
There are xApps, the applications that overlap segments of in-
dividual components. Then mySAP Business Suite, the applica-
tions that maintain core organizational management. The last
part of the second category are SAP Smart Business Solutions –
these are aimed for small and middle organizations. They con-
tain SAP Business One and SAP All in-One-products.
• Specialized solutions for concrete businesses like SAP for Auto-
motive or SAP for Aerospace.

2.3 mySAP Business Suite


The main element of SAP products is mySAP Business Suite. It is
composed of various components that will be explained. Customers
can order whole mySAP Business ERP or just the parts suitable for
their business. [10]
Components:

• mySAP CRM – it extends the standard ERP functions and pro-


cesses that relate to the customers. It is an abbreviation for Cus-
tomer Relationship Management.
• mySAP SRM – it extends the processes associated with the sup-
pliers, such as e-commerce. It stands for Supplier Relationship
Management.
• mySAP PLM – it refers to the functions about lifecycle of man-
ufactured products, like the administration of the production

6
2. ERP SAP system

programs or the management of the documentation. It means


Product Lifecycle Management.

• mySAP ERP – it contains all the ERP functions in the given


modules: Finances, Human Resources, Production Planning,
Project Systems, Material Management, Quality Management,
Controlling, Basis and Sales, and Distribution.

The aim of this thesis is mySAP ERP, specifically the processes


of the Sales and Distribution module and the Material Management
module.

2.4 SD and MM module


The process that is to be automated overlaps from the SD module
to the MM module and back. In order to understand these modules
better, they need to be briefly described.

2.4.1 Sales and Distribution module


This module encapsulates applications for handling all the activities
connected to expedition, processing of orders, delivery and invoicing.
For better understanding, here is the description of how the typical
workflow of this module may look like. The customer sends sales order.
Based on this, the purchase order is generated. The purchase order
contains the date of delivery, the required materials and the prices.
All the materials will be collected and ready for delivery. After the ma-
terials are accounted, the delivery list is generated. The whole process
ends when the customer pays for the order. In the beginning of the pro-
cess, there can be an exchange of two additional documents: customer
inquiry and company quotation. [3]

2.4.2 Material Management module


To accomplish different business processes, different materials are
required. SAP MM module deals with a material flow from the point
where material accesses the organization until the point it is trans-
formed into the final product and its aspects (like planning or control-

7
2. ERP SAP system

ling). Therefore it is a backbone module for SAP Logistics and other


modules are dependent on it. [14]
Its core is procurement of materials. It should be done with correct
quantity, appropriate value and useful timing. Procurement is impor-
tant because the organizations try to get stock supplies to minimum
but at the same time to avoid a situation when they cannot produce
due to the insufficient inventories. Basic procurement is done through
purchase requisition, purchase order, receipt goods issue and invoice.

8
3 Process to be automated
The customers order products through the system outside of SAP
called OMS (Order Management System). Two possible situations
can occur: the material either is in stock, or it needs to be ordered
from another vendor. OMS is a unified portal that can be reached by
the customers and the vendors. The data is propagated to the SAP
system. Propagation of data is done via IDocs messages.
When the customer orders a product, IDoc is sent to SAP. The sales
order (SO) is created from this message. In the instance of SAP, the
sales order automatically creates the purchase requisition. Then the
purchase order (PO) is created for the vendor from this purchase
requisition. When the vendor approves the date of the delivery, the in-
formation is sent to the customer via the inbound delivery (IBD).
The order is virtually in the stock, but in reality the goods are sent
directly from the vendor to the customer. Based on the IBD, the post
goods receipt (PGR) accounting for the given IBD is created. After-
wards the outbound delivery (OBD) is created and its accounting post
goods issue (PGI). The next steps are the delivery from the warehouse
and shipment. The final step is the submission of invoice (INV) and
its accounting, release billing document (RBD).

3.1 Former manual processing


Every document of the described process had to be created in SAP
system. To be properly classified, additional information needed to
be found. This involves human factor, because information is found
and entered by people. Information needed to process the documents
are repeatedly taken from the same tables, and therefore the process
could be automated.
Each step of this process requires to open a different transaction in
SAP. Transaction is an access point to the functions and the programs
in SAP. By automation both the time required to open the transac-
tion, as well as human error can be eliminated. The total of eight (8)
transactions could be replaced by one program or web application.

9
3. Process to be automated
Figure 3.1: Order processing in SAP
10
3. Process to be automated
Figure 3.2: Order processing in SAP
11
3. Process to be automated

3.2 Automatization
To automate this process there are two main parts that have to be
undertaken. Firstly, an analysis of the possible unpredictable steps that
could cause the automation error needs to be put together. Secondly,
the research of the different tools has to be done, specifically if these
tools should reach the same output without the standard transactions.
The manual process consists of eight transactions that create or
bill documents into SAP system. The first document is the sales or-
der created automatically from IDoc and needs no additional data.
The purchase requisition is created by a background job from the sales
order. The purchase order can be created by BAPI call. The creation of
the inbound delivery is processed by calling a transaction with pre-
filled data. Every other document can be created by calling respective
BAPIs.
The conclusion here is that the used transactions could be utilized
into one program where all the functionality is collected. To do so,
a new program has to be developed. The program should select all
the respective IDocs and show them in the view for further processing.
The processing will concern creating the purchase order, the inbound
delivery, the post goods receipt, the outbound delivery, the post goods
issue, the invoice, and the release billing document.
This should not be done in the background batch mode, because
the operating personnel should interact with the transaction on live
basis, i.e. after each document is processed, they could process another
document or different IDoc without leaving the program.

3.3 IDoc
IDoc stands for the intermediate document and is used to transfer data
in the form of electronic message between SAP systems or between
SAP system and external system. Every IDoc has a unique ID within
the system. IDoc fulfills ANSI ASC X12 as well as EDIFACT stan-
dards [11]. In this process it provides sending the messages from OMS
to SAP and back. It transfers data regarding the sales order, the in-
bound delivery, the outbound delivery and the invoice, so it is used
throughout the whole process.

12
3. Process to be automated

Depending on where IDoc is produced, it is called outbound or


inbound. Outbound IDoc is generated in SAP system and sent to
an EDI (Electronic Document Interchange). System and inbound IDoc
is generated in an EDI system and sent to SAP system. EDI system acts
like a converter processing IDoc into XML or vice versa and sending
it to the corresponding system.
For the needs of this thesis, the IDoc terminology needs to be in-
troduced. This involves IDoc Type, IDoc Extension, IDoc Segments,
Parent and child segments, Partner, Partner Type, Message Type, Pro-
cess Code and Port. Only the parts important for development are to
be described here.
IDoc Type is based on the EDI and EDIFACT standards. The struc-
ture of IDoc is described by IDoc type. Every type characterizes the pur-
pose of the segments and the number of the segments, the data fields,
the fields for transmission and the definition of the mandatory and
optional segments. [11]
IDoc Segment is the container of message data exchanged between
systems. Each segment has its own name.
Message Type is linked to the IDoc Type and identifies the docu-
ment in SAP: Order, Shipment, Goods Receipt, Invoice, Notification.
• Control Record – carries information like IDoc number, direc-
tion, Type, Message Type, IDoc Status, Partner, time stamp of
creation/update.
• Data Records – information and details about the IDoc segments
are stored here. In the segments, there are fields crucial for post-
ing the documents.
• Status Records – determines the status of processing of each
IDoc. Statuses are used to record IDoc and its different states.
Statuses are represented by numbers. In control record there is
current status of IDoc.

3.4 Documents of process


Different documents of the process are to be described here. These
documents are generated as the order is processed in SAP system. All
documents with respective IDocs are described by figure 3.3.

13
3. Process to be automated
Figure 3.3: OMS Business process
14
3. Process to be automated

3.4.1 Sales order


The contracts for supplying goods or services among customers and
organizations are called sales orders. These are agreed for given quan-
tity, time and date. The sales order can be created either manually by
sales employee, or automatically by a message via IDoc from the ex-
ternal system. The second case is being dealt with in this thesis. After
the sales order is created, the customer may receive confirmation (if
this is specified in the sales order header data).

3.4.2 Purchase requisition


The purchase requisition (abbreviated as PREQ) is an information
message or a demand to notify the purchasing that a particular quan-
tity of a material should be procured in order to be available at a given
time. It is performed before the purchasing process. [2]
It can be created manually or automatically by the system. The
purchase requisition can be transformed into the purchase order [14].
The structure of the purchase requisition consists of several items
and there is a defined procurement process for each one of them.
There are the following types of the procurement processes: Standard,
Subcontracting, Consignment, Stock transfer, External service.
The purchase requisition item consists of the date and the quantity
of the material to be supplied.
If the items are going to be supplied by subcontractors, there is
a possibility to specify mandatory materials that have to be transferred
to the subcontractor.
The purchase requisition is an internal document, so it is not used
outside the organization. In this thesis’ case, the purchase requisitions
are created automatically from the sales orders. The purchase orders
are then created from them to the third-party vendors.

3.4.3 Purchase order


A purchase order (PO) is a formal request from a purchasing organi-
zation to a vendor to supply or provide a certain quantity of goods or
services at a given point in time.
A purchase order consists of a document header and a number of
items. Information shown in the header relates to the entire PO. For

15
3. Process to be automated

example, the terms of payment and the delivery terms are defined in
the header. The procurement type is defined for each of the document
items that is defined in the purchase requisition.
Delivery of the total quantity of material specified in a PO item
can be spread over a certain period, consisting of lines indicating
the individual quantities with their corresponding planned delivery
dates. For PO items to be supplied by the subcontractors, the necessary
input materials can be specified or components that are to be provided
to the subcontractor for assembly or processing in respect of each
delivery date provided.
The conditions can be applied at various levels: for the entire pur-
chase order, at the item level, or for the supplied material.
The costs can be divided among various Controlling objects via
the account assignment. Vendors can issue the confirmations to the rel-
evant purchasing organization, indicating their compliance or non-
compliance with the scheduled delivery dates.
In the purchase order, each item is destined for a certain plant.
Each plant belongs to a company code, to which the vendor’s invoice
is directed. [17]

3.4.4 Inbound delivery


The inbound delivery process starts when purchase order is processed
at the vendor and an advanced shipping notification is sent back.
When the notification is received, itcan trigger an inbound delivery
to be created in SAP. The delivery contains information on the vendor,
the items, the quantities to be expected and the delivery details.
The delivery monitor is used to display and process open and
completed deliveries. It is a single list that is easily reviewed. It shows
the deliveries that are due for picking or put away and the creation
of transfer orders, deliveries for which picked quantities or put away
stocks need to be confirmed, and process deliveries that are due for
goods receipt.

3.4.5 Post goods receipt


Post goods receipts are used to record the items received from the ven-
dor. They have been sent using the information from the purchase

16
3. Process to be automated

order. The goods receipt is important, as it moves the items into stock,
updating the stock levels and allowing the items to be used in the pro-
duction process. If an item is received in the stock, the value of the item
is posted to the company accounts. The goods receipt process can be
triggered from the inbound delivery document already in the system,
or from the manually created good receipt document, if no inbound
delivery exists. In the case of this thesis, it is created from the inbound
delivery.

3.4.6 Outbound delivery


The outbound delivery document is generated to facilitate the picking
and packing of the items as they are delivered to the customer.
The picking process involves moving items from the storage into
the warehouse and staging the quantity in the picking area. The items
are to be packed and then shipped to the customer. The picking of
items can be an automated part of the outbound delivery process or
it can be performed manually. When the warehouse staff completes
picking and takes it to the staging area, they can update the out-
bound delivery document to show that the picking has been com-
pleted. The shipment can be sent to the customer using a logistics
company. As soon as the items leave the facility, the shipping process
is complete and the goods issue can be posted.

3.4.7 Post goods issue


The post goods issue process triggers a number of events in the SAP
system. Initially, the inventory stock is reduced by the shipped quantity,
and the financial details are posted to the balance sheet accounts.

3.4.8 Invoice
A document that states the invoice recipient’s obligations to the vendor
[16]. An invoice is normally created after the goods issue. It includes
general invoice information, such as total amount, total tax, freight
costs, vendor and invoice recipient, and detailed information (header
information, item information, and approval preview).

17
3. Process to be automated

3.4.9 Release billing document


SAP allows various settings: the SD invoice can be transferred to the fi-
nancial accounts and billed at the same time, the SD invoice can be
created first and in the next step it is released to the financial accounts.
Release billing document is the last step in the process of invoicing,
when based on the information from previous documents the account-
ing document is created. This document is then posted to financial
accounting. It contains reconciliation account, revenue account or tax
account.

3.5 Application requirements


The program that is to be developed will display IDocs with their
respective orders. Every IDoc has data with sales order and its items.
Decomposition will occur on items, so for every IDoc there will be
multiple lines depending on the number of sales order items. The ap-
plication will have buttons to create documents and its billings. In
addition to these buttons, it will be possible to process the whole order
by one button – automatic process. Automatic process will create ev-
ery document from the inbound delivery or status 4 to release billing
document or status 10. The application will cover about 80% of all
orders from the OMS system. The other orders will have to be handled
manually as before, because of their non-standard structure.
Application requirements:

• Every IDoc will have status with information about which docu-
ments were created.

• User can sort the entire table of IDocs by every field.

• Header data for each of the documents.

• User can access details of each header document by clicking


the header data or any other convenient way.

• There will be two manual steps – approval of the purchase order


and creation of the inbound delivery.

18
4 Development
This chapter discusses the development stage of the program that will
cover the automated process. All the documents will be processed,
created or accessed from this program. Firstly, different approaches of
delivering the requested functionality will be introduced. After the de-
cision on delivery, the technologies that will be used to implement the
program are to be presented.

4.1 End user delivery


In order to properly implement the program there are several concepts
of delivering the functionality that are to be explored and explained.
The most suitable means for the end user will be implemented based
on the findings.

4.1.1 ABAP programs


ABAP programs are the typical means of delivery in the SAP systems.
They are accessed via transactions that wrap the programs. The trans-
action is then assigned to the role in the system and can be accessed
by the user. The user has to have proper access rights.
The advantages of ABAP programs are that users are used to them
and know how to use them. Most SAP developers and consultants
are familiar with ABAP language and other SAP functionality can be
reached from them.
The main disadvantage is that the user has to be logged into SAP
client to reach the system. The user has to know the transaction he
wants to access and cannot pick from a pool of options. The UI is also
fairly outdated.

4.1.2 Web Dynpro


Web Dynpro for ABAP is SAP’s basic way to implement the web
applications. The development tools are integrated into the ABAP
Workbench, transaction SE80. It provides a graphical interface to de-
velop the layout of the application which can be divided into several

19
4. Development

views. There is a master controller 0 COMPONENTCONTROLLER0


and each view has its methods to deliver the logic to the views. Any
number of views can be created in a component and assembled in
any number of the corresponding Web Dynpro windows. At least one
window is present in each Web Dynpro component. Window embeds
all the views that are displayed within the front-end web application.
Advantages of Web Dynpro are web access to data and no need to
sign into the SAP client, reusability of some components, automatic
data binding, and mainly the fact that the code is written in ABAP.
Web Dynpro can be used for the enterprise portal provided by SAP to
extend its functionality. The disadvantages are that it cannot interact
with other parts of SAP environment.The performance of Web Dynpro
is also slower than that of Fiori or the conventional ABAP program.

4.1.3 Fiori
Fiori is the newest concept of delivering and processing SAP data. It
is designed to replace Web Dynpro, however Web Dynpro was still
listed here because of its wide usage. Fiori is suitable for desktop as
well as for mobile devices.
Fiori is build on JavaScript framework SAPUI5 using HTML5.
The data for the applications are delivered by SAP services through
OData protocol. There are several advantages: building the applica-
tion from templates, mobile usage, OData protocol or nicer UI. Main
disadvantage is no interaction with other SAP transactions and a new
way of development for SAP consultants and developers.

4.1.4 Choice of delivery


It is important to select the right form of delivering the functionality,
because it could improve the user experience and maintenance of
the developed programs.
Fiori could be seen as the first choice because of its modern UI,
the ability to work on both desktop and mobile devices, and no need
to sign into SAP system. It is also a successor of Web Dynpro, but with
HTML and JavaScript code.

20
4. Development

The end users are signed into SAP system anyway because of
other aspects of their work. They also want to interact with other SAP
transactions.
The choice of the development is the ABAP program for several
reasons:

• Offers fastest way to select the required data.

• Can interact with other transactions (they can be launched by


link).

• Known UI for the end users.

• Easy maintenance for developers and consultants.

4.2 Technologies used


Since the ABAP program has been chosen for the implementation
of the functionality, the technologies used during the development
need to be described. The program should have three main parts:
input screen, logic, output screen with the functionality for creating
the documents.

4.2.1 Programming language


The language used for program implementation is ABAP, that stands
for Advanced Business Application Programming [20]. It is a native
programming language in SAP environment. SAP is using its latest
version, ABAP Objects, which is object-oriented. Compatibility with
its previous versions (e.g. ABAP/3) is guaranteed.
SAP uses a 3-tier architecture model – presentation layer, applica-
tion server and databases. ABAP programs run on the second level,
application server. Every layer could be run on a different computer
and the communication takes place between each layer. The applica-
tion server is normally kept on different server, mainly for performance
and security purposes.
The run-time system can be considered a virtual machine, similar to
Java virtual machine. A key component of the ABAP run-time system is
the database interface that translates database independent statements,

21
4. Development

Open SQL, into the statements understood by the underlying database,


Native SQL. SAP can work with a wide variety of databases and
the same ABAP program can run on all of those. [29]

4.2.2 Selection screen


The input screen of the transaction is called selection screen in SAP
terminology. This is the place of the initial interaction with the user
when the user inputs the first conditions for data to be selected and
then displayed in output.
The selection screen is only partially customizable. SAP provides
standard components that are used for it. There are many ways to
implement the selection screen. The most used components with its
proper SAP naming are as follows [24]:

• Input interval – SELECT-OPTIONS

• Input value – PARAMETERS (also for checkbox)

• Radio buttons – RADIOBUTTON GROUPS

• Block of components – BLOCKS

4.2.3 Data retrieval


After the selection screen is filled with the input data, they are passed
to the selection logic. The selection logic fetches the required data
for the output. There are several types of selects that can be used
to retrieve the data. The way of writing the selection procedures is
important because of the performance, the readability and the main-
tainability of the code. SAP provides more concepts of writing selects
and it is up to developer to choose the best concept to achieve his goal.
The most commonly used select types in ABAP will be introduced
[25]. The description is followed by an example of the given selection
procedure.
Select all fields of a SAP database table into temporal table. This
select reaches onetime into the database and fetches all the data from
the database table into the temporal table. The data are now in memory
and can be accessed a lot faster. The internal table 0 lt_edids0 must have

22
4. Development

the same structure as the edids table. ‘lt’ or ‘it’ stands for local or
internal table and it is a convention for better readability of the code.

1 SELECT *
2 FROM edids
3 INTO TABLE lt_edids.

Every row will be moved to the internal table but only selected
columns of that row. The internal table 0 lt_bseg0 has to have the struc-
ture of the selected fields in order. This select also reaches only once
into the database.
1 SELECT bukrs belnr gjahr shkzg kokrs
2 FROM bseg
3 INTO TABLE lt_bseg.

Select directly into an internal table where fields are in a different


order or not all fields are specified. The internal table 0 lt_bseg0 does
not have to have the selected fields in its structure and they do not
have to be in order. If the field is found in the internal table, it is filled.

1 SELECT bukrs belnr gjahr buzei


2 FROM bseg
3 INTO CORRESPONDING FIELDS OF TABLE lt_bseg.

Select...endselect command. This type of select will iterate over


the whole database table and reaches into database the number of
times the size of database table or the number of times the condition
is fulfilled (not specified here). This is the slowest kind of select, but it
can be useful if the programmer wants to do some processing after
the selection of each row. However, the same functionality can be
achieved by selecting into internal table and then looping it. It is much
faster to loop the table in memory.

1 SELECT bukrs belnr gjahr buzei


2 FROM bseg
3 INTO ls_bseg.
4 APPEND ls_bseg TO lt_bseg.
5

23
4. Development

6 *custom code*
7 ENDSELECT.

Select FOR ALL ENTRIES command. This select retrieves only


the data that match entries within a particular internal table, that is
filled before. Before using FOR ALL ENTRIES, a check has to be done
if the first table is not initial. Otherwise it would select all the data
because the condition would be invalid. Variable 0 sy-subrc0 is a system
variable that contains the information about the fallback of the pre-
vious command. The successful execution is indicated by 0, so after
the first select, the second can be executed as well.

1 SELECT bukrs belnr gjahr


2 FROM bkpf
3 INTO TABLE lt_bkpf.
4

5 IF sy-subrc = 0.
6 SELECT bukrs belnr gjahr
7 FROM bseg
8 INTO TABLE lt_bseg
9 FOR ALL ENTRIES IN lt_bkpf
10 WHERE bukrs = lt_bkpf-bukrs.
11 ENDIF.

4.2.4 Temporal Tables


In SAP terminology, the temporal table is called an internal table. Iet
contains the records of an ABAP program which is being executed.
An internal table exists only during the run-time of a SAP program.
They are used to process large volumes of data by using ABAP lan-
guage.
In an internal table, all the records have the same structure and key.
The individual records of an internal table are accessed with an index
or a key. Internal tables can be used as temporary storage areas or
temporary buffers, where data can be modified as required. These
tables occupy memory only at run-time and not at the time of their
declaration.

24
4. Development

The size of an internal table or the number of lines it contains is


not fixed. The size of an internal table changes according to the re-
quirements of the program associated with the internal table. But it is
recommended to keep internal tables as small as possible. This is to
avoid the system running slowly, as it struggles to process enormous
amounts of data.
Internal tables are used for many purposes. They can be used to
hold the results of calculations that could be used later in the program.
An internal table can also hold records and data so that these can be
accessed quickly rather than having to access it from database tables.
They are hugely versatile and can be defined using any number of
other defined structures. [28]

4.2.5 BAPI and BADI


The key to defining BAPI is the understanding of the SAP Business ob-
ject. These objects represent real objects like the sales order or the pur-
chase order in business application systems, such as the SAP Systems.
The methods of these objects can be referred to as BAPI or Business
Application Programming Interface.
A method is an activity that can be performed on a business object
and that provides access to the object data. Method is defined by
a name, set of parameters and exceptions. It is a standard SAP interface
that is used for integration and exchange of the business data between
SAP components, or between SAP system and non-SAP system [15].
BAPIs are used when there is an action to be performed on SAP
business object, e.g. approval of the sales order. This is a standard way
of performing methods on standard business objects. SAP assures that
BAPIs follow the ACID rules [19]. BAPIs are RFC-enabled by default,
so they can be called from another component or another system.
BADI is an abbreviation for Business Add Ins. BADIs are enhance-
ments that can be applied to the standard SAP program as per the busi-
ness requirement. They are the newer version of the user exits which
uses ABAP OOP concept. With BADI, the user can change the stan-
dard behavior of ABAP programs implemented by SAP to accom-
modate the user requirements, that are too specific to be included in
the standard delivery. There are explicit places where BADIs can be
implemented.

25
4. Development

4.2.6 Function modules and Forms


Function modules are standalone procedures that can be called from
any ABAP program. Function modules that logically belong together
are encapsulated into function groups. Every function module has to
belong to a function group. Function modules are provided by SAP,
or the users can define and develop their own function modules in
transactions SE37 or SE80. They can be RFC-enabled and then called
with parameter 0 DESTI N ATION 0 with RFC connection.
Function modules have several parameters: TABLES, I MPORT-
I NG, EXPORTI NG, EXCEPTIONS. I MPORTI NG stands for pa-
rameters that are to be used inside the function module. Some of
them may be obligatory. EXPORTI NG are parameters returned by
the function module. TABLES identifies the tables that can be both
input and output parameters. The function module can change them
or just use them. EXCEPTIONS are propagated if there is an error
during the processing of the given function module.
Forms are procedures within a program. They can be called with
specific functionality. Forms are also accessible throughout the func-
tion group, so they can be called from one function module to an-
other. Form is defined by key words FORM and ENDFORM. To pass
parameters, we can use key words USI NG, CH ANGI NG, TABLES.
TABLES passes whole tables, the other parameters pass variables or
structures.

4.2.7 SAP List Viewer


The SAP List Viewer (ALV) is an integrated element of the ABAP
programming environment. It allows the application developers to
quickly implement the display of structured datasets by providing
three different ALV tools, one each for the display of:

• Simple and two-dimensional tables


• Hierarchical-sequential lists
• Tree structures

The SAP List Viewer provides the application developers with:


A unified API for all ALV tools wherever possible. A coherent API,

26
4. Development

earliest possible error detection during programming (e.g. the excep-


tions indicate, when the methods are not possible in specific situations).
Functions for accessibility are integrated into ALV, they do not have to
be programmed. With the ALV, a uniform programming techniques
can be used in order to display various lists, tables or tree structures.
[18]
For this given program, a simple two-dimensional table will be
used. It contains any number of rows, each has the same structure and
no hierarchical relationships to one another. The structure is defined
by the columns.

4.2.8 ABAP Includes

ABAP Includes are separate ABAP programs that can be used to modu-
larize the source code. Their usage allow to use the same source code in
different programs. Includes also allow to manage complex programs
in order to make them more readable and separate the functionality.

4.3 Development environment

4.3.1 Ticketing tool – HP Service Manager

To describe and analyze the lifecycle of the development, test, eval-


uation and deployment process there will be used ticketing tool HP
Service Manager (HPSM). This tool is used to communicate all the re-
quired steps among developers, consultants and the requester.
When the requester wants to add some new functionality, he has to
create ServiceDesk with its ID and proper description of what will be
changed and developed. ServiceDesk includes Change and it includes
Tasks. The process is driven by completing the tasks. When the change
is successfully implemented and tested, ServiceDesk will be closed.
There are several types of tasks and every task may have different
purpose and assignee. Tasks like the implementation are going for
test approval and could be declined. In that case the developer will
react to the comments and fix the code.

27
4. Development

4.3.2 Systems
To ensure the safety of the development and customizing ABB uses
for delivery three mutually exclusive systems: Development, Test and
Production. The transaction will be developed in Development system
where only developers can make changes. It is the only ’open’ system
in which new programs can be edited and created. Every change that
is done is tracked onto transport that is an element recording what
is changed. After the development, transport is imported into the
Test system with all its changed content. Customizing could be done
without transports if it is set to production only.

4.4 Implementation
The transaction will be implemented as ABAP program, so there will
be three vital parts: Selection screen, Selection logic and Output. In
order to make the implementation clearer, in terms of readability and
division of logical parts, the main program will execute the selec-
tion queries into the database. The rest of the functionality will be
implemented as includes into the main program. The includes will
implement selection screen, ALV functions and data definitions.
The name of the program will be ZSD_DM_ORDER_H ANDL-
I NG. The naming convention for non-standard developed programs is
that they start with the letter ’Z’, SD stands for Sales and Distribution
module. The rest of the name is abbreviation of Discrete automation
and Motion division. The includes will have the same name space
with a corresponding suffix:

• ZSD_DM_ORDER_HANDLING_DATA

• ZSD_DM_ORDER_HANDLING_ALV

• ZSD_DM_ORDER_HANDLING_SEL_SCR

The main program that selects required data is written as a struc-


tural program in order to keep the readability. The queries are sepa-
rated into two forms. The first one selects the data that is required only
for initialization. The second one selects the data that could be changed
throughout the program’s runtime. Queries are encapsulated into

28
4. Development

forms, because the second one is repeatedly called from ZSD_DM_-


ORDER_H ANDLI NG_ALV include. The include has the functional-
ity to process data and create documents. After each press of a button,
the data has to be refreshed by calling the second form of the main
program. For implementing Selection queries, the temporal tables
and FOR ALL ENTRIES selects were vastly used to increase the per-
formance of the program. The temporary tables were then read by
READ TABLE command with conditions. That way it was possible
to separate fetching and reading data.
The include ZSD_DM_ORDER_H ANDLI NG_ALV is written in
ABAP OO. ALV is an instance of the CL_SALV_TABLE class. To dis-
play data in ALV Factory, method of this class is called with main
internal table as input parameter.
To define the function keys and buttons in displayed ALV, there
must be set STATUSGU I. It serves as the array of integrated functions
and user-defined buttons above the ALV. The keys are then bounded
to the function modules to perform processing. See figure 4.1 for crop
of Status GUI.

Figure 4.1: Status GUI

Several user events have been defined. On user command – this


event is fired when user clicks a button from the Status GU I. Every
button has an implementation f orm which is executed. On link click –
this event is fired when a field is defined as a hotspot. It is implemented
as the place of interaction with other transactions in SAP system.
According to given column and row, another transaction is executed
with pre-filled data. On double click event is prepared, but for now
there is no functionality. It is prepared because of the discussions with
business consultants for future use and ease of implementation.

29
4. Development

4.4.1 Errors

During the development, some semantic and syntactic errors were


encountered. Those which are most disingenuous will be listed.

Selection queries
When selecting IDocs that were to be processed, there was a prob-
lem with reading a parameter from one table and then using it in
the second one as primary key. This parameter was STAPA2 from
EDIDS table, which is a table of IDocs. Then using it in VBAK ta-
ble that contains header data for sales orders. During debugging,
the data that were in variables were identical but the selection querie re-
turned nothing. The problem was with the data types because STAPA2
is CH AR50 and VBELN from VBAK is CH AR10 and the syntax
check passed. The trimming of the CH AR50 was not enough and
it did not work, so the function module CONVERSION_EXIT_AL-
PH A_I NPUT had to be used. If input to this function consists only
of numbers, possibly with spaces before and after them, the number
string is inserted right-justified in the display field OUTPUT and all
spaces to the left of the value are filled with zeroes (’0’). Running
the variable through this FM was sufficient to achieve successful se-
lection.

Status GUI
After the program was implemented, there was a problem when
the transaction was run in English language. Czech language was
used for implementation. Only half of the texts were translated. These
were texts in standard SAP header. After an exhaustive search for
the root of the problem, it was found that this error is in connection
with Status GU I and its translation. A copy of the standard Satus GU I
that is provided in program SAPLKKBL status STANDARD has to
be made and then translated.

Creating PGR
Procedure Post Goods Issue assumes that the Inbound Delivery
is completed. The BAPI function module used to perform PGR was
BAPI_GOODSMVT_CREATE. It worked fine after the initial testing
and also in business testing. There was one case in production, where

30
4. Development

is was a requirement to bill only some of the items in IBD. The function
module billed only the required items, but also checked the IBD as
completely billed. This issue was solved when debugging the program.
After another series of tests this BAPI was replaced by function module
WS_DELIVERY_UPDATE_2.

4.4.2 Testing
After implementing each complete blog of functionality, the appli-
cation was tested in the development system. Business consultants
prepared given IDocs, it is possible to replicate them in transaction
WE19. After this initial testing, the changes were transported into
the testing system, where the requesters were testing them. This in-
cluded the ticket management in HPSM. If there were some errors,
notification was sent via rejected testing approval with corresponding
faults and testing data.

4.4.3 Performance tuning


Performance is vital for this transaction, because most users will in-
teract with it for longer periods of time,repeatedly pressing the func-
tion buttons. After the first implementation, the performance was
not sufficient. The performance was tested on the data set consisting
of 10000 entries. Normally the program is used for the current day
and the data set is around 10-50 entries displayed. The testing started
with the initial code implementation that was not revised. To guar-
antee that the tests have the same runtime environment, they were
scheduled as background jobs and the minimum pause among them
was 30 minutes. Every time 5 tests were run and the average time
was stated. This 30 minute pause was introduced because of buffers.
They could increase the performance, if the same selection of data
was being processed multiple times in sequence. The first selection
of data lasted 7248 seconds. After that all single selects from the code
were removed and the test was run again. The second selection lasted
4872 seconds. It was a significant decrease, but the time to process
the testing record was still high. After that the functionality was reim-
plemented using the temporal tables and the tests were run once again.
Now the outcome was 2198 seconds. The removal of Single selects and

31
4. Development

reimplementation with temporal tables was 3.30 times more efficient.


Subsequently, the tests were run again with performance tracker
transaction ST01. The outcome of this transaction pointed out that
one select statement takes around half of the running time. This select
was wrongly placed inside one of the loops. So after the performance
tuning of the transaction the tests ran for 864 seconds. The program
ran 8.38 times faster than the initial implementation.
Results of performance tuning are specified in table 4.1.

Step Time More efficient


Initial implementation 7248 seconds 0.00x
Removed single selects 4872 seconds 1.49x
Implementing temporal tables 2198 seconds 3.30x
ST01 inspection 864 seconds 8.38x

Table 4.1: Performance tuning

4.5 End user evaluation and savings


After the development and the testing, the transaction was transported
into the production system. It covers the process of ordering materials
from the OMS system and creation of the documents that had to be
processed.
Two manual steps remained, approval of the purchase order and
creation of the inbound delivery. The implementation of documents
creation was done using standard BAPI modules. Hotspots,which en-
capsulate the call of other transaction with pre-filled input parameters,
were used for the integration of other SAP transactions.
The application has been running since August 2016 in the pro-
duction system and will be developed further.
To evaluate end user satisfaction, an on-line questionnaire focused
on time reduction of work was created. The questionnaire was avail-
able in Slovak and Czech language as some members of the team do
not speak English. The questionnaires were handed to five people
working with the OMS orders on a daily basis. There are three types of

32
4. Development

orders that they process in relation with this program. From all the or-
ders, about 40% can be automatically processed from the purchase
order to invoice billing. For 40% the program can be used partially to
create some documents and about 20% of orders have to be handled
manually. The results are:

• For the standard orders, where the application can run automatic
process, the time reduction was about 82%.

• For the orders that could create only some documents automati-
cally, the time reduction was 46%.

• For the orders that do not come in the standard form, the time
reduction was 5%, because they have to be processed separately.

The overall time reduction when processing orders was 56%. It


means about half of working time for the personnel to process the same
amount of orders.
Besides the time reduction, the transaction brought also other bene-
fits that were mentioned in questionnaires. The reports for controlling
department are easy to prepare. There is no overlapping in handling
the orders: now the personnel can assign the work they are working
on in the transaction and put a name on it. Before there was a shared
email and sometimes it happened, that two people were processing
the same order. It has also facilitated better and faster feedback when
a customer was calling, as well as more flexibility and live view at
meetings.

33
5 Print from Mobile Device
Print from SAP system was for a long time only available from desk-
tops, because the mobile devices were not able to run applications that
could be integrated with SAP. With SAP Fiori, SAP focuses on the mo-
bile devices first. The development of Fiori applications is brought
to the cloud. SAP created SAP Hana Cloud Platform with its cockpit
to manage and WEB IDE to develop applications. Implementation is
done with JavaScript and SAPUI5, HTML5 framework. Because SAP
focuses on mobile devices, there are tools to develop hybrid applica-
tions using Apache Cordova. With cloud build one application ca be
developed and deployed on multiple platforms.

5.1 HANA Cloud Platform Cockpit


The cockpit is the central point for managing all the activities asso-
ciated with the cloud applications. The web user interface can be
used for deploying, running and managing web applications, and
connecting them with services in the cloud platform. [6]
The cockpit provides an overview of applications available in dif-
ferent technologies supported by SAP HANA Cloud Platform – SAP
HANA XS, Java, and HTML5. It also shows other key information
about the account.
Cockpit provides Destinations menu where back-end services can
be defined. They can be web-based or real ABAP back-end system.
The web-based services require only correct credentials and they can
be consumed. ABAP services require SAP HANA Cloud Connector.
The cloud connector serves as the link between applications in SAP
HANA Cloud Platform and existing on-premise systems. It combines
a setup with a configuration of the systems, that are exposed to SAP
HANA Cloud Platform. [8]
Cockpit also provides Services that can be accessed and used for
creating or extending applications. Services are grouped by service
category. Some of the services are basic services directly provided
by the SAP HANA Cloud Platform and are ready to use. Services
available for use in the relevant account differ for each account. In the
overview of the services available in the account, a label on the service

34
5. Print from Mobile Device

tile indicates if the service is enabled. Our interest is in Mobile services


[9]. We will be using WEB IDE for development and Fiori Mobile
services for building the application in the cloud.

5.2 WEB IDE

SAP WEB IDE is a web tool that empowers users to create and extend
applications for desktop and mobile devices. It simplifies the end to
end application lifecycle: prototyping, development, packaging and
deployment for SAP Fiori applications.
SAP WEB IDE offers tools to build and extend applications ap-
plying SAP Fiori UX and generic SAPUI5 applications using wizards,
templates, sample applications, drag and drop tools and code editor.
SAP WEB IDE is available on SAP HANA Cloud Platform and can
be accessed via SAP Store for productive or trial usage. The exten-
sible and modular plugin architecture enables SAP developers and
customers to add their own plugins. SAP WEB IDE provides a wizard
for creating a new plugin, the ability to re-use existing templates and
newly created templates as well as test the plugin project within SAP
WEB IDE.

5.2.1 WEB IDE vs Cloud9

Cloud9 is a WEB IDE in the cloud-based development environment.


It supports many programming languages, such as C++, Coffeescript,
Go, HTML, XML, Java, JavaScript, PHP, Python and other[4]. It also
supports code completion and build for selected languages.
WEB IDE supports only HTML, XML and JavaScript. But there
is easier handling backend data and SAPUI5 framework. It is also
integrated with HCP account and applications can be deployed and
registered for Fiori launchpad.
Cloud9 is capable of developing SAPUI5 applications, however,
the designated IDE developed directly by SAP is a better option, mainly
because of deploying applications directly to HCP, registering them
for Fiori launchpads, and easy maintenance of the background data.

35
5. Print from Mobile Device

5.2.2 Fiori
Fiori applications are based on HTML5 and JavaScript SAPUI5 frame-
work. SAP provides some standard applications, such as sales order
creation, information lookup, self-services for employees, and the like.
These applications are easy to access from desktops, tablets or phones.
Fiori is an Italian word for flowers and should represent nicer and
elegant UI of SAP applications. Current SAP transactions are complex
and used to perform multiple tasks. As a result the transactions have
many fields and configurations that are difficult to understand and
use. For example, the transaction VA01 that is used to create sales
orders, is used by the functional consultants and also by the sales
representatives. The sales representatives do not need the additional
fields and the transaction is too complex for them, because their prior-
ity is to make deals, not to spend time using the transaction. To avoid
complex UI, SAP has split the functionality into multiple applications
using Fiori design.

5.3 Integrated application


The goal is to develop the prototype of mobile application that works
with the backend data from a SAP system. This application should
display one document type created by the automated process and
provide printing for this document.
Unlike the previous development, the ABAP backend system pro-
vided by SAP will be used, not the one by ABB. This will be a free
demo system called ES4. This system was chosen because of easy test-
ing and no need to install SAP Cloud Connector. In order to switch
back to ABB system, it is only needed to switch OData service with
Cloud Connector and deploy it to ABB Fiori launchpad.

36
5. Print from Mobile Device

5.3.1 Print functionality


Print capability of Fiori is the same as any other JavaScript web appli-
cation. There are three ways to deliver print functionality from Fiori
applications.

• Using window.print() method

• Using iframes

• Using Cordova Print Plugin

The usage of window.print() method and iframes is only possible


on iOS devices that run on iOS 4.2 or later, because it adds AirPrint
support. The aim here is for iOS and Android devices, as the majority
of the mobile market is shared between these two.
Because of this reason the decision was made to implement the ap-
plication with Cordova Print Plugin by Katzer [12]. SAP HCP has
native support for Cordova plugins and allows build applications
locally or in the cloud.

5.4 Development
For the development SAP recommended WEB IDE was chosen. It
provides the templates and sample applications for the application
development. Sales Orders was chosen as the type of document that
will be displayed by the application. For this Master-Detail template
according to Fiori UX Guidelines will be used [22]. The data will
be provided by SAP demo system ES4 defined in the Destination
menu of HCP cockpit. The application will consume OData service
GWSAMPLE_BASIC which includes SalesOrderSet with sales orders.
New project from the template was created and the ES4 system has
been chosen as the data connection. The data binding for the Object
Section was set to SalesOrderSet and the Line Item Section to ToLine-
Items. This configuration builds the initial application that displays
sales orders with items in a detail view. The application successfully
reads the data from ES4 system and is ready for further development.

37
5. Print from Mobile Device

5.5 Implementing Cordova Print Plugin


The print button was added to the footer of the detail view of the
application, where the rest of the action buttons are located as well.
This triggers onPrint event with plugin methods. The plugin and its
methods are not available before the deviceready event has been fired.

1 document.addEventListener('deviceready', function ()
2 {
3 //plugin is now available
4 }, false);

For printing of the document, there is a method print that opens a


print dialog with given HTML code. It consists of sales order number
and its items.

5.6 Deployment
After the application was developed in WEB IDE, it had to be packaged
into mobile apk or ipa files for Android or iOS. In WEB IDE, there
are options to test the app immediately, build it locally or build it
in the cloud. Android was chosen as the targeted platform for this
application.

5.6.1 SAP Companion application


SAP Companion application is available for Android as well as for iOS.
After installation QR code of the application for testing needs to be
scanned. QR code is available when the application is running from
the WEB IDE with frame setup. Once it is scanned, the application
is loaded on the mobile device. When the application is changed in
the cloud, there is no need to repeat the scanning procedure, because
the Companion application will search for the updates every time it
is launched.
It is ideal for the quick testing, but it is unusable for testing of
the Cordova plugins. It just downloads the application’s source code
and runs it without external Cordova plugins. Thus it is not working
for the developed print functionality.

38
5. Print from Mobile Device

5.6.2 SAP Hybrid Application Toolkit


Hybrid Application Toolkit (HAT) deploys the application to a local
machine and builds it there. It is a plugin into the WEB IDE and has
to be enabled in Cockpit. There are preconditions that need to be met
for the build to run. The machine has to have installed the following:
JDK, Android SDK, Apache ANT, NodeJS, Cordova, Kapsel, Git, Plug-
man, SAP hybrid application toolkit. The system variables have to be
configured correctly as well.
The build is started in WEB IDE by choosing Deploy and Hybrid
Application Toolkit. The application can be found on the machine file
system in the user profile and the folder SAPHybrid.

5.6.3 Fiori mobile service


With Fiori mobile service, applications can be built in the cloud. De-
velopers have to enable applications as mobile and activate the Fiori
Mobile service in HCP Cockpit. A signing profile needs to be provided
for each platform to build the applications. The application must be
deployed and registered to Fiori launchpad. After these settings are
done, the build in the cloud can be started. If the build is successful,
the user can download the application from the WEB IDE, Fiori Mo-
bile console or via the hyperlink delivered as an email notifying that
build was successful.
There are several ways to add Cordova plugins to the project. De-
veloper can add them in WEB IDE and in Fiori Mobile console – in
plugin management or application management.

5.7 Problems
During the development, there were problems with both ways of
the deployment: HAT as well as Fiori Mobile. At first the plugin was
not reachable from the application. Therefore a question was sent
to the community forum [1]. The community reacted very promptly
and referred to the blog regarding Cordova plugins. There was an
example of the usage of the plugin, but the site was no longer in use.
A comment was left for the author and he replied within two days.
The community support of the WEB IDE problems solution was really

39
5. Print from Mobile Device

quick by providing means to the solution and the example code.


Another problem appears when the app is being deployed through
Hybrid Application Toolkit. It needs an additional plugin to logon
into backend ES4 system, Cordova Logon plugin. After the addition of
this plugin, there was an issue with the credentials. It was not possible
to log into the application: none of the credentials used (WEB IDE,
HCP and ES4)worked.
Fiori Mobile deployment had problem with cycling of the error
messages. After the deployment to the HCP, the application had to
be registered to the Fiori launchpad. After the registration, WEB IDE
prompted to deploy it once again to the HCP – cycle of warning mes-
sages. In November 2016 there was an WEB IDE update that fixed this
issue and the deployment with build was possible [7]. When the ap-
plication was downloaded, the apk file size was about 60MB. For a
simple application that reads and displays data, it is quite big file size
generated by the cloud build.

5.8 Testing integrated app


When the application was deployed and installed on Android device,
the integration was tested with YSoft SafeQ. As it is shown in figure
5.1, the integration is straightforward. When the device is on the same
network as the printers are installed on, it provides a list of printers to
deliver the print output to.
The testing took place at Y Soft in Brno with two Y Soft represen-
tatives. It was tested that the content can be saved as a pdf file and
printed by YSoft SafeQ server.
Sometimes the plugin struggled to find the printers, but the overall
conclusion was that the plugin is working properly.

40
5. Print from Mobile Device

Figure 5.1: Android Print

41
6 Conclusion
The goals of this thesis were to develop an optimized business process
of ABB order management system and mobile application with Y Soft
cooperation that can print one document of the process.
Optimization of order process was implemented by automatization
of the given process in SAP system using ABAP program. It resulted
in 56% work time reduction for personnel as well as other benefits.
The program is in the production since August 2016 and there were
found no serious errors. The automatized process is now planned
to be implemented for other ABB divisions in Czech Republic with
possible integration in Hungary. In the further stage of development,
the automatization process can be extended for all divisions or other
countries. For controlling department Fiori mobile application that
displays statuses and header data of orders could be implemented.
Mobile application for displaying and printing sales orders was
developed with SAP HANA Cloud Platform, so it can be used by any
company that has SAP system implemented. Cordova print plugin is
working on Android system and iOS deploy is ready. It was tested
with Y Soft representatives and it is possible to print documents via
YSoft SafeQ. Fiori application with Cordova print plugin currently
prints table with sales order and its items. It can be extended with
external CSS for print output layout. Also it is possible to implement
mobile applications for other documents of the order process.

42
Bibliography
[1] SAP Answers. WEB IDE Cordova Print Plugin. https://answers.
sap.com/questions/37377/web-ide-cordova-print-plugin.
html, 2016. [Online].
[2] Matt Chudy and Luis Castedo. Procurement with SAP MM - Prac-
tical Guide, SAP Materials Management. SAP Press, 2014. ISBN:
978-1592298402.
[3] Matt Chudy, Luis Castedo, and Ricardo Lopez. Sales and Distribu-
tion in SAP ERP Practical Guide (2nd Edition), SAP SD. SAP Press,
2015. ISBN: 978-1493210541.
[4] Cloud9. Supported Languages - Cloud9. https://docs.c9.io/
docs/supported-languages, 2016. [Online].
[5] Panorama Consulting. 2015 ERP REPORT. http:
//go.panorama-consulting.com/rs/panoramaconsulting/
images/2015%20ERP%20Report.pdf, 2015. [Online].
[6] SAP HANA Cloud Documentation. Cockpit.
https://help.hana.ondemand.com/help/frameset.htm?
e47748b5bb571014afedc70595804f3e.html, 2016. [Online].
[7] SAP HANA Cloud Documentation. November 2016.
https://help.hana.ondemand.com/webide/frameset.htm?
283a483cb4ef475f953e0066c5bfb791.html, 2016. [Online].
[8] SAP HANA Cloud Documentation. SAP HANA Cloud Connec-
tor. https://help.hana.ondemand.com/help/frameset.htm?
e6c7616abb5710148cfcf3e75d96d596.html, 2016. [Online].
[9] SAP HANA Cloud Documentation. Services in the Cock-
pit. https://help.hana.ondemand.com/help/frameset.htm?
7613d9ce711e1014839a8273b0e91070.html, 2016. [Online].
[10] Frank Forndron, Thilo Liebermann, Marcus Thurner, and Peter
Widmayer. mySAP ERP Roadmap: Business Processes, Capabilities,
and Complete Upgrade Strategy. SAP PRESS, 2006. ISBN: 978-
1592290710.

43
BIBLIOGRAPHY

[11] Emmanuel Hadzipetros. Architecting EDI with SAP IDocs: the


Comprehensive Guide. SAP Press, 2013. ISBN: 978-1592298723.

[12] Katzer. Cordova Print Plugin. https://github.com/katzer/


cordova-plugin-printer, 2016. [Online].

[13] Venki Krishnamoorthy and Alexandra Carvalho. Discover SAP:


An Introduction to SAP, Beginner’s Guide (3rd Edition). SAP Press,
2014. ISBN: 978-1592299874.

[14] Martin Murray and Jawad Akhtar. Materials Management with


SAP ERP: Functionality and Technical Configuration (SAP MM) (4th
Edition) (SAP PRESS). SAP Press, 2016. ISBN: 978-1493213573.

[15] SAP Help portal. BAPI User Handbook. https:


//help.sap.com/saphelp_nwpi711/helpdata/en/7e/
5e115e4a1611d1894c0000e829fbbd/content.htm?frameset=
/en/7e/5e11a84a1611d1894c0000e829fbbd/frameset.htm&
current_toc=/en/7e/5e141a4a1611d1894c0000e829fbbd/
plain.htm&node_id=3, 2016. [Online].

[16] SAP Help portal. Invoice. https://help.sap.com/saphelp_


srm40/helpdata/en/25/7ccff39ae5f143ac30ea772e10382c/
content.htm, 2016. [Online].

[17] SAP Help portal. Purchase Order. http:


//help.sap.com/saphelp_46c/helpdata/en/75/
ee0ce555c811d189900000e8322d00/content.htm, 2016. [On-
line].

[18] SAP Help portal. SAP List Viewer (ALV). https:


//help.sap.com/saphelp_nw73ehp1/helpdata/en/4e/
c1f117076868b8e10000000a42189e/content.htm?frameset=
/en/4e/c38f8788d22b90e10000000a42189d/frameset.htm&
current_toc=/en/55/632e5a2674454197c4518419f138dc/
plain.htm&node_id=117&show_children=true#jump118, 2016.
[Online].

[19] SAP Help portal. Transaction Model for Developing


BAPIs. http://help.sap.com/saphelp_46c/helpdata/en/a5/

44
BIBLIOGRAPHY

3ec8654ac011d1894e0000e829fbbd/content.htm, 2016. [On-


line].
[20] SAP. ABAP for newbies. https://blogs.sap.com/2006/11/08/
abap-for-newbies/, 2016. [Online].
[21] SAP. Integration Services. https://hcp.sap.com/
capabilities/integration.html, 2016. [Online].
[22] SAP. SAP Fiori Design Guidelines. https://experience.sap.
com/fiori-design-web/, 2016. [Online].
[23] SAP. What is ERP. http://www.sap.com/solution/
what-is-erp.html, 2016. [Online].
[24] Sapbrainsonline.com. SAP Selection Screen. http:
//sapbrainsonline.com/abap-tutorial/syntax/
selection-screen-sap-abap-keyword.html, 2016. [Online].
[25] Sapdev.com. SELECT command - Example ABAP code to demon-
strate the SELECT command. http://www.sapdev.co.uk/tips/
tips_select.htm, 2016. [Online].
[26] Olaf Schulz. SAP: A User’s Guide for Learning SAP ERP (2nd
Edition) (SAP PRESS). SAP Press, 2014. ISBN: 978-1592299812.
[27] Tachyon technologies. SAP Fiori – Create Sales Order
App. http://tachyontech.com/wp-content/uploads/2014/
07/CreateSalesOrder1.png, 2016. [Online].
[28] Tutorialspoint.com. SAP ABAP - Internal Tables.
https://www.tutorialspoint.com/sap_abap/sap_abap_
internal_tables.htm, 2016. [Online].
[29] Tutorialspoint.com. SAP ABAP Overview. https://www.
tutorialspoint.com/sap_abap/sap_abap_overview.htm, 2016.
[Online].
[30] John von Aspen. Getting started in SAP: How to transform your career
and become a highly paid SAP expert. CreateSpace Independent
Publishing Platform, 2014. ISBN: 978-1497434004.

45
A Appendix
In this chapter I provide screenshots and pictures related to this master
thesis.
Appendix consists of:

• Screenshot of the ZSD_DM_ORDER_H ANDLI NG program

• Standard order process

• Creation of sales order in SAP and in Fiori

All attachments to this master thesis are placed in the archive of


this thesis in the IS MU.
Attachments consists of:

• Source code of ZSD_DM_ORDER_H ANDLI NG optimization


program for ABB

• Source code of Fiori application

• Images and screenshots

46
A. Appendix
Figure A.1: Output screen of the program
47
A. Appendix
Figure A.2: Standard order process
48
A. Appendix
Figure A.3: Sales order creation in SAP
49
A. Appendix
Figure A.4: Sales order creation in Fiori application [27]
50

You might also like