Application Development 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: 

How to Display Pop Up message with only YES NO Option ?

pintoo_d
Participant
0 Kudos

Hi Friends,

I have seen many Fn Modules like POPUP_TO_CONFIRM, POPUP_TO_CONFIRM_WITH_MESSAGE, POPUP_TO_DECIDE, C14A_POPUP_SAVE_WITH_CANCEL, POPUP_TO_CONFIRM_STEP etc.

But all i wanted is Pop Up message with Just 2 options. YES and NO. Dont want third option cancel or Exit.

Any ways to find that out ??

Please reply to me in details steps as i m new to this.

Thank You

Temesh

6 REPLIES 6

Former Member
0 Kudos

Hi

Use this FM POPUP_TO_CONFIRM

and set the property display_cancel_button = 'X' to hide the cancel button

CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = 'Confirmation '
            text_question         = 'Do you want to Overwrite'
            text_button_1         = 'Yes'
            text_button_2         = 'No'
            default_button        = '2'
            display_cancel_button = 'X'
          IMPORTING
            answer                = popup_return " to hold the FM's return value
          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 popup_return EQ '1'.
          ELSE.
          ENDIF.

Best Regards

Chaitanya.A

Former Member
0 Kudos

use this:

POPUP_WITH_2_BUTTONS_TO_CHOOSE

GauthamV
Active Contributor
0 Kudos

hi,

check this.

[https://forums.sdn.sap.com/click.jspa?searchID=18803973&messageID=6014541]

Former Member
0 Kudos

Hi Pintoo,

Use POPUP_WITH_2_BUTTONS_TO_CHOOSE

Check this link

DATA : ANS TYPE CHAR1.
 
CALL FUNCTION 'POPUP_WITH_2_BUTTONS_TO_CHOOSE'
  EXPORTING
*   DEFAULTOPTION       = '1'
    DIAGNOSETEXT1       = 'Choose'
*   DIAGNOSETEXT2       = ' '
*   DIAGNOSETEXT3       = ' '
    TEXTLINE1           = 'Yes or no'
*   TEXTLINE2           = ' '
*   TEXTLINE3           = ' '
    TEXT_OPTION1        = 'Yes button'
    TEXT_OPTION2        = 'No button'
    TITEL               = 'Choose'
 IMPORTING
   ANSWER              = ANS
          .
 
CASE ANS.
 
  WHEN '1'.
    WRITE 'Yes'.
  WHEN '2'.
    WRITE 'No'.
  WHEN 'A'.
    WRITE 'Cancel'.
ENDCASE.

Regards

Rajvansh

Edited by: Rajvansh Ravi on Nov 18, 2008 8:05 AM

Former Member
0 Kudos

Hi:

Code like this

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = 'Confirmation'

TEXT_QUESTION = 'Confirmation'

TEXT_BUTTON_1 = 'Yes'

TEXT_BUTTON_2 = 'No'

DEFAULT_BUTTON = '1'

IMPORTING

ANSWER = answer

EXCEPTIONS

TEXT_NOT_FOUND = 1

OTHERS = 2

.

Regards

Shashi

pintoo_d
Participant
0 Kudos

Hi Rrajvansh and Chaitanya.

Both your suggestions worked.

Thnx a ton