SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.

CRM Companies List
Web Based CRM Software

How to Open PopUp_To_Confirm Screen When Delete Function Key is Pressed for Confirmation

In this ABAP tutorial, ABAP developers will find a sample ABAP report which displays a popup confirmation screen when delete function key is pressed.

In the below SAP screenshot, you can see 4 function keys each for Create, Change, Display and Delete.


Function keys are declared using : SELECTION-SCREEN: FUNCTION KEY 1. ABAP code.
Here is the ABAP codes block used for function key declaration.


The icons and the text of each function key is set using : sscrfields-functxt_01
Here is the ABAP code for text and icon settings of each function key.
For example icon_create is "@0Y@" and maps to create new document icon.
For more information about SAP icons please refer to SAP tutorial Display Icons using ABAP Code - SAP Icon List.

CONCATENATE icon_create text-fc1 INTO gv_button_text. " '@0Y@'
sscrfields-functxt_01 = gv_button_text.

In the ABAP codes section AT SELECTION-SCREEN, the value of ABAP field sscrfields-ucomm is controlled to define which SAP function key is pressed.
In our example to display the delete confirmation screen before deleting the ABAP table record from database table, I used the popup_to_confirm function call code where the sscrfields-ucomm value which stores the returned function key code is "FC04"


The ABAP function call returns the value of the pressed button at the delete confirm screen.
In order to check which button is pressed on the delete confirm screen, I defined a local variable lv_answer as type c with length 1.
For the above screen shot if the value of the local variable lv_answer is equal to 1 then this means the YES button is clicked.
A value of 2 means NO button is pressed.
And if the value of lv_answer is 3 then the CANCEL button is pressed by the user on the confirm delete screen.

Sample ABAP Code for PopUp_To_Confirm

Here is the ABAP codes of the example ABAP report which uses the Call Function POPUP_TO_CONFIRM for confirming delete operation when DELETE function key is pressed.

SAP Resources

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table

Copyright © 2004 - 2018 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems