Upload Image file from system in Web dynpro view

Similar documents
Integration of Web Dynpro for ABAP Application in Microsoft Share Point Portal

Adding Files as Attachments to SAP Interactive Forms in the Java Environment

POWL: Infoset Generation with Web Dynpro ABAP

Fetching User Details from the Portal and Displaying it in Web Dynpro with Authentication in the Portal

Step by Step Method for File Archival in BW

How to Reference External JAR Files in Web Dynpro DC in SAP NW Portal 7.3

Table Row Popup in Web Dynpro Component

Dialog Windows in WebDynpro ABAP Applications

Freely Programmed Help- Web Dynpro

BAPI Execution in offline Adobe Form

How to Create Top of List and End of List of the ALV Output in Web Dynpro for ABAP

How to Download Multiple Files in ZIP using WebDynpro Java

Easy Lookup in Process Integration 7.1

Add /Remove Links on ESS Home Page in Business Package 1.5

Using Radio Buttons in Web Template

Validity Table in SAP BW/BI

SDN Community Contribution

Web Dynpro ABAP: Dynamic Table

MDM Syndicator: Custom Items Tab

Material Master Archiving in Simple Method

How to Upload a File into the Knowledge Management (KM) Repository using KM API.

Creating Rules in Process Composer and using them in Process

Web Dynpro: Coloring Table Conditionally

Limitation in BAPI Scheduling Agreement (SA) Create or Change

Internationalization in WebDynpro ABAP Applications

Deploying BusinessObjects Explorer on Top of a SAP BI Query

Graphical Mapping Technique in SAP NetWeaver Process Integration

This article explains the steps to create a Move-in letter using Print Workbench and SAPScripts.

Process Chain Log Deletion

Server Connectivity and Data Load from Non SAP System to BW

SDN Community Contribution

Open Text DocuLink Configuration - To Access Documents which are Archived using SAP

Template Designer: Create Automatic PDF Documents for Attachment or Print Purpose

Step by Step Procedure for DSO Creation

Web Dynpro Interactive Forms Data Transfer and Scripting

Standalone BW System Refresh

Custom Password Reset Tool in SAP Enterprise Portal Using Web Dynpro for Java

Federated Portal for Composite Environment 7.1

External Driver Configuration for Process Integration 7.0

Web Dynpro ABAP: Changing ALV Contents and Saving in Database

Administrating ABAP+JAVA and SLD Problems of SAP PI 7.1

Replacement Path: Explained with an Illustrated Example

Linking Documents with Web Templates

Message Prioritization in Advanced Adapter Engine

DB Connect with Delta Mechanism

Table Properties and Table Popin

Creating Custom SU01 Transaction Code with Display and Password Reset Buttons

SUP: Personalization Keys and Synchronize Parameter

Maintaining Roles and Authorizations in BI7.0 - RSECADMIN

How to use Boolean Operations in the Formula as Subsidiary for IF Condition

MDM Import Manager - Taxonomy Data (Attribute Text Values) Part 3

Step by Step Guide How to Use BI Queries in Visual Composer

Creating, Configuring and Testing a Web Service Based on a Function Module

Step By Step: the Process of Selective Deletion from a DSO

How to Create and Schedule Publications from Crystal Reports

How to Upload and Download Files in a Web Dynpro for Java Application

Material Listing and Exclusion

Different Types of iviews in Enterprise Portal 7.0

How to Integrate Web Dynpro ABAP in Portal and Capture Portal Logon User Name

A Simple Web Dynpro Application to Locate Employee s Location into Google Map

How to Configure User Status in mysap SRM

SAP BI BO Unit/Currency Logic for Unknown Units Case Study

How to Create Business Graphics in Web Dynpro for ABAP

E-Sourcing System Copy [System refresh from Production to existing Development]

Working with the Roadmap UI Element in Web Dynpro ABAP

Solution to the Challenges in Pivoting

Dynamically Enable / Disable Fields in Table Maintenance Generator

Extracting Missing Fields of Data Source Which Are Present In Their Extract Structure

How to Create View on Different Tables and Load Data through Generic Datasource based on that View

Xcelsius Tricks Part 5 Create a Loading Bar in SAP Crystal Dashboard and Presentation Design (Xcelsius 2008)

SDN Community Contribution

Enhancing Web Dynpro Table Performance

How to Integrate SAP xmii Services with Web Dynpro Java

Recreating BIA Indexes to Address the Growth of Fact Index Table

ABAP HR: Standard Info Type Enhancement

SAP PI/XI: Generating Sequence Number Between Multiple Instances of Mapping Execution

Extraction of Hierarchy into Flat File from R/3 and Loading in BW System

Implying Security on Business Object XI 3.1 Universe having SAP BW as Source

MDM Syndication and Importing Configurations and Automation

How to Default Variant Created for Report Developed In Report Painter/Writer

How to Display Traffic Lights for Exceptions in BI Web Reports

Step By Step Procedure to Implement Soap to JDBC Scenario

Financial Statement Version into PDF Reader

Data Flow During Different Update Mode in LO Cockpit

Displaying SAP Transaction as Internet Application in Portal

Creating a Development Component

Errors while Sending Packages from OLTP to BI (One of Error at the Time of Data Loads through Process Chains)

