Skip to Content
author's profile photo Former Member
Former Member

Popup screen using popup_to_confirm

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2008 at 07:24 AM

    Hi,

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

    Darren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2008 at 07:28 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2008 at 07:29 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2008 at 07:32 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 21, 2008 at 08:50 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.