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

regading popup in dialog programming?

Former Member
0 Likes
869

hi frnds,

my requirement is in my screen i hve a popupbox.In pop up i have 3 pushbuttons.YES,NO,and CANCEL.

if i click yes pushbuttons i have to display dialog box..

were to write code for pop up button.

eg.

pai...

case sy-ucomm.

when save.

call popup_to _confirm.

when 'yes'.

can i call my dialog box. here

7 REPLIES 7
Read only

Former Member
0 Likes
843

try this code with function module

'FI_WT_POPUP_TO_CONFIRM_STEP'

data answer.
      call function 'FI_WT_POPUP_TO_CONFIRM_STEP'
      exporting
        defaultoption = 'N'
        textline1     = 'something'
        titel         = 'something'
      importing
        answer        = answer.

    if answer = 'J'.
"do something
else.
"do something
  endif.

Read only

valter_oliveira
Active Contributor
0 Likes
843

Hello.

First of all, your pop-up can be a screen. Create a screen of type modal screen (Attributes->Screen Type->Modal Dialog Box). This screen will have prepares the buttons, accept, reject and cancel.

In your program, module user_command, when ok_code is 'YES', just call this screen.

This is more robust than calling a popup FM.

Regards.

Valter Oliveira.

Read only

Former Member
0 Likes
843

Hi,

Chk this.

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'

start_column = 25

start_row = 6

IMPORTING

answer = v_ans

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.

Regards

Sandeep Reddy

Read only

Former Member
0 Likes
843

Hi,

chk this.

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.

Regards

Sandeep Reddy

Read only

Former Member
0 Likes
843

Hi Tumma,

Create a modal dialog screen first. Let the created screen number be 0002.And the icon name as YES.In the PAI of the screen where you have kept the YES,NO,CANCEL buttons, write the code as:

Case SY-UCOMM.

When 'YES'.
Call screen '0002'.

EndCase.

Reward points if helpful.

thanks,

Khan.

Read only

0 Likes
843

Hello,

U can do this after calling FM popup_to_confirm

As the output of this function module is stored in sequence of button i.e. 'Yes' is first button then output l_ans will be ' 1 ' similarly for 'No' its ' 2 ' and for 'Cancel' its ' 3 '

Your dialog screen is also a screen, so will creating this dialog screen just click on modal dialog screen radio button on screen button. Here it is necessary to pass top left and bottom right coordinate to call csreen.

U can write following code:

IF l_ans EQ ' 1'.
CALL SCREEN <screen> STARTING AT <top left>

 ENDING   AT  <bottom right>.
ELSE.
LEAVE PROGRAM.
ENDIF.

Reward if useful.

Read only

Former Member
0 Likes
843

I need a code for copying a row in another row in ALV