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

How to trigger message box?

Former Member
0 Likes
1,359

Hello ABAPers,

I want to know how to trigger a message box like, when i am clicking cancel in my screen in the message box my message should be like "DATA WILL LOST DO YOU WANT TO CONTINUE in tabs YES or NO". If yes out fo screen NO stay in the same screen.

Can anyone help me with this.

Thks

Hello ABAPers,

I want to know how to trigger a message box like, when i am clicking cancel in my screen in the message box my message should be like "DATA WILL LOST DO YOU WANT TO CONTINUE in tabs YES or NO". If yes out fo screen NO stay in the same screen.

Can anyone help me with this.

Thks

10 REPLIES 10
Read only

amit_khare
Active Contributor
0 Likes
1,307

Use any of the POPUP Fm for the same.

In SE37 give POPUP* to get them.

I think POPUP_TO_CONFIRM will help you.

Read only

0 Likes
1,307

Hello Thks for responding to my query, i have used this FM and even i have tried with CHAIN and ENDCHAIN keywords but i am unable to get the message popup i think i am going wrong in my coding part if it is possible can you give me the write coding part syntax or any example i will be more happy.

Thks

Read only

0 Likes
1,307

Just debug and check after Clicking CANCEL whic part of the PAI is hit first and call this FM there.

Read only

0 Likes
1,307

Hi Amit,

After calling the POPUP_TO_CONFIRM FM in my program wht are all the parameters i have to consider like EXPORTING ....can you tell me the right parameters wht i have to give in POPUP_TO_CONFIRM FM .

Thks

Read only

0 Likes
1,307

I dont have system to check the exact.

Refer this thread-

Read only

Former Member
0 Likes
1,307

If you look in SE83 (ABAP Reuse Library) there is a section under Standard Dialogs on Confirmation Prompts - this includes an example of POPUP_TO_CONFIRM_LOSS_OF_DATA which sounds like the functionality you want (demo code in RSSPO100).

Jonathan

Read only

0 Likes
1,307

Hello my code is like,

call function 'POPUP_TO_CONFIRM'

exporting

titlebar = 'WARNING MESSAGE'

  • DIAGNOSE_OBJECT = ' '

text_question = 'DO YOU WANT TO CONTINUE'

text_button_1 = 'YES'(001)

  • ICON_BUTTON_1 = ' '

text_button_2 = 'NO'(002)

  • ICON_BUTTON_2 = ' '

  • DEFAULT_BUTTON = '1'

  • DISPLAY_CANCEL_BUTTON = 'X'

  • USERDEFINED_F1_HELP = ' '

  • START_COLUMN = 25

  • START_ROW = 6

  • POPUP_TYPE =

  • IMPORTING

answer = i_ans

  • TABLES

  • PARAMETER =

  • 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 i_ans = 1.

leave program.

elseif i_ans = 2.

call screen 100.

endif.

But pop up is box is not coming..please any modifications tht i have to do please can you tell me.

Read only

0 Likes
1,307

My first suggestion would be to add a "break-point." just before the "call function" to ensure you are actually reaching that point in the code.

Jonathan

Read only

0 Likes
1,307

Hi Venkat,

Try this one, simple copy and paste.

&----


*& Report ZT

*&

&----


*&

*&

&----


REPORT ZT.

data : ians(100) type c.

PARAMETER : V1 LIKE KONV-KWERT.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'Message by CMC Limited.'

text_question ='DO YOU WANT TO CONTINUE'

TEXT_BUTTON_1 = 'YES'(001)

  • ICON_BUTTON_1 = ''

TEXT_BUTTON_2 = 'NO'(002)

  • ICON_BUTTON_2 = ' '

DEFAULT_BUTTON = '1'

IMPORTING

ANSWER = ians

  • TABLES

  • PARAMETER =

  • 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 ians = 2.

leave program.

elseif ians = 1.

WRITE : 'HELLO'.

endif.

with Regards,

Gulrez Alam

Read only

Former Member
0 Likes
1,307

Hi,

You can use this.

Hope this will reach your requirement.

DATA : V_TEXT TYPE STRING.

V_TEXT = 'DATA WILL LOST DO YOU WANT TO CONTINUE'.

CASE SY-UCOMM.

WHEN 'CANCEL'.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = TEXT-000

  • DIAGNOSE_OBJECT = ' '

TEXT_QUESTION = V_TEXT

TEXT_BUTTON_1 = 'YES'

  • ICON_BUTTON_1 = ' '

TEXT_BUTTON_2 = 'NO'

  • ICON_BUTTON_2 = ' '

DEFAULT_BUTTON = '1'

DISPLAY_CANCEL_BUTTON = 'X'

  • USERDEFINED_F1_HELP = ' '

START_COLUMN = 25

START_ROW = 6

  • POPUP_TYPE =

  • IV_QUICKINFO_BUTTON_1 = ' '

  • IV_QUICKINFO_BUTTON_2 = ' '

IMPORTING

ANSWER = V_ANS

  • TABLES

  • PARAMETER =

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.

CASE V_ANS.

WHEN '1'.

LEAVE PROGRAM.

WHEN '2'.

CALL SCREEN 100.

WHEN OTHERS.

CALL SCREEN 100.

ENDCASE.

ENDCASE.

Here 100 is your present screen.

Regards

Sandeep Reddy