How to Use Confirmation Popups in Web Dynpro for ABAP

Applies to:
Web Dynpro for ABAP. For more information, visit the ABAP homepage.

Summary
If you are familiar with using the function module POPUP_TO_CONFIRM in your ABAP applications, you may have wondered how to use confirmation popups in Web Dynpro for ABAP. This article will show you how. Author: Christine Arundell
st

Company: SAP Created on: 1 November 2011

Author Bio
Christine Arundell is a Senior Education Consultant with SAP UK. She teaches courses across the entire ABAP curriculum.

SAP COMMUNITY NETWORK © 2011 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com 1

...............................com 2 ........................................com | BPX ..com | UAC .sap.....................sap...........sdn................................................................................................... 3 Related Content .......................................................................com | BA ...............................boc........How to Use Confirmation Popups in Web Dynpro for ABAP Table of Contents Using Confirmation Popups in Web Dynpro for ABAP ............bpx... 12 Copyright...............sap.......uac..sap.................. 13 SAP COMMUNITY NETWORK © 2011 SAP AG SDN ...........................

In the Context of the Component Controller.sdn. assign it to your package and change request as usual. SAP COMMUNITY NETWORK © 2011 SAP AG SDN .How to Use Confirmation Popups in Web Dynpro for ABAP Using Confirmation Popups in Web Dynpro for ABAP Create a new Web Dynpro Component called ZNET310_POPUP_CONFIRM_## When prompted.uac.com | UAC . create a node called PAY. cardinality of 1:1: Now right-click on the new node to add an attribute SALARY.bpx.com | BA .com | BPX .com 3 .sap.boc.sap.sap. type I.sap.

sap.com | BPX .How to Use Confirmation Popups in Web Dynpro for ABAP Map the Component Controller context to the context of your view: In the Layout of your view.sap.sap.boc.uac. with the text ‘INCREASE SALARY’. and an ACTION called ‘INCREASE’. SAP COMMUNITY NETWORK © 2011 SAP AG SDN .bpx.sdn.com | UAC . and create an InputField. add a Label UI element with the text ‘Please enter your current salary’.com 4 .sap. bound to the PAY attribute just created: Next create a button.com | BA .

sap.com 5 .com | UAC .uac.sap. and put your cursor in the appropriate place: Use the Web Dynpro Code Wizard and choose the appropriate radiobutton SAP COMMUNITY NETWORK © 2011 SAP AG SDN .How to Use Confirmation Popups in Web Dynpro for ABAP Go to the Event Handler method for the action.sap.sdn.com | BPX .boc.sap.com | BA .bpx.

sap.sap.sap.boc.uac. then hit the PATTERN pushbutton: Choose ABAP Objects Patterns.sap. then hit the green tick to continue: Populate as shown below.com 6 . first ensure your cursor is positioned where you want the new method to be added.sdn.com | BA . Remove the CREATE_WINDOW method: Where the CREATE_WINDOW method was.How to Use Confirmation Popups in Web Dynpro for ABAP Result: We want all of this code except for the CREATE_WINDOW method – instead we are going to call the CREATE_POPUP_TO_CONFIRM method to produce the confirmation popup box.com | BPX .bpx. we are going to add a different method – we can use the PATTERN functionality to do this.com | UAC . then choose the green tick to insert the code: SAP COMMUNITY NETWORK © 2011 SAP AG SDN .

sap.boc.uac.com | BPX .com | BA .com | UAC . you should see your popup working: SAP COMMUNITY NETWORK © 2011 SAP AG SDN .sap.sdn.bpx.sap.How to Use Confirmation Popups in Web Dynpro for ABAP Result: Set values of parameters as shown below: If you activate everything and create an application for your Web Dynpro Component and run it now.sap.com 7 .

boc.uac. we need to proceed as follows.How to Use Confirmation Popups in Web Dynpro for ABAP To react to the user pressing either of the buttons.sap. BEFORE the OPEN method at the end.com | BA .sap.bpx. Go back to the method where you implemented the popup.com | UAC .com 8 .sdn.com | BPX . which we can then program the logic for. use the Web Dynpro Code Wizard and populate as follows: SAP COMMUNITY NETWORK © 2011 SAP AG SDN . we need to assign an action to each of the buttons.sap. Firstly.sap.

