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 to confirm

Former Member
0 Kudos

hi all,

i am giving a text in the pop up to confirm dialog box.after the message text, i am giving "do you want to continue"

is it possible to put the "Do you want to continue in a new line ".If so can you please tell me how.

The text which i give in the pop up is not constant.

12 REPLIES 12

Former Member
0 Kudos

Use

POPUP_TO_CONFIRM FM and in that pass the text you want to pass...

Former Member
0 Kudos

If you want to display more than 1 lines

you can use COPO_POPUP_TO_GOON.

As for the changing text, try chaning in the code and then pass the values to the FM

Hope it jhelps,

Raj

Former Member
0 Kudos

Hi,

you cn do it like this.


l_msg = 'Do you want to continue in new line'  " your text 
call function 'POPUP_TO_CONFIRM'
    exporting
      titlebar              =  l_msg 
      text_question         = p_w_conf_msg
      text_button_1         = 'Yes'(002)
      text_button_2         = 'No'(005)
      default_button        = '1'
      display_cancel_button = ''
    importing
      answer                = p_wa_answer.

hope this helps

thanks

tanmaya

Former Member

  CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
      TITLEBAR              = 'Title POPUP_TO_CONFIRM'
      TEXT_QUESTION         = 'Click Cancel to Exit'
      TEXT_BUTTON_1         = 'OK'
      ICON_BUTTON_1         = 'ICON_CHECKED'
      TEXT_BUTTON_2         = 'CANCEL'
      ICON_BUTTON_2         = 'ICON_CANCEL'
      DISPLAY_CANCEL_BUTTON = ' '
      POPUP_TYPE            = 'ICON_MESSAGE_ERROR'
    IMPORTING
      ANSWER                = ANS.
  IF ANS = 2.
    LEAVE PROGRAM.
  ENDIF.

0 Kudos

I dont know which version of SAP you are using, but if i am not mistaken from ECC5.0 SAP advises to use only POPUP_TO_CONFIRM.

0 Kudos

Thanks for the sample code, its works find,

Former Member
0 Kudos

 CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_VALUE'
EXPORTING
 DEFAULTOPTION         = 'Y'
  OBJECTVALUE          = '10000000'
 TEXT_AFTER            = 'This is after the value '
  TEXT_BEFORE          = 'This is before the value '
  TITEL                = 'Title POPUP_TO_CONFIRM_WITH_VALUE'
 START_COLUMN          = 25
 START_ROW             = 6
*----for the display of cancel button  do like this.
 CANCEL_DISPLAY       = ' '
IMPORTING
 ANSWER               = ANS
EXCEPTIONS
 TEXT_TOO_LONG        = 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 ANS = 'J' .
    CALL FUNCTION 'POPUP_TO_INFORM'
      EXPORTING
        TITEL = 'Information'
        TXT1  = 'You have pressed Yes'
        TXT2  = ' '
        TXT3  = ' '
        TXT4  = ' '.
  ELSE.
    CALL FUNCTION 'POPUP_TO_INFORM'
      EXPORTING
        TITEL = 'Information'
        TXT1  = 'You have pressed No'
        TXT2  = ' '
        TXT3  = ' '
        TXT4  = ' '.
  ENDIF.

Former Member
0 Kudos

  CALL FUNCTION 'POPUP_TO_CONFIRM_WITH_MESSAGE'
 EXPORTING
  DEFAULTOPTION        = 'Y'
   DIAGNOSETEXT1        = 'This is Testing'
  DIAGNOSETEXT2        = ' '
  DIAGNOSETEXT3        = ' '
  TEXTLINE1            = 'Do You want to Exit'
  TEXTLINE2            = ' '
   TITEL                = 'POPUP_TO_CONFIRM_WITH_MESSAGE'
  START_COLUMN         = 25
  START_ROW            = 6
*----for the display of cancel button  do like this.
  CANCEL_DISPLAY       = ' '
IMPORTING
  ANSWER               = ANS
         .
  IF ANS = 'J' .
*---put code on selecting yes
  ELSE.
*---put code on selecting no
  ENDIF.

Former Member
0 Kudos

Refer to link below:

Regards,

Venkat.

Former Member
0 Kudos

Well even i was trying to have a new line with popup_to_confirm. I tried concatenating with cl_abap_char_utilities=>newline and cr_lf but dint make a difference in the popup message.

0 Kudos

I think the same thing has been discussed a few times in the forum & i dont think that we have any alternative way of doing this using POPUP_TO_CONFIRM.

Will be happy if someone can provide a suitable alternative to this.

Cheers,

Suhas

Former Member
0 Kudos

You can also try Function Module DD_POPUP_TO_CONFIRM_CANCEL.