Material Master Extension for New Plant

Purpose of Goods Receipt Message indicator in Purchase Orders

Triggering the Process Chains at Particular Date using Events

Federated Portal Network Remote Role Assignment Step-by- Step Configuration

Creation of Key Figures with Higher Decimal Place Precision

Data Source Replication and Activation of Transfer Structures

Using Nested Exception Aggregation in BEx Reports- Scenario

ecatt Part 6 System Data Container

BW Reconciliation. Applies to: Summary. Author Bio

SMT (Service Mapping Tool)

BPM Multi Line Container in Integration Process

Step-By-Step guide to Virtual InfoCube Implementation

SAP QM-IDI Interface. SDN Contribution. Applies to: Summary. Author Bio. SAP QM Interfaces

Transcription:

Upload Image file from system in Web dynpro view Applies to: Web Dynpro for Java UI Development, SAP NetWeaver 2004s. For more information, visit the User Interface Technology homepage. For more information, visit the Web Dynpro Java. Summary This article demonstrates how to upload an Image file from system to same Web Dynpro view. 0-byte resource creation on server saves memory consumption as well. Author: Khushboo Singhal Company: L&T InfoTech Created on: 02 September 2008 Author Bio. Khushboo Singhal has been working in L&T InfoTech for the last 10 months as NetWeaver- Web Dynpro Consultant. 2008 SAP AG 1

Table of Contents Introduction...3 Prerequisite...3 Creating Application...3 1. Create Web Dynpro project...3 Create Layout...4 Create Context in View...5 2. Create Action imageupload...5 3. Properties for UI Elements...6 4. Properties of context elements...7 5. Implementation:...8 6. Result...10 Create an application for WD project...10 Now select the option Deploy New Archive and Run...10 Related Content...12 Disclaimer and Liability Notice...13 2008 SAP AG 2

Introduction This tutorial provides demonstration of uploading an Image file from system to Web dynpro view using three UI element : FileUpload, LinktoAction, Image. File Upload UI elements provide path for Image file, when user clicks on Link upload an Action imageuplaod gets executed and corresponding Image file is displayed in same view Prerequisite Access to SAP NetWeaver AS Java and SAP Net Weaver Developer Studio installed in your system. Creating Application 1. Create Web Dynpro project 2008 SAP AG 3

Create Layout 2008 SAP AG 4

Create Context in View 2. Create Action imageupload For Action imageupload select parameter of type Java Native Type.IResourceElement. 2008 SAP AG 5

3. Properties for UI Elements Set properties for Group UI element: Height-100%, Width -100%, Layout- Matrix Layout For Fileupload UI element:. For LinkToAction UI element: Bind action imageupload to onaction property 2008 SAP AG 6

For Image UI element: 4. Properties of context elements ImgResource attribute select Resource type from Dictionary Simple Type. For Picture value attribute select binary from drop down. Set ImgURL attribute type as string from drop down. For Resource Value node pass supply function: 2008 SAP AG 7

5. Implementation: Write Code as following o for wdmodifyview //@@begin wddomodifyview // if (firsttime) { IWDLinkToAction linktoaction = (IWDLinkToAction) view.getelement("linktoaction"); linktoaction.mappingofonaction().addsourcemapping("nodeelement", "resourceelement"); //@@end For supplyresource //@@begin supplyresource(iwdnode,iwdnodeelement) IPrivateUploadCompView.IResourceElement resourceelement; // ----------- 1. Resource Node Element ------------------------------ resourceelement = wdcontext.noderesource().createresourceelement(); node.addelement(resourceelement); // ----------- 2. Resource Node Element ------------------------------ resourceelement = wdcontext.noderesource().createresourceelement(); node.addelement(resourceelement); } // ----------- Resource Node Element ------------------------------ resourceelement = wdcontext.noderesource().createresourceelement(); node.addelement(resourceelement); //@@end For onactionimageuplaod //@@begin onactionimageuplaod(serverevent) if (wdcontext.currentresourceelement().getimgresource()!= null) { 2008 SAP AG 8

// copy URL string from IWDResource object to // context attribute 'UploadImgURL'. Image gets // visible on the UI based on databinding definition. wdcontext.currentresourceelement().setimgurl( wdcontext.currentresourceelement().getimgresource().geturl(wdfiledownloadbehaviour.op EN_INPLACE.ordinal())); } //@@end 0byte resource creation:- //@@begin others private IWDResource create0byteresource( IWDNodeElement datanodeelement, String calcattrname, String resourcename, WDWebResourceType resourcetype) { return WDResourceFactory.createResource( datanodeelement.getattributepointer(calcattrname), resourcename, resourcetype); } //@@end 2008 SAP AG 9

6. Result Create an application for WD project Now select the option Deploy New Archive and Run 2008 SAP AG 10

Select the Image file from your system. Click on upload link.it will display the selected image in same Web Dynpro view. 2008 SAP AG 11

Related Content Please include at least three references to SDN documents or web pages. www.google.com www.sdn.sap.com www.help.sap.com For more information, visit the User Interface Technology homepage. For more information, visit the Web Dynpro Java 2008 SAP AG 12

Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade. SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk. SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document. 2008 SAP AG 13