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

Message

Former Member
0 Likes
579

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
545

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

4 REPLIES 4
Read only

Former Member
0 Likes
545

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

Read only

Former Member
0 Likes
545

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

Read only

Former Member
0 Likes
546

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

Read only

Former Member
0 Likes
545

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