2009 Dec 22 4:20 AM
HI exparts,
I try to write a function for delete record from DB table suppose KNA1.
Before deleting the record I want to see a alert message which contain two button "YES" & "NO".
If YES data will be delete .
If NO data will not delete.
Pls help me as soon as possible.
Your regards
Rayhan
HI exparts,
I try to write a function for delete record from DB table suppose KNA1.
Before deleting the record I want to see a alert message which contain two button "YES" & "NO".
If YES data will be delete .
If NO data will not delete.
Pls help me as soon as possible.
Your regards
Rayhan
2009 Dec 22 4:25 AM
2009 Dec 22 4:28 AM
Hi,
you can give a pop-up message using FM POPUP_TO_CONFIRM after user command 'DELETE' or before deleting from DB
2009 Dec 22 4:44 AM
Hi,
Try using the below code.
data: l_answer type c.
If sy-ucomm = 'DELETE'.
call function 'POPUP_TO_CONFIRM'
exporting
titlebar = 'Deletion Confirmation'
text_question = 'Do you want to delete the record?'
text_button_1 = 'Yes'
icon_button_1 = 'X'
text_button_2 = 'No'
icon_button_2 = 'X'
default_button = 1
display_cancel_button =
importing
answer = l_answer
exceptions
text_not_found = 1
others = 2
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
If l_answer = 1.
"code for deleting the record from the database.
endif.
endif.Thanks,
Harini
2009 Dec 22 6:07 AM
hi
You have to call the function module POPUP_TO_CONFIRM as told by harine.
call the function module as defined and write your code when sy-subrc =0. as defined
that will definitely help.
Thanks
Tanmaya
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |