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: 

Display a new line in a confirmation popup

Former Member
0 Kudos

Hello there,

I have a report where I would like to inform the user of some open events (taken from DB) and then ask him if he'd like to continue.

My code new is something like this:

SELECT ... INTO TABLE lt_events WHERE.... "my data

DATA newline TYPE string

newline = cl_abap_conv_in_ce=>uccp( '0d0a' ) "new line code

lv_question = 'Attention! there are some open events'.

CONCATENATE lv_question newline INTO lv_question.

LOOP AT lt_events INTO ls_events.

     CONCATENATE lv_question newline ls_events-string INTO lv_question.

ENDLOOP.

CALL FUNCTION 'POPUP_TO_CONFIRM'

     EXPORTING

          titlebar = 'open events'

          text_question = lv_question

          ...

.....

...

But when the popup appears in the screen everything is close to each other and without the new lines

How can I make the new lines appear in the popup??

Thanks

1 ACCEPTED SOLUTION

vladimir_erakovic
Contributor
0 Kudos

Hi Daniel,

Try to use CL_ABAP_CHAR_UTILITIES=>NEWLINE  or NEW-LINE word.

Hope it will work.

Regards

9 REPLIES 9

vladimir_erakovic
Contributor
0 Kudos

Hi Daniel,

Try to use CL_ABAP_CHAR_UTILITIES=>NEWLINE  or NEW-LINE word.

Hope it will work.

Regards

0 Kudos

Hello Vladimir,

Both of them didn't work

0 Kudos

use below code.. Please find screenshot for more details.

  DATA: w_param5      TYPE spar,
      answer TYPE char1,
       i_parameters5 TYPE STANDARD TABLE OF spar,
       w_text_q5     TYPE string.

MOVE 'hai first line'   TO w_param5-value.
MOVE 'TEXT1'    TO w_param5-param.
APPEND w_param5 TO i_parameters5.


CONCATENATE 'hai second line'
            ' '
            INTO
            w_text_q5.


CALL FUNCTION 'POPUP_TO_CONFIRM'
  EXPORTING
    titlebar        = 'WARNING !'
    diagnose_object = 'ZDIAGNOSE_OBJECT'
    text_question   = w_text_q5
  IMPORTING
    answer          = answer
  TABLES
    parameter       = i_parameters5
  EXCEPTIONS
    text_not_found  = 1

diagnose_object = 'ZDIAGNOSE_OBJECT' -> you have to create through SE61

0 Kudos

   CONCATENATE '------------------'
            ' '
            INTO
            w_text_q5.

0 Kudos

Close enough

Thank you

vladimir_erakovic
Contributor
0 Kudos

Apparently this isn't possible with popup_to_confirm.

Check this discussion and maybe use some other function:

http://scn.sap.com/thread/1639621

former_member192854
Active Participant
0 Kudos

Hi Daniel,

ever considered something like this with a nice ALV popup?

DATA lt_message TYPE STANDARD TABLE OF char255.

DATA lo_alv TYPE REF TO cl_salv_table.

DATA lv_line TYPE char255.

lv_line = 'This is the first piece'.

INSERT lv_line INTO TABLE lt_message.

lv_line = 'This the second'.

INSERT lv_line INTO TABLE lt_message.

TRY.

  cl_salv_table=>factory(

    IMPORTING

      r_salv_table = lo_alv

    CHANGING

      t_table      = lt_message ).

    CATCH cx_salv_msg.

      MESSAGE e398(00) WITH 'Technical error occured'.

ENDTRY.

lo_alv->set_screen_popup( start_column = 5 end_column = 90 start_line = 5 end_line = 25 ).

lo_alv->display( ).

IF sy-ucomm EQ '&ONT'.

* Define your action when closed with green check'

ENDIF.

Best,

Sander



0 Kudos

Sander,

Really close to what I need, BUT:

     1) I don't need a table view, just multiple lines

     2) I need two buttons, OK and CANCEL

0 Kudos

is this what they call a big but?

I think you can add the buttons to the ALV - that's one.

And table view / multiple lines, is a matter of taste / being pragmatic.

The solution Modadugu provided works for an 'infinite' number of lines?

Best,

Sander