Application Development and Automation Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
9,164
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 :wink:   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 sy-subrc EQ 0.

  ls_text-tdformat = 'AS'.

  LOOP AT lt_mara INTO ls_mara.

    ls_text-tdline = ls_mara-matnr.

    CONDENSE ls_text-tdline.

    APPEND ls_text TO lt_text.

    ls_text-tdformat = '/'.

  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 sy-subrc <> 0.

    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  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.
22 Comments
Former Member
0 Kudos

Thanks a lot

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

You are most welcome :cool:

Former Member
0 Kudos

Its really gud and help full

Former Member
0 Kudos

Thanks Sandeep..

Former Member
0 Kudos

Not a very beautiful version of the output. Probably best to look here: http://scn.sap.com/community/abap/blog/2013/04/09/how-to-display-messages-in-a-popup-window-in-sap

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

Former Member
0 Kudos

Ok: FINB_BAPIRET2_DISPLAY

Former Member
0 Kudos

or POPUP_WITH_TABLE_DISPLAY_OK or SMPO_DISPLAY_MESSAGES

Former Member
0 Kudos

But in fact, the best "breeders" recommend to use the functions of the group SBAL_DISPLAY

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

SMPO_DISPLAY_MESSAGES is a very good alternative.

Former Member
0 Kudos

Thank you so much sandeep

Former Member
0 Kudos

Bhadiya...

h

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

There are "humble" abapers too :razz:

0 Kudos

Thanks for the contribution. Will be helpful to people looking for quick fix solutions.

Former Member
0 Kudos

Good One

Venkat_Sesha
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

jayan_abap
Explorer
0 Kudos

Thanks Sandeep.. :smile:

Former Member
0 Kudos

Thansk Sandeep!

But I don't get what you've just said, what are 'breeders' and 'humble' ABAPers?

matt
Active Contributor
0 Kudos

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.

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

I used humble to be modest :wink:

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

Former Member
0 Kudos

I mean the word in the context of "the best dog breeders" recommend 🙂

fmunozb
Active Participant
0 Kudos

Thanks, very good.