boc.uac.sdn.com | BPX .How to Use Confirmation Popups in Web Dynpro for ABAP Result: Now use the PATTERN button again (as described above) to add the following method call: Populate the parameters of the method as shown below – the ACTION_NAME is an action which we will create in our view in just a moment: SAP COMMUNITY NETWORK © 2011 SAP AG SDN .sap.com | BA .com | UAC .sap.sap.bpx.sap.com 9 .

sap.uac. and program the event handler method. Position your cursor between the METHOD….com 10 . Switch to the ACTIONS tab in your view and create the action as shown below: Now switch to the METHODS tab and you should see the event handler has been created for you: Double-click on the method to implement it. We will just issue a simple message to prove that we know the user has pressed the YES button.How to Use Confirmation Popups in Web Dynpro for ABAP We now need to create the action which we have assigned to the YES button.sdn.bpx.com | UAC .sap.sap..ENDMETHOD: Use the WIZARD: SAP COMMUNITY NETWORK © 2011 SAP AG SDN .com | BPX .com | BA .sap.boc.

com | BA .uac.sap.bpx.sdn.How to Use Confirmation Popups in Web Dynpro for ABAP Populate the parameters of the resulting method call as shown below: Activate your changes and test: You can now repeat as above to apply the logic for the NO pushbutton.com | BPX .sap.boc. SAP COMMUNITY NETWORK © 2011 SAP AG SDN .sap.com | UAC .sap.com 11 .

sap.bpx.com | BA .sdn.How to Use Confirmation Popups in Web Dynpro for ABAP Related Content For more information.com | BPX .uac.sap.sap.com 12 . visit the ABAP homepage SAP COMMUNITY NETWORK © 2011 SAP AG SDN .sap.com | UAC .boc.

PartnerEdge. OSF/1. Oracle is a registered trademark of Oracle Corporation. Tivoli and Informix are trademarks or registered trademarks of IBM Corporation. System i. z10. xSeries. used under license for technology invented and implemented by Netscape. Microsoft. HACMP. BladeCenter. Data contained in this document serves informational purposes only. Nothing herein should be construed as constituting an additional warranty. BatchPipes. Crystal Decisions. BusinessObjects. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services. National product specifications may vary. JavaScript is a registered trademark of Oracle Corporation.com 13 . and SAP Group shall not be liable for errors or omissions with respect to the materials.A. OS/390. Massachusetts Institute of Technology. IBM. Java is a registered trademark of Oracle Corporation. S/390 Parallel Enterprise Server. Intelligent Miner.uac. and other countries.sap.sdn. All other product and service names mentioned are the trademarks of their respective companies. SAP COMMUNITY NETWORK © 2011 SAP AG SDN .boc. System i5. Business Objects and the Business Objects logo. PostScript. POWER6. OS/400. PowerVM. MetaFrame. Adobe. POWER5. Program Neighborhood. Inc. World Wide Web Consortium. z/OS. RACF. Excel. System z. DB2 Connect. S/390. Crystal Reports. Power Architecture. HTML. UNIX. R/3.bpx. System z10. SAP NetWeaver. System Storage. z9. System p. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. the Adobe logo. Web Intelligence. eServer. AS/400.com | UAC . zSeries. in the United States and in other countries. MVS/ESA. All rights reserved. Citrix.How to Use Confirmation Popups in Web Dynpro for ABAP Copyright © Copyright 2011 SAP AG. POWER. i5/OS. XHTML and W3C are trademarks or registered trademarks of W3C®. DB2. Linux is the registered trademark of Linus Torvalds in the U. POWER6+. Outlook. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only. POWER5+. and MultiWin are trademarks or registered trademarks of Citrix Systems. VideoFrame. GPFS. Acrobat.sap. pSeries. and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. These materials are subject to change without notice. if any. XML. z/VM. WinFrame. The information contained herein may be changed without prior notice. Redbooks. Duet. ICA. System x. Netfinity. AIX. Windows.sap.com | BPX . and PowerPoint are registered trademarks of Microsoft Corporation.S. OS/2. Xcelsius. Parallel Sysplex. PowerPC. and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.com | BA . Business Objects is an SAP company. without representation or warranty of any kind. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. iSeries. SAP Business ByDesign. System z9.sap. OpenPower. and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S. WebSphere. DB2 Universal Database. SAP. RETAIN. ByDesign. X/Open. and Motif are registered trademarks of the Open Group. System p5.

Sign up to vote on this title
UsefulNot useful