‎2007 Jun 28 10:17 AM
Hi friends,
I have a requirement., user wants to popup a message when when he selects a particular record and presses deletes.
He need to get message "Do you want to delete Yes or No" If the user presses Yes then only the record should be deleted.
Can any one please tell me how to do it.
Regards,
Line
‎2007 Jun 28 10:38 AM
Hi,
Please use code as below :
DATA: header(30),
Question(30),
answer(20),
button1(10),
button2(10).
header = 'Confirm for Deletion'.
question = 'Do you want to delete'.
button1 = 'Yes'.
button2 = 'No'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = header
TEXT_QUESTION = question
TEXT_BUTTON_1 = button1
TEXT_BUTTON_2 = button2
DEFAULT_BUTTON = '1'
IMPORTING
ANSWER = 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 answer eq '1'.
*DELETE................................
ENDIF.
Regards,
Sandeep Kaushik
‎2007 Jun 28 10:20 AM
Hello,
Use this FM
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = TEXT-005
TEXT_QUESTION = L_R_TEXT
TEXT_BUTTON_1 = TEXT-007
TEXT_BUTTON_2 = TEXT-008
DEFAULT_BUTTON = '1'
IMPORTING
ANSWER = G_F_RESULT
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.
Check the value off G_F_RESULT and code accordingly.
Vasanth
‎2007 Jun 28 10:20 AM
Hi Line ,
Currently you will have a code to delete the line , just before the code call the FM <b>POPUP_TO_CONFIRM</b> , based on the input of the user you can decide whether you want to delete or not,
Hope this helps.
Regards,
Arun
‎2007 Jun 28 10:38 AM
Hi,
Please use code as below :
DATA: header(30),
Question(30),
answer(20),
button1(10),
button2(10).
header = 'Confirm for Deletion'.
question = 'Do you want to delete'.
button1 = 'Yes'.
button2 = 'No'.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = header
TEXT_QUESTION = question
TEXT_BUTTON_1 = button1
TEXT_BUTTON_2 = button2
DEFAULT_BUTTON = '1'
IMPORTING
ANSWER = 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 answer eq '1'.
*DELETE................................
ENDIF.
Regards,
Sandeep Kaushik
‎2007 Jun 28 10:44 AM
HI
refer this Functional module.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
TITLEBAR = TEXT-007
TEXT_QUESTION = L_R_TEXT
TEXT_BUTTON_1 = TEXT-007
TEXT_BUTTON_2 = TEXT-008
DEFAULT_BUTTON = '1'
IMPORTING
ANSWER = G_F_RESULT
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.
Reward all helpfull answers.
Regards.
Jay