Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Set alert When delete record from DB table.

Former Member
0 Likes
882

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

4 REPLIES 4
Read only

Former Member
0 Likes
842

Hi,

You can search in forums instead of waiting for the answers.

see the link below

regards,

Nazeer

Read only

Former Member
0 Likes
842

Hi,

you can give a pop-up message using FM POPUP_TO_CONFIRM after user command 'DELETE' or before deleting from DB

Read only

Former Member
0 Likes
842

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

Read only

0 Likes
842

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