SAP Technology News

Seamless File Upload and Download to SAP using SAP NetWeaver Gateway

Introduction
SAP NetWeaver Gateway is a technology that offers a seamless platform to connect devices, environments and platforms. It enables creation of cutting edge solutions with world class UX providing the potential of SAP business software into new experiences including social and collaboration environments, mobile, tablet and rich internet applications. It offers the flexibility to use any programming language or model to connect with SAP applications by leveraging REST services and OData/ATOM protocols, eliminating the necessity to have the knowledge of SAP.
This blog provides step by step instructions of how you can leverage Innovapptive’s function modules to upload files for any document and later download the files to SAP server, appreciating the technology behind this approach. Before we get into the actual process of file upload/download process, let’s get a brief technical background of the function modules behind the upload/download process.
There are two function modules on the SAP server to enable the file upload/download process:
1. /INVMWL/FM_WI_ATTACH_DISPLAY (Display Attachments – file upload): In this module, you can define the input parameters (IM_OBJKEY and IM_APPID) to get the required attachments for that file.
2. /INVMWL/FM_WI_ATTACH_DOWNLOAD (Download Attachments – file download): Once you get the required attachments, the next step is to fetch the data from the attachments. This is accomplished in this module, wherein you can define 3 parameters (IM_APPID, IM_OBJKEY and IM_OBJID) to retrieve the information available in each of the attachments.
Let’s assume, there is a sales order for which you need to attach multiple files. Technically speaking, here sales order is referred by the object key and respective files that you want to attach are referred by its respective object ids. Note that each document can have a one reference id. First, let’s understand the high level steps for the file upload/download process:

File Display

STEP 1 – TASKS TO PERFORM ON SAP BACK-END SERVER
1. Pass the parameter names (IM_OBJKEY and IM_APPID) to get the attachments.
2.  Read the information in the documents and convert into binary code.
STEP 2 – TASKS TO PERFORM IN RFC (SAP NETWEAVER GATEWAY) FOR 
1. Replicate the entity structure (as defined /INVMWL/FM_WI_ATTACH_DISPLAY module) and map the services to get the list of attachments.
2. Replicate the entity structure (as defined in /INVMWL/FM_WI_ATTACH_DOWNLOAD module) and map the services to download the data. Now, let’s move on to the high level steps:

File Upload and Download

STEP 1 – TASKS TO PERFORM ON SAP BACK-END SERVER
1. Get the attachments for the file (refer figure 2) by passing the input parameters. For this, follow the below logic:
a. Based on the parameters (Object key & Appid) that you pass, select the business object.
b.  Call the functional module BDS_ALL_CONNECTIONS_GET with the following parameters:
 Input for this functional module
Classname = Business Object
Classtype = BO
Objkey = IM_OBJKEY     
Output for this functional module
Number of attachments’ component ids
c. Loop the component ids.
d. Call the functional module:SO_DOCUMENT_READ_API1
e. Enter the component id to get data from each of the attached documents.            
Note: If there are multiple attachments, multiple object ids gets retrieved for a single object key (Ex: Sales Order)
f. Endloop.
Figure 1
Figure 1: Import Parameters
Figure 2
Figure 2: Export Parameters
2. Read and convert the information in the files to binary code (Refer figure 4),
a. Call the function module SO_DOCUMENT_READ_API1.
b. Get the attached document data in string format.
c. Call the functional module SCMS_BINARY_TO_XSTRING to convert to xstring from binary.
Figure 3
Figure 3: Import Parameters
Figure 4
Figure 4: Export Parameters
STEP 2 – TASKS TO PERFORM IN RFC (SAP NETWEAVER GATEWAY) FOR 
1. Replicate the entity structure using RFC module and map the services to get the list of attachments.
a. Create the entity structure in the Properties screen. This generates a URL.  
Figure 5
Figure 5: Replicate Entity Structure
b. Map the services for query operation for module: /INVMWL/FM_WI_ATTACH_DISPLAY
Figure 6
Figure 6: Map the Services
2.  Replicate the entity structure and map the services to download the data.
a. Replicate the fields in the Properties screen.
Figure 7
Figure 7: Replicate the entity structure to read the data
b. Map the services (Operation GetEntity) in the /INVMWL/FM_WI_ATTACH_DOWNLOAD module, which generates a URL where you      can view/download the data of the attachments.
Figure 8
Figure 8: Map the services to download the data
Contact us today to learn how you can leverage our custom mobile development accelerators to reduce your app development times by over 50%. Read more here – Custom Application Development. Contact us by sending an email tosales@innovapptive.com


SAP Web IDE (Integrated Development Environment) for SAP Fiori and SAPUI5 Applications

SAP Web IDE (Integrated Development Environment) is a Web-based development environment designed to support the end-to-end application lifecycle for SAP Fiori and SAPUI5 applications

In today’s market scenario, the key to business success lies in agility in multiple dimensions. One of the key aspects of agility is to design, develop and deploy applications swiftly to address the growing expectations of the users to have amazing user experiences. Using SAP Web IDE, developers and power users alike can swiftly deploy new-age applications that leverage SAP HANA and SAP HANA cloud platform and is planned to be available as on-premise solution on SAP HANA XS in the future. The pluggable and modular architecture allows to integrate SAPUI5 tools and enables SAP development, partners and customers to add their own plugins.
SAP IDE Environment(1)
This web based development environment addresses the application development processes in a comprehensive manner, right from prototype through deployment. SAP Web IDE offers highly efficient tools to easily build and extend apps applying SAP Fiori UX and generic SAPUI5 apps using wizards, templates, drag and drop tools, code editor and much more. Simply stated, SAP Web IDE is a web based environment that lets users to create incredible user experiences swiftly for browser and mobile devices. Apart from that, SAP Web IDE environment also lets users to extend SAP Fiori and UI5 apps (through visual extensibility editor) as well as build new UI5/HTML5 or custom Fiori apps.

Overview of key features

  • Offers standard development tools such as code editors wizards and WYSIWYG (“What You See Is What You Get”) tooling that are optimized for building responsive HTML5 apps with SAPUI5.
  • Consists of certain standard templates – SAPUI5, Fiori and SAP WEB IDE plugin; and offers flexibility to create your own template (custom template).
  • Supports the E2E application life cycle that covers UI design, development, testing, deployment and customer extensions for responsive SAPUI5 apps.
  • Code based environment – the tool never gets in the way of the developer.
  • Both SAP and non-SAP developers can design, build, test and deploy responsive SAP UI5 and Fiori like apps using SAP HANA or Gateway OData services.
  • Develop once and deploy anywhere – can be run on any device including mobile and tablet.
  • Instant preview feature that lets you launch the application in the browser at different resolutions and in multiple languages, using real or mock data.
  • Collaborative development and project persistency that lets developers to collaborate on specific files via JAM integration (not available in the beta release in June 2014).
  • Provides extensible and modular architecture that lets you add your own plug-in/template via wizards and templates.

Why SAP Web IDE

  • Enhances development productivity – offers easy to consume development environment.
  • Minimizes IT infrastructure and administration efforts.
  • Cloud based (hosted on SAP HANA cloud platform), eliminating initial installation and configuration of local IT infrastructure.
  • Access development projects anytime and anywhere.
  • Holistic development environment with incredible UI.
  • Drag-and-drop (WYSIWYG) editors – simple to use with less technical complexity.
  • Tighter collaboration between developers, business experts and designers.

Summary

SAP Web IDE serves as a great productivity tool for developers, designers and business experts. With its cutting edge embedded tools covering end-to-end development process, it enables you to rapidly design, build and deploy web applications based on SAPUI5 and also supports you in extending SAP Fiori apps. Some of the key advantages of leveraging SAP Web IDE include enhancement of the development productivity, low infrastructure costs and ensuring tight collaboration between designers, developers and business experts. Hence, SAP Web IDE lets you develop and deploy applications with greater agility, while providing amazing end user experiences.
Request a Demo
If you would like to request a demo for the “SAP Web IDE”, please click on the link above. Alternatively, if you would like to discuss with an Innovapptive solution expert, you can reach out to us by emailing us at sales@innovapptive.com or you can reach a sales representative at (713) 275-1804.


 
Return to top of pageCopyright ©SAP Mobility 2019 | Template design by Privacy Policy|Disclaimer*All trademarks and copyrights remain the property of their respective owners.