Skip to Content
You want to display table data in the long-text of a message so that the user can decide based on this information. It’s very easy but can be tricky 😉   if you do not know how to use this FM : RKE_POPUP_TEXT_DECIDE_VARTEXT. Here is a demo program for this purpose ℹ

DATA: lt_mara TYPE TABLE OF mara,

      ls_mara TYPE mara,

      ls_text LIKE tline,

      lt_text TYPE TABLE OF tline.

* fetch 10 rows for display

SELECT * FROM mara INTO TABLE lt_mara

         UP TO 10 ROWS  WHERE matnr NE space.

IF sysubrc EQ 0.

  ls_texttdformat = ‘AS’.

  LOOP AT lt_mara INTO ls_mara.

    ls_texttdline = ls_maramatnr.

    CONDENSE ls_texttdline.

    APPEND ls_text TO lt_text.

    ls_texttdformat = ‘/’.

  ENDLOOP.

  CALL FUNCTION ‘RKE_POPUP_TEXT_DECIDE_VARTEXT’

    EXPORTING

*   OPTIONS              = ” “You can add push-buttons also

      object_id            = ‘NA’

      object               = ‘ZTEST000’

     na_shorttext         = ‘X’

     titel                = ‘Example to show table’

* IMPORTING

*   ANSWER               = “User decision can be captured here

   TABLES

*   T_PARAMS             =

     t_texttab            = lt_text

   EXCEPTIONS

     docu_not_found       = 1

     OTHERS               = 2  .

  IF sysubrc <> 0.

    MESSAGE ID symsgid TYPE symsgty NUMBER symsgno

            WITH symsgv1 symsgv2 symsgv3 symsgv4.

  ENDIF.

ELSE.

  MESSAGE i001(00) WITH ‘Nothing to dispaly’. EXIT.

ENDIF.

The table can be passed as a variable in the message short text like : Select material number & and in the long text you have to insert a “Command” with type &TABLES& or simply &T&.
The output is a message with 10 rows from MARA as an additional info.
Table in message.PNG
To report this post you need to login first.

22 Comments

You must be Logged on to comment or reply to a post.

      1. V S BHARGAV MYLAVARAPU

        Good Document Sandeep, There is another way also where we can do the same thing.

        Using Dialog Text in SE61 and Using the Function Module call POPUP_DISPLAY_TEXT in the ABAP Program. It does the same way as it is mentioned above.

        (0) 
    1. Sandeep Kumar Post author

      Hi Oleg,

      Appreciate the feedback.

      Few things to note regarding FM C14Z_MESSAGES_SHOW_AS_POPUP:

      is only available in EA_APPL add-on and not SAP_APPL.

      – displays output as log display so not really as a table.

      (0) 
            1. Matthew Billingham

              According to the urban dictionary, breeder is a derogatory term for a heterosexual, especially one who lets his/her children run wild. Humble people are (same source), people who are excellent at what they do, but don’t brag about it.

              Neither definition seems to fit Oleg or Sandeep’s usage, so I’d be fascinated to know what was meant as well.

              (0) 
              1. Sandeep Kumar Post author

                I used humble to be modest 😉

                – Marked by meekness or modesty in behavior, attitude, or spirit; not arrogant or prideful –>source thefreedictionary.com

                (0) 

Leave a Reply