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: 

Popup screen using popup_to_confirm

Former Member
0 Kudos

Hi all,

I have created a pop-up screen using FM popup_to_confirm.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

TITLEBAR = ' Warning '

  • DIAGNOSE_OBJECT = ' '

text_question = 'Mandatory field is not filled. Do you wish to save the order? '

TEXT_BUTTON_1 = 'CHOOSE'

ICON_BUTTON_1 = 'ICON_YES'

TEXT_BUTTON_2 = 'Save '

ICON_BUTTON_2 = 'ICON_NO'

DEFAULT_BUTTON = '2'

DISPLAY_CANCEL_BUTTON = ''

  • IMPORTING

  • ANSWER =

  • 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.

Here if i select choose button an operation has to be performed similarly for save a different operation needs to be performed. For that i have tried 2 means.

1) Case sy-ucomm.

when 'CHOOSE'.

exit.

when 'SAVE'.

RV45A-ASTTX = '10'.

endcase.

2) Case sy-ucomm.

when 'ICON_YES'.

exit.

when 'ICON_NO'.

RV45A-ASTTX = '10'.

endcase.

But both are not working.... Anyone who knows solution please help me on this. Useful informations will be rewarded.

Thanks and Regards,

Subbu.

5 REPLIES 5

Former Member
0 Kudos

Hi,

Use the ANSWER parameter returned from the function module, this tells you which button was selected.

Darren

Former Member
0 Kudos

u re doing the wrong way...do not check for sy-ucomm..


  CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
      titlebar              = text-003
*     DIAGNOSE_OBJECT       = ' '
      text_question         = text-002
*     TEXT_BUTTON_1         = 'JA'(001)
*     ICON_BUTTON_1         = ' '
*     TEXT_BUTTON_2         = 'NEIN'(002)
*     ICON_BUTTON_2         = ' '
*     DEFAULT_BUTTON        = '1'
*     DISPLAY_CANCEL_BUTTON = 'X'
*     USERDEFINED_F1_HELP   = ' '
*     START_COLUMN          = 25
*     START_ROW             = 6
*     POPUP_TYPE            =
    IMPORTING
      answer                = wrk_answer
*   TABLES
*     PARAMETER             =
    EXCEPTIONS
      text_not_found        = 1
      OTHERS                = 2.

check for the 'ANSWER' Return values: '1', '2', 'A'


'1' left pushbutton
'2' next pushbutton
'A' 'Cancel' pushbutton

Hope this will solve ur problem...

Edited by: Sukriti Saha on Oct 21, 2008 9:28 AM

Former Member
0 Kudos

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

titlebar = 'Confirm'

text_question =

'Do you want to overwrite existing contract data'

IMPORTING

answer = l_answer

EXCEPTIONS

text_not_found = 1

OTHERS = 2

.

IF sy-subrc = 0.

CASE l_answer .

WHEN '1' .

PERFORM sub_get_data.

WHEN '2' .

PERFORM sub_get_zcontract_data .

WHEN 'A' .

LEAVE TO SCREEN '9001' .

ENDCASE .

ENDIF.

              • Whenever you are using any function module unknown to u, just check once where used and find out the necessary parameter to pass and how to use them..

Former Member
0 Kudos

Hi

Please assign a local variable to the ANSWER variable.

eg ANSWER = return_value

After you press the push button, following values will be assigned to ANSWER.

'1' left pushbutton

'2' next pushbutton

'A' 'Cancel' pushbutton

Then use ur code as follows

1) Case return_value.

when '1'.

exit.

when '2.

RV45A-ASTTX = '10'.

endcase.

Regards

Winnie

Former Member
0 Kudos

Hi,

Check the following code:

There is no need to write code of sy-ucomm. Because, you are assiging the icons to buttons.

DATA: X_ANS(1) TYPE C.

data: text type string value 'Do you want to ocntinue?'.

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

  • TITLEBAR = ' '

  • DIAGNOSE_OBJECT = ' '

text_question = text

TEXT_BUTTON_1 = 'Choose'

ICON_BUTTON_1 = 'ICON_CHECKED'

TEXT_BUTTON_2 = 'No'

ICON_BUTTON_2 = 'ICON_MESSAGE_CRITICAL'

DEFAULT_BUTTON = '1'

  • DISPLAY_CANCEL_BUTTON = 'X'

  • USERDEFINED_F1_HELP = ' '

START_COLUMN = 25

START_ROW = 6

  • POPUP_TYPE = POPUP_TYPE

  • IV_QUICKINFO_BUTTON_1 = ' '

  • IV_QUICKINFO_BUTTON_2 = ' '

IMPORTING

ANSWER = x_ans

  • TABLES

  • PARAMETER = 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 x_ans.

when '1'.

exit.

when '2'.

RV45A-ASTTX = '10'.

when others.

write 'you selected cancel button'.

endcase.

Regards,

Bhaskar