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

Coding for Popup window

Former Member
0 Likes
571

Hi,

In my screen, if the user failed to populate MailUpdate Flag value field but updating the MailAddress Field, then upon saving, a pop up window should come indicating that "MailUpdate Flag valule is empty,kindly update it". After giving the required value it should save. This is my requirement.Kindly help me on this.Points will be awarded for helpful answers.

With Regards,

Manikandan Rajendran

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
500

hi Manikandan,

I assume that the " Mail Update Flag" is a check box in your screen. If this is the

case, then you can ues the function module POPUP_CONTINUE_YES_NO

and based on the import parameter ANSWER you can set the flag in the program

field:

sample code:


   if sy-ucomm = 'SAVE'.
      if mail_update_flag is initial.
           if mail_address is not initial.
            CALL FUNCTION 'POPUP_CONTINUE_YES_NO'
            EXPORTING
              DEFAULTOPTION = 'N' "NO Button    
              TEXTLINE1     = WA_TEXTLINE1  " Mail update flag is not selected
              TEXTLINE2     = WA_TEXTLINE2  " Do you want to sent mail updates?
              TITEL             = text-004
            IMPORTING
              ANSWER       = FLAG-POST.

            IF FLAG-POST = 'J'.  " YES Button selected
                  PERFORM SET_FLAG_FOR_MAIL_UPDATE.
            ENDIF.
         endif.
     endif.
endif.

Also, you can consider the option of making the field

disabled if the check box is not selected. only if

the check box is selected, you should make the field

for email address field input enabled.....

Hope this helps,

Sajan Joseph.

2 REPLIES 2
Read only

Former Member
0 Likes
501

hi Manikandan,

I assume that the " Mail Update Flag" is a check box in your screen. If this is the

case, then you can ues the function module POPUP_CONTINUE_YES_NO

and based on the import parameter ANSWER you can set the flag in the program

field:

sample code:


   if sy-ucomm = 'SAVE'.
      if mail_update_flag is initial.
           if mail_address is not initial.
            CALL FUNCTION 'POPUP_CONTINUE_YES_NO'
            EXPORTING
              DEFAULTOPTION = 'N' "NO Button    
              TEXTLINE1     = WA_TEXTLINE1  " Mail update flag is not selected
              TEXTLINE2     = WA_TEXTLINE2  " Do you want to sent mail updates?
              TITEL             = text-004
            IMPORTING
              ANSWER       = FLAG-POST.

            IF FLAG-POST = 'J'.  " YES Button selected
                  PERFORM SET_FLAG_FOR_MAIL_UPDATE.
            ENDIF.
         endif.
     endif.
endif.

Also, you can consider the option of making the field

disabled if the check box is not selected. only if

the check box is selected, you should make the field

for email address field input enabled.....

Hope this helps,

Sajan Joseph.

Read only

vallamuthu_madheswaran2
Active Contributor
0 Likes
500

Hi,

try the following FM

CALL FUNCTION 'POPUP_TO_CONFIRM'

EXPORTING

titlebar = 'CONFIRMATION'

  • DIAGNOSE_OBJECT = ' '

text_question = lv_msg ==> MailUpdate Flag valule is empty,kindly update it

text_button_1 = 'YES'

  • ICON_BUTTON_1 = 'ICON_DELETE'

text_button_2 = 'NO'

  • ICON_BUTTON_2 = 'ICON_CANCEL'

    • DEFAULT_BUTTON = '1'

display_cancel_button = ' '

  • USERDEFINED_F1_HELP = ' '

start_column = 30

start_row = 10

  • POPUP_TYPE =

  • IV_QUICKINFO_BUTTON_1 = ' '

  • IV_QUICKINFO_BUTTON_2 = ' '

IMPORTING

answer = lv_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.

Good Regards,

vallamuthu.M